Apache installation and configuration

Apache installation

1. to Download Download
2. Download a good path to extract to plain English folder
3. Open as Administrator cmd
4. cd 刚刚解压的文件夹路径下的找到的bin文件夹
5. httpd.exe -k install
in 6. Apache24\confLocate httpd.confthe file open for write
7. Here Insert Picture Descriptionpath to find here, as modified extracting the original path
8. httpd.exe ‐t
the display Syntax OK
11.

Restart the Apache service
 httpd.exe ‐k restart ‐n "Apache"
Stop the Apache service
 httpd.exe ‐k stop ‐n "Apache"

12. Enter the localhost FIG appear in the browser indicates successful installation
Here Insert Picture Description

Configuration (httpd.conf for configuration file)

Here Insert Picture Description
Here Insert Picture Description

Default Document

When is a directory rather than a specific file accessed by the client, the server returns a document in the default directory under
Here Insert Picture Description

Web Hosting

Get more than two in a host sites
with virtual host default host will fail
become the first virtual host
Here Insert Picture Description
This feature allows the introduction of an external configuration file
below for an external configuration file (httpd-vhosts.conf) Configuring
Here Insert Picture Description
remember plus label Directory
Here Insert Picture Description

Virtual resolve domain names

Achieved by modifying the hosts file

PHP configuration support

Apache can handle only a static file requests for the suffix .php file this dynamic, it can not be performed, so as a static file is returned directly to the client. The client after receipt will not resolve the above code printed directly onto the page.
Apache is to find the file extension of the file type, and then one by one to try whether each module can handle this type of file, Ruoguo, these modules can not handle, Apache will handle, according to a static file processing mode.

PHP is installed on the server

1. Unzip php to plain English directory path
2. Add support PHP configuration in Apache
1. Add the PHP processing module in Apache
Here Insert Picture Description
2. Add parse the .php extension support in the node
Here Insert Picture Description
3. The default configuration file to add the node index. php
default document refers to when accessing a directory rather than a specific file name, the default file name execution
Here Insert Picture Description

Published 116 original articles · won praise 4 · Views 1778

Guess you like

Origin blog.csdn.net/qq_43618136/article/details/104238510
Recommended