Home > Operation and Maintenance > Apache > Apache configuration under Windows (Alibaba Cloud ECS as an example)

Apache configuration under Windows (Alibaba Cloud ECS as an example)

PHP中文网
Release: 2019-05-25 15:01:48
Original
6347 people have browsed it

1. Basic introduction to Apache

Apache HTTP Server (referred to as Apache) is an open source web server. The web server uses port 80 by default, and usually uses tomcat or php to process dynamic content. , while using mysql as the database, the installation and configuration of tomcat, php and mysql are detailed in other documents. This document is only the installation and configuration of apache. (What is apache server)

2. Apache installation

Download the apache installation package, double-click to start the installation, click Next, the system will appear For setting information, fill in your domain name (for example: test.com) under Network Domain, fill in your server name under Server Name (for example: www.testr.com, that is, the host name plus domain name), and fill in the Administrator's Email Under Address, fill in the contact email address of the system administrator (for example: test@aliyun). All three pieces of information can be filled in arbitrarily, and the website can be configured later.

Choose to install all, we choose to install on the D drive, and the installation is completed. Note: You can also use the PHP integrated environment tool phpStudy to install Apache.

Apache configuration under Windows (Alibaba Cloud ECS as an example)

3. Apache basic configuration

1. One way to start and shut down apache is to operate the icon in the lower right corner.

The other is to start the menu bar operation.

2. Apache logs, access logs and error logs can be viewed through the start menu or under %home%\logs.

3. The configuration file of apache can also be viewed in the start menu bar, or in %home%\conf\.

4. Configure apache site

(1) First configure the domain name and binding site IP. The binding domain name can be set when installing apache. After installation, it can be set in the configuration file %home% \conf\httpd.conf changes the ServerName option.

Binding IP can be set in the Listen option.

(2) Set the home directory of the website, which can be set in the DocumentRoot field in the configuration file.

(3) Setting the homepage of the website can be set through the DirectoryIndex field.

(4) Log settings, you can set the path to the access log in Customlog, and set the format of the log through LogFormat.

Define the path of the error log through the ErrorLog field. LogLevel records the log level. This is set to record logs above warning information.

5.apache virtual host configuration

(1) IP-based virtual host, the meaning of each noun has been explained previously and will not be repeated here.

(2) Domain name-based virtual host

4. PHP configuration

1. Create a new directory php on the D drive and unzip the php package to php.

2. Change the name of D:\php\php.ini-development to php.ini

3. Add the php support module to the apache configuration file httpd.conf.

4. See the database documentation for PHP connection database settings.

Appendix 1

Format and meaning of Apache access log

Example: 192.168.157.1 - - [26/Dec/2012:09:14 :43 0800] "GET /favicon.ico HTTP/1.1" 404 209

1. Client IP 2.-(E-mail) 3.-(Login name), 4. Request time 5. Method Resource protocol 6. Status code 7. Number of bytes sent

Format and meaning of Apache error log

Example: [Wed Dec 26 09:20:46 2012] [error] [client 192.168 .157.1] File does not exist: D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/favicon.ico

1. Time 2. Log level 3. Client IP 4. Error message

The above is the detailed content of Apache configuration under Windows (Alibaba Cloud ECS as an example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template