Apache vhost配置

时间:2022-07-23
本文章向大家介绍Apache vhost配置,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
<VirtualHost *:80>
DocumentRoot "E:wwwcodeigniter"
ServerName www.codeigniter.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
</VirtualHost> 

<VirtualHost *:80>
ServerAdmin dev.xnxw.com
DocumentRoot e:/www/xnxw/webapp/
ServerName dev.xnxw.com
ServerAlias dev.xnxw.cn
ErrorLog logs/dev.xnxw.cn-error_log
CustomLog logs/dev.xnxw.cn-access_log common
<Directory />
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/cp(/.*)?$ /cp.php/xincp/$1 [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
</VirtualHost> 


<VirtualHost *:80>
ServerAdmin m.xnxw.com
DocumentRoot e:/www/xnxw_m/webapp/
ServerName m.xnxw.com
ServerAlias m.xnxw.cn
ErrorLog logs/m.xnxw.cn-error_log
CustomLog logs/m.xnxw.cn-access_log common
<Directory />
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
</VirtualHost>


<VirtualHost *:80>
ServerAdmin job.pccncn.dev
DocumentRoot e:/www/cncn_net/webapp/
ServerName job.pccncn.dev
ServerAlias job.pccncn.dev
ErrorLog logs/job.pccncn.dev-error_log
CustomLog logs/job.pccncn.dev-access_log common
<Directory />
Options FollowSymLinks
AllowOverride ALL
Order allow,deny
Allow from all
</Directory>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
</VirtualHost>

站点常用配置,可复用。