apache configuration virtual host
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #在httpd.conf 开启 Virtual hosts Include conf/extra/httpd-vhosts.conf
#然后在httpd-vhosts.conf 里面配置
#根据ip来匹配
# <VirtualHost 127.0.0.1:80>
# DocumentRoot "E:/htdocs"
# DirectoryIndex index.html index.htm index.php
# <Directory E:/htdocs>
# Options FollowSymLinks
# AllowOverride None
# Order allow,deny
# Allow from all
# </Directory>
# </VirtualHost>
#根据端口号来匹配
# <VirtualHost 127.0.0.1:82>
# DocumentRoot "E:/htdocs"
# DirectoryIndex index.html index.htm index.php
# <Directory E:/htdocs>
# Options FollowSymLinks
# AllowOverride None
# Order allow,deny
# Allow from all
# </Directory>
# </VirtualHost>
#根据主机名匹配
<VirtualHost *:80>
DocumentRoot "E:/htdocs"
ServerName localhost
DirectoryIndex index.html index.htm index.php
<Directory E:/htdocs>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/htdocs/dedecms"
ServerName dedecms.com
DirectoryIndex index.html index.htm index.php
<Directory E:/htdocs>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/htdocs/discuz"
ServerName discuz.com
DirectoryIndex index.html index.htm index.php
<Directory E:/htdocs>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
Copy after login
The above is the content of apache configuration and virtual host. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!