I know, this problem has been faced several times, but after reading many posts, it still does not work. the funny part: yesterday it worked. so, who can help me find the error? step by step:
I am using Apache/2.2.29 on Mac OS 10.8.5
/etc/hosts
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 scripts
127.0.0.1 page
/private/etc/apache2/httpd.conf
[...]
ServerRoot "/usr"
User _www
Group _www
DocumentRoot "/Users/me/server"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
[...]
<Directory "/Users/me/server">
MultiViews
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
[...]
Include /private/etc/apache2/extra/httpd-vhosts.conf
[...]
/private/etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "/Users/me/server/scripts"
ServerName scripts
ErrorLog "/Users/me/server/scripts/errlog"
CustomLog "/Users/me/server/scripts/customlog" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/me/server/page"
ServerName scripts
ErrorLog "/Users/me/server/page/log/errlog"
CustomLog "/Users/me/server/page/log/customlog" common
</VirtualHost>
Given Rights: (Full rights for testing)
/Users/me/server
drwxrwxrwx 5 _www _www
/Users/me/server/page
drwxrwxrwx 4 _www _www
Restart apache
sudo apachectl restart
I tried to restart the browser as well
Log Files All log files are empty
Result
http://localhost
http://page
neither of them works, I keep on getting the forbidden message.
您需要在httpd-vhosts.conf的第二部分中将ServerName
从scripts
更改为page
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.