apache本地配置虚拟主机httpd-vhosts.conf常用
2014-08-26 12:51
597 查看
XAMP多站点配置
#wamper+基础配置 NameVirtualHost *:80不要忘了加
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "d:/phpenv/apache/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName ams.com
DocumentRoot "D:/wamp/www/ams"
<Directory "D:/wamp/www/ams">
Options Indexes
Allow from all
Allowoverride all
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
-----------
NameVirtualHost *:80
#############配置一
<VirtualHost *:80>
ServerName psj.com
DocumentRoot "D:/xammpp/htdocs/psj"
<Directory "D:/xammpp/htdocs/psj">
#Options Indexes dede网站搬家后的配置
Order allow,deny
Allow from all
Allowoverride all
#
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
#############配置二
<VirtualHost *:80>
ServerName lj.com
DocumentRoot "D:/xammpp/htdocs/lj"
<Directory "D:/xammpp/htdocs/lj">
Options Indexes
Allow from all
Allowoverride all
#
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
----------------------------------------------------------------------------------------------------------------
前提条件 httpd.conf
AllowOverride None
改为
AllowOverride All
.htaccess禁止访问某个目录下的文件
将以下保存为.htaccess并复制到目录下即可
<Files ~ ".*">
Order allow,deny
Deny from all
</Files>
-----
如果只禁止访问如栏目下的index.html文件
可以这样设置
<Files ~ "index.html"> #~表示任何文件类型
Order allow,deny
Deny from all
</Files>
----------------------
http.conf的配置
Order Allow,Deny 规则详解
Order Allow,Deny 检查下面2个规则的顺序
Allow from all
Deny from ip1 ip2
Order Allow,Deny 下面2个规则的顺序是错误的
Deny from ip1 ip2
Allow from all
#wamper+基础配置 NameVirtualHost *:80不要忘了加
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "d:/phpenv/apache/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName ams.com
DocumentRoot "D:/wamp/www/ams"
<Directory "D:/wamp/www/ams">
Options Indexes
Allow from all
Allowoverride all
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
-----------
NameVirtualHost *:80
#############配置一
<VirtualHost *:80>
ServerName psj.com
DocumentRoot "D:/xammpp/htdocs/psj"
<Directory "D:/xammpp/htdocs/psj">
#Options Indexes dede网站搬家后的配置
Order allow,deny
Allow from all
Allowoverride all
#
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
#############配置二
<VirtualHost *:80>
ServerName lj.com
DocumentRoot "D:/xammpp/htdocs/lj"
<Directory "D:/xammpp/htdocs/lj">
Options Indexes
Allow from all
Allowoverride all
#
DirectoryIndex index.php index.html default.html default.htm
</Directory>
</VirtualHost>
----------------------------------------------------------------------------------------------------------------
前提条件 httpd.conf
AllowOverride None
改为
AllowOverride All
.htaccess禁止访问某个目录下的文件
将以下保存为.htaccess并复制到目录下即可
<Files ~ ".*">
Order allow,deny
Deny from all
</Files>
-----
如果只禁止访问如栏目下的index.html文件
可以这样设置
<Files ~ "index.html"> #~表示任何文件类型
Order allow,deny
Deny from all
</Files>
----------------------
http.conf的配置
Order Allow,Deny 规则详解
Order Allow,Deny 检查下面2个规则的顺序
Allow from all
Deny from ip1 ip2
Order Allow,Deny 下面2个规则的顺序是错误的
Deny from ip1 ip2
Allow from all
相关文章推荐
- apache开启虚拟主机功能与httpd-vhosts.conf 配置
- apache开启虚拟主机与httpd-vhosts.conf配置
- apache开启虚拟主机功能与httpd-vhosts.conf 配置分享
- Apache配置虚拟主机httpd-vhosts.conf配置步骤
- apache开启虚拟主机功能与httpd-vhosts.conf 配置分享
- apache虚拟主机的配置文件httpd-vhosts.conf
- Apache配置虚拟主机httpd-vhosts.conf
- PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项[OK]
- Apache配置httpd-vhosts虚拟主机总结及注意事项
- Apache 虚拟主机 httpd.conf配置以实现指向项目名直接访问
- PHP中级篇:Apache配置httpd-vhosts虚拟主机总结及注意事项【OK】
- Apache建立IP-Based和Name-based虚拟主机--httpd-vhosts.conf的设置
- apache配置httpd-vhosts实现虚拟主机访问
- Apache httpd.conf配置文件 3(虚拟主机)
- PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项[OK]
- Apache 配置httpd-vhosts虚拟主机总结及注意事项
- Apache配置httpd-vhosts虚拟主机总结及注意事项
- PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项[OK]
- PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项(转载)
- WAMP下Apache配置httpd-vhosts虚拟主机多站点