Home > Web Front-end > HTML Tutorial > How to configure the virtual host and change the project storage directory_html/css_WEB-ITnose

How to configure the virtual host and change the project storage directory_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:41:35
Original
1381 people have browsed it

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:

(probably About line 240, add all the previous comments and copy the following)

Options FollowSymLinks

AllowOverride None

Order deny,allow

Allow from all

Satisfy all

(about 255 lines, change the period On all comments, just copy the following) >

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

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template