Php learning-Apache server details. Php learning-Apache server explanation Php learning server -- Apache server explanation Iis server: mainly serves Microsoft, and Apache server explanation based on Internet basic service Php learning running Microsoft Windows
Php learning server-Apache server details
IisServer: It mainly serves Microsoft and is based on basic internet services running Microsoft windows.
LighttpdServer:Open-source software for high performance, low memory overhead, low cpu usage, and insufficient maturity
Introduction to Apache server
1. packet capture software: httpwatch.rar, learn about packet sending and receiving 2. install Apache server
1. check the installed services in windows and confirm that apache has not been installed.
2. install the apache server:
3. check whether the test is successful. Enter http: // localhost/in the browser to display itworks, indicating that the installation is successful.
3. use and configure the Apache server, start and stop, install and configure the server
1. refer to the Chinese version of Apache official website Reference Manual
2. After Apache is installed successfully, windows runs as a service.
3. In most cases, the apahce server is not local, so it is important to use command line remote management to enable or stop the server.
Httpd-k start [shutdown "restart] [note] the httpd application is located in the directory of the apache installation file. it is necessary to set environment variables.
4. the default port of Apache is 80: http: // localhost: 80/. it is often used in actual development.
Netstat-
Check which ports are listening on the machine.
Netstat-anb
Find the program listening to the port and use the kill command to close the process.
5. how to configure the port for apache:
Apache can listen to multiple ports at the same time. modify the configuration in the httpd. conf file and modify the port. Restart the apache server after modification.
Listen to multiple ports:
Apache monitors multiple ports at the same time.
6. detailed analysis of the apache Directory:
The site access method is relatively simple, and can be directly accessed according to the path of the sub-directory of the Directory:
Apache manages functions in the form of modules. Apache will read the httpd. conf file at startup to load modules of various. so files in modules.
If you do not want it to be loaded (do not use its function), you can directly comment it out (add the # comment before ). [Note] Normally, the loaded modules are not modified ......
The core service of Apache is httpd, and various services are loaded in sequence. apache is open-source and can read its source code.
(Apache operating mechanism diagram)
(Apache lifecycle diagram)
(Apache startup diagram)
7. apache virtual directory
Requirement: install apache on drive C and manage a folder on drive D as a site.
Set to achieve:
1. modify the httpd. conf file and add a node in the virtual directory:
2. modify the httpd. conf file and log out of the documentRoot home directory:
After logging out, you cannot directly access the default directory website under the apache installation directory.
3. restart can be achieved. (The written content is incorrect. apache will restart and fail to return an error !)
(Address of the original file)
Usage (guided by the virtual directory)
8. set the apache welcome page
Requirement: enter http: // localhost/myblog directly. on the welcome page, [note] myblog is a folder for storing websites, not files.
Implementation: modify the virtual directory:
(Add a webpage after DirectoryIndex. the current directory is used as the welcome page)
9. apache server access permissions
Set the access permission for the website storage location:
Order determines the Order of permissions. first consider allow (Allow from all in the figure), and then consider deny (null if not written in the figure)
10. configuration of virtual hosts in apache
In fact, it is to set the IP address and virtual domain name for your website, start to configure the virtual host, and then use the domain name in the local nds domain name resolution to facilitate access using the domain name in the browser (domain name access, then access the local dns resolution. if the domain name cannot be found, it will be resolved remotely)
1. enable httpd-vhosts.conf
Uncomment the httpd-vhosts.conf file in httpd. conf to start
2. add one in the httpd-vhosts.conf to configure the VM
Locate the httpd-vhosts.conf file and add one
Modify it as follows:
Add, delete, and modify the local DNS resolution file to facilitate domain name resolution (in fact, domain name redirection is vulnerable to hacker attacks). the file path is c: \ windows \ system32 \ drivers \ etc \ hosts.
Remote DNS server address:
Modify the local DNS resolution file and add one to redirect the fake www.sohu.com to The Local website.
Detailed webpage access process (applicable to php, jsp, asp, and asp.net)
Sequence diagram:
[Note] If a domain name with a public ip address (not 127.0.0.1) is configured in the intranet, the computer will not adapt and will also point to 127.0.0.1
The IP address of the VM is the same; otherwise, error 403 is resolved.
Php learning server-Apache server details Iis server: mainly serves Microsoft and runs basic internet services on Microsoft windows...