Quick HOWTO : Ch20 : The Apache Web Server
- 编辑:admin -Quick HOWTO : Ch20 : The Apache Web Server
if your Internet connection uses DHCP to get its IP address,mydraw, "Dynamic DNS"。
but the firewall presents it to the world with an external IP address of 97.158.253.26 via NAT/masquerading. If you are on the inside。
you can create one configuration file per Web site each with its own set of VirtualHost and Directory containers. This can make Web site management much simpler. To do this correctly: Backup your httpd.conf file, that's what the client will use. The Windows equivalent of the Linux /etc/hosts file is named C:\WINDOWS\system32\drivers\etc\hosts. You need to open and edit it with a text editor, then wild cards won't work. The Apache SSL module demands at least one explicit VirtualHost directive for IP-based virtual hosting. When you use wild cards, page named index.html. So for example, it will just use its cached version instead. Frequently occurs when a surfer is browsing back and forth on a site. 401 Unauthorized access. Someone entered an incorrect username / password on a password protected page. 403 Forbidden. File permissions or contexts prevents Apache from reading the file. Often occurs when the web page file is owned by user "root" even though it has universal read access. 404 Not found. Page requested doesn't exist. 500 Internal server error. Frequently generated by CGI scripts that fail due to bad syntax. Check your error_log file for further details on the script's error message. The Apache Error Log Files The /var/log/httpd/error_log file is a good source for error information. Unlike the /var/log/httpd/access_log file, explains port forwarding。
they would type the link: Apache lists all the contents of the files in the example directory if it can't find the index.html file. You can disable the directory listing by using a -Indexes option in the Directory directive for the DocumentRoot like this: Directory "/home/www/*" ... ... ... Options MultiViews -Indexes SymLinksIfOwnerMatch IncludesNoExec Remember to restart Apache after the changes. Users attempting to access the nonexistent index page will now get a "403 Access denied" message. Note: When setting up a yum server it's best to enable directory listings for the RPM subdirectories. This allows web surfers to double check the locations of files through their browsers. Handling Missing Pages You can tell Apache to display a predefined HTML file whenever a surfer attempts to access a non-index page that doesn't exist. You can place this statement in the httpd.conf file。
as I'll explain soon. DocumentRoot : Defines the directory in which the web pages for the site can be found. By default, Linux Web server bigboy has an internal IP address of 192.168.1.100, using 127.0.0.1 for ServerNameStarting httpd: [Wed Feb 04 21:18:16 2004] [error] (EAI 2)Name or service not known: Failed to resolve server name for 192.16.1.100 (check DNS) -- or specify an explicit ServerName You can avoid this by adding a default generic ServerName directive at the top of the httpd.conf file that references localhost instead of the default new.host.name:80. #ServerName new.host.name:80ServerName localhost The Apache Status Log Files The /var/log/httpd/access_log file is updated after every HTTP query and is a good source of general purpose information about your website. There is a fixed formatting style with each entry being separated by spaces or quotation marks. Table 20-3 lists the layout. Table 20-3 Apache Log File Format Field Number Description Separator 1 IP Address of the remote web surfer Spaces 2 Time Stamp Square Brackets [] 3 HTTP query including the web page served Quotes "" 4 HTTP result code Spaces 5 The amount of data in bytes sent to the remote web browser Spaces 6 The web page that contained the link to the page served. Quotes "" 7 The version of the web browser used to get the page Quotes ""