macbook搭建apache多站点
2015-06-30 22:04
661 查看
macbook搭建apache多站点
用macbook火速搭建了lamp环境,但是当使用多站点时出现了问题:you don't have permission to access / on this server。查阅了资料有的说是deny的问题,有的说是的selinux 的事,改了都没用。看来还是需要自己找答案。
我的apache版本是2.4下面把正确的配置方式贴出来供以后参考。注意红色文字。
sudo vi /etc/apache2/httpd.conf
查找Require all denied在这句话前面追加#
追加这句话在Include /private/etc/apache2/extra/httpd-vhosts.conf之前。
NameVirtualHost *:80
查找以下语句,去掉前面的#
Include /private/etc/apache2/extra/httpd-vhosts.conf
最后,修改httpd-vhosts.conf文件。
sudo vi /etc/apache2/extra/httpd-vhosts.conf
内容如下:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /Library/WebServer/Documents
<Directory /Library/WebServer/Documents>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName resume_parse_manager.test.com
DocumentRoot /Users/niuyufu/Zend/workspaces/resume_parse_manager/Public
<Directory /Users/niuyufu/Zend/workspaces/resume_parse_manager>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>
用macbook火速搭建了lamp环境,但是当使用多站点时出现了问题:you don't have permission to access / on this server。查阅了资料有的说是deny的问题,有的说是的selinux 的事,改了都没用。看来还是需要自己找答案。
我的apache版本是2.4下面把正确的配置方式贴出来供以后参考。注意红色文字。
sudo vi /etc/apache2/httpd.conf
查找Require all denied在这句话前面追加#
追加这句话在Include /private/etc/apache2/extra/httpd-vhosts.conf之前。
NameVirtualHost *:80
查找以下语句,去掉前面的#
Include /private/etc/apache2/extra/httpd-vhosts.conf
最后,修改httpd-vhosts.conf文件。
sudo vi /etc/apache2/extra/httpd-vhosts.conf
内容如下:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /Library/WebServer/Documents
<Directory /Library/WebServer/Documents>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName resume_parse_manager.test.com
DocumentRoot /Users/niuyufu/Zend/workspaces/resume_parse_manager/Public
<Directory /Users/niuyufu/Zend/workspaces/resume_parse_manager>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>
相关文章推荐
- MOS X 下Apache服务器配置,及日志读取
- 关于apache以fastcgi模式运行php的错误理解纠正
- linux apache vhosts 配置(2.4以上版本)
- Install Apache, PHP And MySQL On CentOS 7 (LAMP)
- 用Apache Kafka构建流数据平台
- CDH(Cloudera)与hadoop(apache)对比
- apache使用htaccess文件自定义pathinfo
- Read / Write Excel file in Java using Apache POI
- Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of t
- windows 下apache 以fastcgi形式运行php
- How to Install LAMP (Apache 2.4, MySQL 5.6, and PHP 5.4) on CentOS/RHEL 7
- 利用Apache POI读写Microsoft Excel文件
- Apache配置虚拟主机
- Apache Prefork、Worker和Event三种MPM分析
- Apache+tomact搭建
- Java中使用Apache POI读取word文件简单示例
- Apache Shiro 使用手册(五)Shiro 配置说明
- Apache Shiro 使用手册(四)Realm 实现
- Apache Shiro 使用手册(三)Shiro 授权
- Apache Shiro 使用手册(二)Shiro 认证