Home >Web Front-end >HTML Tutorial >How to configure the virtual host and change the project storage directory_html/css_WEB-ITnose
Knowledge description:
Although HTML5 is a front-end thing, a good front-end engineer must also have basic back-end knowledge. I just started learning HTML5 today and how to configure a virtual host. Change the project preview address and explain!
1. Install the WAMP integrated environment
2. Start the Apache server
3. Modify the C:wampbinapacheapache2.4.9confhttps.conf file (premise: my wamp is installed in Under the C drive)
Change about 230 lines:
DocumentRoot "C:wampwww" (this is the default localhost directory)
to:
DocumentRoot "D:wwwWeb1" (D:wwwWeb1 is the directory where my project will be stored)
Configure permissions for the directory. The modification points are as follows:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Satisfy all
4. Remove the # in front of Include conf/extra/httpd-vhosts.conf (about line 521), which means introducing the httpd-vhosts.conf file
5. Open the C:wampbinapacheapache2.4.9confextra httpd-vhosts.conf file
Complete the configuration of the virtual host, as follows:
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:wwwWeb1" (local project saving path)
ServerName localhost (domain name bound to the project)
ServerAlias www.dummy-host.example.com (This part is usually consistent with the domain name)
ErrorLog "logs/dummy-host.example.com-error.log" (This part is usually the same as the domain name) Consistent with the domain name, print the log file, in order to distinguish which project’s log file it is)
CustomLog "logs/dummy-host.example.com-access.log" common (same as above)
< ;/VirtualHost>
Note:
If you want to add multiple virtual hosts, you only need to copy the above part and modify the DocumentRoot and ServerName (of course the DocumentRoot project is saved locally path; ServerName is the domain name that the project wants to bind)6. Mapping IP address
Modify the C:WindowsSystem32driversetchosts file and add IP mapping at the bottom of the file
127.0.0.1 localhost
127.12.13.14 www.****.com (just match the domain name with the IP)
7. After all the above configurations are completed, restart the Apache server.8. At this time, enter localhost directly in the browser and you can