2016-07-25 141 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>