Apache2多站点配置的例子
安装完毕apache后,不需要修改任何配置文件,包括 httpd.conf 、 httpd.conf 和 apache2.conf 配置文件。 more /etc/apache2/sites-available/site1.xxxx.com
代码:
<VirtualHost *> ServerAdmin webmaster@localhost ServerName site1.xxxx.com CustomLog /var/log/apache2/site1.xxxx.com-access.log combined DocumentRoot /var/www/site1/ <Directory /var/www/site1/> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all </Directory> </VirtualHost>
more /etc/apache2/sites-available/site2.xxxx.com
<VirtualHost *> ServerAdmin webmaster@localhost ServerName site2.xxxx.com ServerAlias site2.yyyy.com CustomLog /var/log/apache2/site2.xxxx.com-access.log combined DocumentRoot /web/site2 <Directory /web/site2> Options Indexes AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>
创建完毕后,直接 sudo ln -s /etc/apache2/sites-available/site1.xxxx.com /etc/apache2/sites-enabled/site1.xxxx.com sudo ln -s /etc/apache2/sites-available/site2.xxxx.com /etc/apache2/sites-enabled/site2.xxxx.com 重启apache2 sudo /etc/init.d/apache2 force-reload
暂无数据
暂无评论,期待你的妙语连珠
预约成功!,
到时你将收到我们的短信提醒。
0点赞
3873文章
渝ICP备20008086号-17 渝公网安备50010702505138号
ejdz2023#163.com(#替换为@) QQ:2368208271
Apache2多站点配置的例子
Apache2多站点配置的例子
安装完毕apache后,不需要修改任何配置文件,包括 httpd.conf 、 httpd.conf 和 apache2.conf 配置文件。
more /etc/apache2/sites-available/site1.xxxx.com
代码:
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName site1.xxxx.com
CustomLog /var/log/apache2/site1.xxxx.com-access.log combined
DocumentRoot /var/www/site1/
<Directory /var/www/site1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
</VirtualHost>
more /etc/apache2/sites-available/site2.xxxx.com
代码:
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName site2.xxxx.com
ServerAlias site2.yyyy.com
CustomLog /var/log/apache2/site2.xxxx.com-access.log combined
DocumentRoot /web/site2
<Directory /web/site2>
Options Indexes
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
创建完毕后,直接
sudo ln -s /etc/apache2/sites-available/site1.xxxx.com /etc/apache2/sites-enabled/site1.xxxx.com
sudo ln -s /etc/apache2/sites-available/site2.xxxx.com /etc/apache2/sites-enabled/site2.xxxx.com
重启apache2
sudo /etc/init.d/apache2 force-reload
本文统计
推荐文章
暂无数据
评论(0)
暂无评论,期待你的妙语连珠
预约成功!,
到时你将收到我们的短信提醒。
猜你喜欢
0
|点赞
3873
文章
最近热门
涉及资源
暂无数据