Apache配置虚拟目录,以及各种操作
2014-02-21 18:35
483 查看
apache配置虚拟目录:
打开并创建虚拟目录的步骤如下:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
去掉conf/http.conf文件中:
#Include conf/extra/httpd-vhosts.conf
前面的"#" (实际上是去掉注释) ,
若果想要配置多个虚拟目录的话,在httpd.conf中搜索“ NameVirtualHost ” ,如果没有的话加上一句:NameVirtualHost *:80
NameVirtualHost *:80
#NameVirtualHost localhost:8001
<VirtualHost *:80>
ServerName *
DocumentRoot "E:/APMserv/APMServ5.2.6/www/htdocs"
<Directory "E:/APMserv/APMServ5.2.6/www/htdocs">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
然后若conf下面没有extra/http-vhosts.conf这个文件则创建,最后在里面添加如下代码:
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www"
ServerName my.phpwxapp.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php"
ServerName my.phptest.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
表示添加了 my.phpwxapp.com 和 my.phptest.com 两个虚拟域名,最后在 系统C盘下面找到hosts文件,
在里面添加:
127.0.0.1 my.phpwxapp.com
127.0.0.1 my.phptest.com
最后重启Apache服务应该就可以了。
Apache多站点多IP配置:http://blog.chinaunix.net/uid-18933439-id-2808715.html
打开并创建虚拟目录的步骤如下:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
去掉conf/http.conf文件中:
#Include conf/extra/httpd-vhosts.conf
前面的"#" (实际上是去掉注释) ,
若果想要配置多个虚拟目录的话,在httpd.conf中搜索“ NameVirtualHost ” ,如果没有的话加上一句:NameVirtualHost *:80
NameVirtualHost *:80
#NameVirtualHost localhost:8001
<VirtualHost *:80>
ServerName *
DocumentRoot "E:/APMserv/APMServ5.2.6/www/htdocs"
<Directory "E:/APMserv/APMServ5.2.6/www/htdocs">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
AllowOverride None
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
然后若conf下面没有extra/http-vhosts.conf这个文件则创建,最后在里面添加如下代码:
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www"
ServerName my.phpwxapp.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\php\WeiXinApp\LivingartistApp\www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin zhangpengdzs@adsit.cn
DocumentRoot "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php"
ServerName my.phptest.com
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory "E:\APMserv\APMServ5.2.6\www\htdocs\solomo\www\test\php">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
表示添加了 my.phpwxapp.com 和 my.phptest.com 两个虚拟域名,最后在 系统C盘下面找到hosts文件,
在里面添加:
127.0.0.1 my.phpwxapp.com
127.0.0.1 my.phptest.com
最后重启Apache服务应该就可以了。
Apache多站点多IP配置:http://blog.chinaunix.net/uid-18933439-id-2808715.html
相关文章推荐
- apache配置虚拟主机以及虚拟目录详解
- Apache 2.2版本配置虚拟目录以及虚拟主机实例
- SVN配置以及自动部署到apache虚拟目录
- apache配置虚拟主机以及虚拟目录详解
- apache配置虚拟主机以及虚拟目录详解
- 关于apache配置多个虚拟目录操作及…
- apache虚拟目录配置
- Apache 配置虚拟目录
- Apache虚拟目录配置及vue-cli反向代理的设置方法
- Ubuntu 配置Apache虚拟目录
- Apache HttpServer 虚拟目录配置
- RHEL6.3配置Apache服务器(3) 虚拟目录及基于客户端地址的访问控制
- (转)Apache安装常见配置(修改主目录、首页文件、建立虚拟主机等)
- 使用apache服务器配置虚拟目录
- apache的虚拟主机配置和指定目录的访问描述(
- Apache虚拟目录和多端口多主机名配置
- apache配置--虚拟目录
- ubutu10.10 apache 配置虚拟目录
- apache2.4配置虚拟目录和虚拟主机