网站首页
Java
站长
开源
框架
理论
JS
Linux
DB
服务器
NET
生活
软件
PHP
其他
您的位置:首页 > 服务器 > Apache配置多个站点
Apache配置多个站点
2014-12-16    7389    0

配置多个站点的时候,主要是配置httpd-vhosts.conf配置文件。

配置内容,参考织梦集成工具配置属性,参考学习:

 

NameVirtualHost *:80
##VhostStart
# 这里默认站点的设置,未知域名如果IP与服务器一致,也会指向此站点
# 如果你想通过IP访问方式或非法域名不能访问你的服务,把这站点的目录设为一个不存在目录即可
<VirtualHost *:80>
ServerAdmin admin@myhost.com
DocumentRoot "C:/DedeAMPZ/WebRoot/Default"
php_admin_value open_basedir "C:/DedeAMPZ/WebRoot/Default"
ServerName localhost
ErrorLog logs/default-error_log
CustomLog logs/default-access_log common
</VirtualHost>

# 这里是虚拟主机(服务器上运行多个站点)设置的一个例子
# 如果你要增加网站,把下面配置复制一份,修改目录和域名即可
<VirtualHost *:80>
ServerAdmin admin@myhost.com
ServerName www.test.com
ServerAlias test.com
DocumentRoot "C:/DedeAMPZ/WebRoot/test.com/WebRoot"
php_admin_value open_basedir "C:/DedeAMPZ/WebRoot/test.com/WebRoot"
ErrorLog logs/all-error_log
CustomLog logs/all-access_log common
</VirtualHost>
##VhostEnd

提示:

网站不一定是通过80端口访问,域名只是解析到IP。

上一篇: 命令行启动Apache查看错误
下一篇: IIS服务器返回Bad Request (Invalid Hostname)解决办法
发表评论:
您的网名:
个人主页:
编辑内容: