Settings | Sign in | Sign up

There are currently 4 posts.

fedora19下apache(httpd)绑定多个域名到不同目录,或新建不同的子站

Floor 1 巨大八爪鱼 7/23/13 12:56
注意:用这种方法不需要使用rewrite模块
在/etc/httpd/conf.d/目录中新建一个空白文件,扩展名只要是conf就行了
内容:
<VirtualHost *:80>
DocumentRoot 文件路径
ServerName 域名
</VirtualHost>

如:
<VirtualHost *:80>
DocumentRoot /var/www/purasbar/2.0
ServerName oct1158.8800.org
</VirtualHost>



保存后直接重启apache服务器:sudo service httpd restart

哈哈,就这么简单,比以前使用rewrite简单多了
【本文是由http://zh.purasbar.com/post.php?i=20133修改的】


sudo yum install phpmyadmin安装的phpmydmin也是这种方法绑定的子站哦
Floor 2 巨大八爪鱼 7/23/13 12:57
写文件的时候还可以仿造phpMyAdmin.conf
Floor 3 巨大八爪鱼 7/23/13 12:58
不过要想绑定域名,好像只能写<VirtualHost *>吧
Floor 4 巨大八爪鱼 7/23/13 22:18
<VirtualHost 192.168.0.4:80>
    ServerAdmin zlk1214@gamil.com
    DocumentRoot /var/www/purasbar/2/
    ServerName devxxxx.purasbar.com
</VirtualHost>
这是我目前的配置文件。
一旦路径远离了/var/www/就会出现403没有权限的错误
还没有解决办法。
虽然/var/www/purasbar文件夹的权限是755

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
©2010-2025 Purasbar Ver3.0 [Mobile] [Desktop]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license.