Install Apache and virtual directory configuration in Windows environment

Source: Internet
Author: User
Tags documentation win32

This article provides a very brief overview of how to install apache2.2.x and configure virtual directories under the Windows platform. As a reference for quick installation. The best documentation for the detailed setup is the official documentation. See the link below, and a careful review of the documentation when installing the configuration is a good solution.

1. Apache HTTP Server Version 2.2 English document

2. Apache HTTP Server Version 2.2 Chinese document


Preparation conditions


Download the corresponding version of Apache to (Note: 2.0 is different from the 2.2 version of Apache and is incompatible with each other, so you need to download the corresponding version of Apache based on your application.) If you do not need to use SSL, download the Apache 2.x.x-win32-x86-no_ssl.msi, and if you need to use it, you need to download Apache 2.x.x-win32-x86-openssl-x.x.x.msi




Double-click the installer, which will guide you through the installation process. Make sure you enter the correct server URL (if your server does not have a DNS name, you can enter the IP address directly). It is recommended that Apache be installed as "for all Users,on Port 80,as a service" Apache will automatically install a system service to start automatically. Note: If you already have an IIS or other program using port 80, the installation may fail. If so, you can find the file httpd.conf in the Apache groupapache2conf directory in the program directory, and convert listen 80 to a unused port, such as Listen 81. Then run the installer again, and this time there should be no more problems.

After the installation is finished, type http://loccalhost in the browser, and if a site is already configured, then Apache is installed successfully.

If you install Apache as a service, it will run with the local system account. It would be safer to create a separate user for Apache to run it.

Open the Apache installation directory, locate the file/conf/httpd.conf, and open it for configuration editing. The configuration file has a more detailed description of each item, and you can run the test Configuration tool in the Apache installation folder in the Start menu to verify that the configuration file is correct after the configuration is complete. A brief description is given if the configuration is incorrect. If you pass the test Configuration tool at the end of the configuration, but still do not run Apache successfully, you can go to the [Apache installation directory]/logs/directory to view the records to find out what the problem is.


Configuring httpd.conf Files


# set up the document home directory, followed by the disk directory

DocumentRoot "D:/programs/apache2.2/htdocs"

# Add a virtual directory, the following settings in the browser to enter http://localhost/webpath/time access to the server's "D:/programs/webpath" directory


# when the/webpath is not followed by "/", in the browser can be entered Http://localhost/webpath Apache will automatically add "/" in the following

Alias/webpath "D:/programs/webpath"

# URL Redirection

Redirect permanent/foo/

# Set Virtual Host: Please refer to

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.