2016-07-25 130 views
0

這是Mac OS X上的El隊長無法部署使用虛擬主機

我試圖部署內置Angularjs Apache Web服務器上的Web應用程序的Apache網絡服務器angularjs應用。

在/用戶/用戶名/站點/ 7MinutesWorkout

對於相同的,以便使虛擬主機創建文件夾,我未註釋的下面線從httpd.conf中

Include /private/etc/apache2/extra/httpd-vhosts.conf 

同樣在httpd的-vhosts.conf,包括下面的代碼段

<VirtualHost *:80> 
DocumentRoot "/Users/<username>/Sites/7MinutesWorkout" 
ServerName 7MinutesWorkout.com 
ServerAlias www.7MinutesWorkout.com 
ServerAdmin <username>@dummy.com 
ErrorLog "/private/var/log/apache2/7MinutesWorkout.com_error_log" 
CustomLog "/private/var/log/apache2/7MinutesWorkout.com_access_log" common 
<Directory> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 

也取得了/ etc/hosts中的命令sudo作爲

127.0.0.1 7MinutesWorkout.com 
127.0.0.1 www.7MinutesWorkout.com 

重啓動Apache的條目的apachectl重新啓動

但是,當我嘗試訪問該網站,我得到的錯誤頁面,該網站無法達到。

在執行所述命令

apachectl configtest 

給出的輸出作爲AH00526:上/private/etc/apache2/extra/httpd-vhosts.conf的47行語法錯誤: 指南指令要求的其他參數

如上所述,httpd-vhosts.conf中只有一個條目。

請建議

回答

0

我覺得你的問題是與需要存在的Require all granted。 這裏是我的配置的相關部分,它的作品

<Directory> 
Options Indexes FollowSymLinks 

# AllowOverride controls what directives may be placed in .htaccess files. 
# It can be "All", "None", or any combination of the keywords: 
# AllowOverride FileInfo AuthConfig Limit 
# 
AllowOverride All 

# 
# Controls who can get stuff from this server. 
# 
Require all granted 
# onlineoffline tag - don't remove 
Order Allow,Deny 
Allow from all 
#  Allow from 127.0.0.1 
#  Allow from ::1 
#  Allow from localhost 
</Directory>