This address: http://blog.csdn.net/oneym/article/details/48050487
Oneym
I. Description of the Environment
1, using the PHP environment to use XAMPP
2. Win7_64 bit System
3, XAMPP installed in the C packing directory
Second, modify the relevant documents 1, register the host header in the system
Using the text Editing tool C:\Windows\System32\drivers\etc\hosts
to edit the file, add a row of records to the file as follows:
127.0.0.1 oneym.dev
2. Enable Apache's Vhost function
Navigate to a C:\xampp\apache\conf\httpd.conf
file to start editing, search using the editor's search function, ctrl+F
mod_vhost_alias.so
and after you find the code, remove the # number in front of the code, as shown below when editing is complete:
LoadModule vhost_alias_module modules/mod_vhost_alias.so
3. Configure Apache's Vhost function
Edit the C:\xampp\apache\conf\extra\httpd-vhosts.conf
file and add the following code to the end of the file:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/php"
ServerName oneym.dev
ErrorLog "logs/oneym.dev-error.log"
CustomLog "logs/oneym.dev-access.log" common
</VirtualHost>
4. Restart Apache Server
Use the control Panel to quickly restart the Apache server, as follows:
Second, the test
As shown, the browser can directly use our defined host header to access the project, this can be our development into a more close to the production environment.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
PHP set Apache virtual host Vhost