Created
July 27, 2011 16:06
-
-
Save wxianfeng/1109702 to your computer and use it in GitHub Desktop.
apache config domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,apache2.conf: | |
Include /etc/apache2/sites-enabled/ | |
2,配置域名 | |
# sites-available 下 inono_net.conf | |
# www.inono.net 跳转到 www.365weiyi.com | |
<VirtualHost *:80> | |
ServerName www.inono.net | |
DocumentRoot /var/www/zsites/dooxoo_www/dooxoowww/current/public | |
<Directory /var/www/zsites/dooxoo_www/dooxoowww/current/public> | |
AllowOverride all | |
Options -MultiViews | |
</Directory> | |
RewriteEngine on # 开启rewrite功能 | |
RewriteCond %{HTTP_HOST} ^www.inono.net [NC] # NC 不区分大小写 | |
RewriteRule ^(.*) http://www.365weiyi.com [R=301,L] # 301 永久跳转 L(last rule) 表明当前规则是最后一条规则,停止分析以后规则的重写。 | |
</VirtualHost> | |
# sites-available 下wxianfeng_com.conf | |
# www.wxianfeng.com 跳转到 wxianfeng.com | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www.wxianfeng.com [NC] | |
RewriteRule ^(.*) http://wxianfeng.com [R=301,L] | |
# sites-available 下 365weiyi_com.conf | |
# www.365weiyi.com 365weiyi.com 分别作为独立的站点 | |
<VirtualHost *:80> | |
ServerName www.365weiyi.com | |
ServerAlias 365weiyi.com | |
DocumentRoot /var/www/zsites/dooxoo_www/dooxoowww/current/public | |
<Directory /var/www/zsites/dooxoo_www/dooxoowww/current/public> | |
AllowOverride all | |
Options -MultiViews | |
</Directory> | |
</VirtualHost> | |
# sites-available 下的 blog_365weiyi_com.conf | |
# http://ip/blog 来访问wordpress | |
Alias /blog /home/wangxf/projects/wordpress | |
# sites-available 下的 365weiyi_com.conf | |
# http://365weiyi.com/blog 代理访问 http://ip/blog | |
# 注意在wordpress后台中把 wordpress地址 和 站点地址设置为 http://365weiyi.com/blog | |
<VirtualHost *:80> | |
ServerName www.365weiyi.com | |
ServerAlias 365weiyi.com | |
DocumentRoot /var/www/zsites/dooxoo_www/dooxoowww/current/public | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride all | |
Options -MultiViews | |
</Directory> | |
ProxyRequests on | |
ProxyPass /blog http://220.194.54.9/blog | |
ProxyPassReverse /blog http://220.194.54.9/blog | |
<proxy http://220.194.54.9/blog> | |
AllowOverride None | |
Order Deny,Allow | |
Allow from all | |
</proxy> | |
</VirtualHost> | |
3, 最后把sites-available 下的配置ln -s 到sites-enabled 下 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment