Apache Virtual host and virtual directory settings

Source: Internet
Author: User
Tags ftp ftp site requires root directory
There is a large number of static Web pages in the original unit of a Web server. The recent leadership requires that content be managed on a web basis, using Dynamic Web technology.

I. Requirements

The original web site uses "http://10.2.1.102" access, the existing Web site using "http://10.2.1.103" Access, the school FTP site content on the "Http://10.2.1.103/ziyuan" For web browsing (FTP and Web as different folders for the same server, installing the Apache server is already installed to listen on 80 ports, "10.2.1.103" is the default Web Access address, the Web root is the folder where dynamic Web pages are stored, so just set up a virtual host).

Second, based on IP address of the virtual host settings (original web site 10.2.1.102)

1. Open the "httpd.conf" configuration file with the Notepad program. This file is stored in the "Conf" folder under the Apache Server installation path.

2. Cursor positioning to the end of the file, carriage return line, write the following, note the parentheses and the contents of the parentheses do not write.

(Set the virtual host name and listening port by: Host Address: Port)

ServerAdmin bdwjh@163.com

(Set up administrator's mailbox, write your own mailbox)

DocumentRoot D:/wwwroot

(Set Web site root, original static site root directory)

ServerName www.little.com

(Set the site domain name, not just set a random)

ErrorLog Logs/www.little.com-error_log

(Set the log location, you can add the "#" note at the beginning of the line)

Customlog Logs/www.little.com-access_log Common

(as explained in the previous line)

3. Repeat the above content, you can add more virtual host.

4. Save the above content and restart the Apache server.

Third, virtual directory settings (show the content of the school FTP site)

1. Open the "httpd.conf" configuration file with the Notepad program.

2. Find the following content, the parenthesis content is added by the author.

alias/icons/"d:/apache2/icons/"

(Set the virtual directory name "Icons", put it in the "icons" of the root directory of the Web site, and its true address is "d:/apache2/icons/".) Note that "/icons/" ends with a slash, which requires that you enter the last slash when entering the address, such as "http://10.2.1.103/icons/", if omitted here, you can enter the access address omitted, but the system will automatically add this slash. The real address "d:/apache2/icons/" is different from the installation location, you need to pay attention to

(Set virtual directory properties)

Options Indexes MultiViews

(whether to display files and folders when there is no home page)

AllowOverride None

Order Allow,deny

Allow from all

3. Enter the changes after entering the line to change the above contents as follows.

Alias/ziyuan "d:/ftproot/" (You can omit the last slash when accessing)

Options Indexes MultiViews

AllowOverride None

Order Allow,deny

Allow from all

4. Save the above content and restart the Apache server.

In this paper, windows2000/windows2003, apacheapache/2.0.52, php/5.0.3, mysql/

Test pass in 4.1.9 environment.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.