[Apache] Built under Windows Apache server

Source: Internet
Author: User

First, download

Download installation program
Apache2.2.4 version download, address: http://httpd.apache.org/download, select
Apache_2.2.4-win32-x86-no_ssl.msi, about 4M more.

Second, installation

Run the downloaded Apache file to start the installation. The Apache installation process is simple. You only need to set the following window:
Enter the domain in Network domain. If you use the site's level two domain name, for example "Test.dnschek.net", please enter "Test.dnschek.net". If using a top-level domain name, enter "XXX.com".

Enter the server name in "server name". If you use the site's level two domain name, please enter your domain name "test.dnschek.net". If using a top-level domain name, enter "Www.xxx.com".

In the "Administrator's email address", enter the webmaster email addresses.

In addition, all the options in the installation process are all available with the default options.
Third, the operation

1, Win 9x:

After Apache installs, a "Apache HTTP Server" group is added to "Start", "programs". Go to this group and select "Control Apache Server" and "Start" to launch Apache.

2, Win nt/2000/xp/2003

In these systems, Apache installed with the default option, in addition to the "Start", "program" to add an "Apache HTTP Server" group, but also in the system's services to add an Apache service. The service is set to run automatically when the system starts.
Configure Apache
One, configuration file

Apache is a program running in the background with no interface. All configurations are included in the configuration file. The main configuration file is:

C:/Program Files/apache group/apache/conf/httpd.conf

If you want to modify the configuration of Apache, you can edit the configuration file with any text editing tool (such as Notepad). In the configuration file, lines that begin with "#" are comment lines.
Second, configuration options

The main options in the configuration file are as follows:

#Listen 3000
#Listen 12.34.56.78:80

The IP address and port of Apache. In general, no settings are required, and Apache binds to port 80 on all IP addresses on this computer.

Port 80

Apache Port. The default value is 80.

ServerName test.dnschek.net

The name of the Web server. The "Server Name" entered at the time of installation is saved here.

DocumentRoot "C:/Program Files/apache group/apache/htdocs"

This is the root directory of the Web site. If you want to store the Web site files in the "D:/myweb" directory, you can change the directory behind DocumentRoot to "D:/myweb".

Options Indexes followsymlinks MultiViews

For safety reasons, please delete the "Indexes" above. Otherwise, people can browse to all the files on your site.

DirectoryIndex index.html

Default home file name. When you enter an address in the browser (for example, http://test.dnschek.net/), Apache will look for the default home file to open. If you want to configure multiple default home page filenames, separate them with a space.

scriptalias/cgi-bin/"C:/Program Files/apache group/apache/cgi-bin/"

The CGI file storage path.
Third, Advanced Configuration
1. Set up the virtual directory

In the configuration file, look for the following line:

<ifmodule mod_alias.c>

Below this line, add the following:

alias/vdir/"c:/comexe/"

<directory "c:/comexe/" >
Options MultiViews
AllowOverride None
Order Allow,deny
Allow from all
</Directory>

This allows access to the contents of the c:/test/directory by accessing http://test.dnschek.net/vdir/.

Apache opens two virtual directories by default: "/icons/" and "/manual/". These two virtual directories are not available and can be removed from the configuration file.

2, how to solve the Chinese web page display garbled

(1) In the configuration file, look for lines that contain "AddLanguage" or "Addcharset", and add one line to the front of the lines:

Adddefaultcharset GB2312

(2) Develop good habits and add this line to the

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

The general Chinese version of the page editing tools (such as FrontPage, Dreamweaver, and so on) will automatically add this line.
3. How to solve the Chinese file name cannot be accessed

In IE, select Tools, Internet Options, advanced--Cancel always send URLs as UTF-8.

This method is very troublesome, please try not to use the Chinese website file name.
Please note:

1, Apache configuration process the most critical two points are: the site root directory and the default home page file name. The Web site file must be placed at the root of the specified Web site, and the default home file name must be set correctly, otherwise you will not see your Web page.

2. After each configuration file change, to restart Apache will not take effect.

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.