httpd.conf文件一般存在于apache目录下的conf文件夹中,主要用来配置apache的。
http.conf里面的配置介绍:
AllowOverride None
Order deny,allow
Deny from all
</Directory>
AllowOverride None
</Directory>
同时修改PHP的目录:
修改DocumentRoot和<Directory "D:/Program Files/xampp/htdocs">。
修改为PHP的网站所在的目录,如下所示:
运行dos,输入“cd /d F:/xampplite/apache/bin” ,进入到xampp的bin目录,输入httpd.exe就可以查看错误。
常见问题
1、ServerRoot没配置好,可以使用绝对路径
2、document没配置好,网站路径没配置好
3、httpd-vhosts.conf没配置好,配置参考如下
<VirtualHost *:80>
ServerName localhost
DocumentRoot F:/Web/public
RewriteEngine off
<Location />
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
</Location>
<Directory F:/xampplite/htdocs>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
如果没有权限的话,在httpd.conf还增加一个:
<Directory "F:/同步文件夹/百度云同步盘/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
转自:http://blog.sina.com.cn/s/blog_6721f25c0100m3yy.html
修改httpd-vhosts.conf的配置如下:
- <VirtualHost *:80>
- DocumentRoot "D:/workspace/hush-framework/hush-app/web/frontend"
- ServerName hush-app-frontend
- <Directory />
- AllowOverride All
- Order deny,allow
- Allow from all
- Require all granted
- </Directory>
- </VirtualHost>
Require all granted
允许所有请求访问资源
允许所有访问
Require all granted
拒绝所有访问
Require all denied