Because there is no own virtual host, so it is intended to exist on their own small Ben. However, found that their own WWW root directory there are many folders, are previously done things, can not put their own records system and they mix it? So I wanted to open a main site for myself. So with this article.
Objective: To open the homepage of my own records West system after entering "Myhost" in the browser address bar.
Realize:
1, because I am doing in this machine, so need to modify the host file (c:\windows\System32\drivers\etc\hosts), add "myhost" Domain name (of course you can use any you want to use the name) to point to the local 127.0.0.1.
1 127.0.0.1 myhost
2, open the Apache configuration file (httpd.conf) will include conf/extra/httpd-vhosts.conf before the # Delete
3, open the "conf/extra/httpd-vhosts.conf" under the Apache directory can see the default example, where we want to first modify the access rights of the folder
I revise as follows:
Copy Code code as follows:
<directory "u:/www/" >
Options FollowSymLinks Indexes
Order Allow,deny
Allow from all
AllowOverride All
</Directory>
First act you want to change the directory path of permissions
4, according to the example to write a new subweb
Copy Code code as follows:
<virtualhost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "u:/www/doug/"
ServerName Myhost
Serveralias Myhost
ErrorLog "Logs/dummy-host.example.com-error.log"
Customlog "Logs/dummy-host.example.com-access.log" common
</VirtualHost>
Here you need to note:
The path to the third row is the subweb path
The four and fifth acts you set up for the subweb access domain name, where I used to set up before the Myhost
5, when I use, turn on this feature, found that localhost can not be properly accessed, after the solution is here also for localhost write a subweb
<virtualhost *:80> ServerAdmin webmaster@dummy-host.example.com documentroot "u:/www/" ServerName localhost serv Eralias localhost ErrorLog "logs/dummy-host.example.com-error.log" Customlog "logs/" Dummy-host.example.com-access.log "Common </VirtualHost>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
You can now visit your station by typing your new domain name in the browser's address bar (here is myhost).