Mat*_*Pan 2 apache mamp virtual-hosts osx-elcapitan
MAMP 安装在 MacBook 中。我使用 MAMP apache。
基于许多在线资源,我做了以下工作:
我添加127.0.0.1 my-site.local到文件/etc/host.
我Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf在/Applications/MAMP/conf/apache/httpd.conf.
在 中/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf,我添加了
<VirtualHost *:80>
DocumentRoot "/Users/myname/laravel/mysite/public"
ServerName my-site.local
ServerAlias my-site.local
<Directory "/Users/myname/laravel/mysite/public">
DirectoryIndex index.php
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)在/Users/myname/laravel/mysite/.htaccess文件中:
<IfModule mod_rewrite.c>
Options +Indexes +FollowSymLinks +MultiViews
RewriteEngine On
#RewriteBase /
# Redirect Trailing Slashes If Not A Folder...
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Require all granted
</IfModule>
Run Code Online (Sandbox Code Playgroud)毕竟,localhost,localhost/MAMP,localhost/phpMyAdmin,所有工作,除了my-site.local。表明500 Internal server error. The server encountered an internal error or misconfiguration and was unable to complete your request.
问题解决了!因为Apache已经更新到APACHE2.2,在应用程序/ MAMP / conf目录/阿帕奇/额外/的httpd-vhosts.conf,变化Require all granted到Satisfy Any。
这就对了!
花了两天时间才弄明白~
| 归档时间: |
|
| 查看次数: |
2640 次 |
| 最近记录: |