A lot of online tutorials, just record my configuration, available for reference
I. Modification of HTTPD.CONF
Open the Appserv installation directory, locate the httpd.conf file, and remove the # number in front of the following two lines, respectively.
[Plain]View PlainCopy
- #LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Remove # means enable Apache's virtual host feature.
[Plain]View PlainCopy
- #Include conf/extra/httpd-vhosts.conf
To get rid of this line, it means to import the virtual host configuration from the conf/extra/httpd-vhosts.conf file.
Ii. Modification of httpd-vhosts.conf
<virtualhost *:80> ServerAdmin [email protected] documentroot "E:\developer\Apache24\htdocs" Servernam e localhost</virtualhost><virtualhost *:80> ServerAdmin [email protected] DocumentRoot "E:\develope R\www\a.sivkun.com "ServerName a.sivkun.com #ServerAlias www.dummy-host.example.com #ErrorLog" Logs/dummy-host.ex Ample.com-error.log "#CustomLog" logs/dummy-host.example.com-access.log "Common <directory" E:\developer\www\ A.sivkun.com "> Options Indexes followsymlinks allowoverride all Require all granted </directory></virtualhost><virtualhost *:80> ServerAdmin [email protected] DocumentRoot "E:\developer\www\b.sivkun.com" ServerName b.sivkun.com <directory "E:\developer\www\b.sivkun.com" > Opt Ions Indexes followsymlinks allowoverride all Require all granted </directory></virtualhost>& Lt VirtualHost *:80> ServerAdmin [email protected] documentroot "E:\developer\www\c.sivkun.com" ServerName c.sivkun.com <di Rectory "E:\developer\www\c.sivkun.com" > Options Indexes followsymlinks allowoverride None Require All granted </Directory></VirtualHost>
Iii. modification of the hosts
Windows Path: C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost127.0.0.1 a.sivkun.com127.0.0.1 b.sivkun.com127.0.0.1 c.sivkun.com
Referenced by: http://blog.csdn.net/zm2714/article/details/8351342
apache2.4 Virtual Host Configuration