Apache中Virtual Host虚拟主机配置及rewrite参数说明
VirtualHost配置过程
这里例子中我们的路径为这样
DocumentRoot:/home/jb51/sites/demo.jb51.net
ServerName:demo.jb51.net
1.进入apache虚拟主机设置目录
cd/etc/apache2/sites-available
2.创建文件demo.jb51.net
<VirtualHost*:80> ServerAdminwebmaster@localhost DirectoryIndexindex.htmlindex.php DocumentRoot/home/jb51/sites/demo.jb51.net ServerNamedemo.jb51.net ServerAliasdemo.jb51.net <Directory"/home/jb51/sites/demo.jb51.net"> allowfromallOptions+Indexes </Directory> </VirtualHost>
3.激活虚拟主机配置
sudoa2ensitedemo.jb51.net
4.进入/etc/apache2/sites-enabled/目录,可以查看所有激活的虚拟主机。可以用sudoa2dissitedemo.jb51.net注销
cd/etc/apache2/sites-enabled ls-lt
显示
lrwxrwxrwx1rootroot362013-04-0517:29demo.jb51.net->../sites-available/demo.jb51.net
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短