Thursday, March 3, 2011

Apache virtual hosts and the virtual directory settings

Units of the original one Web server, there are a large number of static pages.

Recent leadership requirements to Web mode on some content management using Active Server Pages technology. First, the requirements of the original Web site use "http://10.2.1.102" access to existing Web sites use "http://10.2.1.103" access, the FTP site content into the "http://10.2.1.103/ziyuan" for Web browsing (FTP and Web server on the same computer, the installation of a different folder when you install the Apache server to listen on port 80, "10.2.1.103" as the default Web access address, the Web root directory to store dynamic page folder, so as long as you set up a virtual host). Second, based on the IP address of the virtual host settings (the original Web site 10.2.1.102) of 1. using the "Notepad" program to open the "httpd.conf" profile. This file is stored in the Apache Server installation path "conf" folder. 2. position the cursor to the end of the file back to the line endings, write to the following, note the brackets and braces should not write the content. (Set the hostname and listening ports by: host address: port) ServerAdmin & nbspbdwjh@163.com (set the administrator mailbox, you write your own mailbox now) DocumentRootd:/wwwroot (set the site root, the original static Web sites root directory) servernamewww.little.com (website domain name, not just sets a) ErrorLoglogs/www.little.com-error_log (set log location, you can start with "#" comment) CustomLoglogs/www.little.com-access_logcommon (ibid. lines description) 3. repeat the content, you can add more Web hosting. 4. save the above contents, restart the Apache server. Third, the virtual directory settings (display school FTP site content) of 1. using the "Notepad" program to open the "httpd.conf" profile. 2. find the following content, content to author the parentheses. Alias/icons/D:/Apache2/icons/"(set virtual directory name to" icons ", placed in the root of your Web site within the" icons ", their real address to" D:/Apache2/icons/". Please note that the "/icons/" end with a slash, which requires input access address is to enter the final slash, such as "http://10.2.1.103/icons/", if this is omitted, you can enter the access address is omitted, but the system will automatically give plus the slash. Real address "D:/Apache2/icons/" due to the installation location, and need to be aware) (set the virtual directory properties) OptionsIndexesMultiViews (when no home page to show the files and folders) AllowOverrideNone Orderallow, deny Allowfromall 3. back-of-line after modified the above contents are as follows. Alias/ziyuan "D:/ftproot/" (access you can omit the final slash) OptionsIndexesMultiViews AllowOverrideNone Orderallow, deny Allowfromall 4. save the above contents, restart the Apache server. This article in Windows2000/Windows2003, ApacheApache/2.0.52, PHP/MySQL/4.1.9 5.0.3, environment test passed.

No comments:

Post a Comment