Configure HTTP service in Windows (Windows + Apache + Mysql + PHP) and apachemysql
1. Install WampServer2. manage HTTP Services
Task iconGreen indicates normal startStatus
Note:
1. Check whether the network can ping the IP address of the other party.
2. Check whether the firewall is enabled. If enabled, the firewall cannot be accessed normally.
3. Check Access PermissionsAllow from all
4. Make sure the port is notOther programsOccupied
3. Configure the root directory:
The website root directory is the space for storing website programs on the Web server.
3.1 open the configuration file and select the console or bin \ apache \ Apache2.2.21 \ conf \ httpd. conf in the wampserver installation directory.
3.2 set the root directory, find and modify
Can be modified
In this way, the root directory for storing the website is specified.
3.3 configure the root directory
Can be modified
3.4 after modification, it cannot take effect immediately.Restart Apache
4. Website deployment
Paste the webpage we createdCopyGo to the configured root directory and access 127.0.0.1 through the browser.
5. Configure the VM
On a Web server, we can configure the virtual host and set the root directory separately to manage multiple websites.
5.1 enable the auxiliary configuration of the VM and find it in httpd. conf.
Remove the # Note and enable the VM configuration.
5.2 configure the VM to open conf/extra/httpd-vhosts.conf
Modify the following three items:
DocumentRoot "E:/www/example"
ServerName "example.com"
ServerAlias "www.example.com"
5.3 modify the DNS (hosts) file to open the C: \ Windows \ System32 \ drivers \ etc \ hosts Directory, which is fixed.
Note: Modify the hosts File Permission
6. Restart the Apache browser to access www.example.com.