Ubuntu + Apache2 + Passenger Rails 服务器上出现 403 禁止错误

Ubuntu + Apache2 + Passenger Rails 服务器上出现 403 禁止错误

刚刚在 Linode 上启动了一个服务器,使用 Ubuntu 14、Apache 和 Passenger。使用 capistrano 部署了一个 rails 应用程序,配置并启用了该站点,但在尝试访问时出现 403 错误:

Forbidden

You don't have permission to access / on this server.

Apache/2.4.7 (Ubuntu) Server at [url] Port 80

站点配置文件:

<VirtualHost _default_:80>
   ServerName [name of the server]
   ServerAdmin [mail of the admin]

   RailsEnv staging
   DocumentRoot /var/rails/appname/current/public

   PassengerHighPerformance on

   <Directory /var/rails/appname/current/public>
      AllowOverride all
      Options -MultiViews
   </Directory>
</VirtualHost>

Apache 日志:

[Fri Apr 15 08:58:21.432156 2016] [core:warn] [pid 5307] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri Apr 15 08:58:21.432368 2016] [core:warn] [pid 5307] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Apr 15 08:58:21.432420 2016] [core:warn] [pid 5307] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Apr 15 08:58:21.432457 2016] [core:warn] [pid 5307] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Apr 15 08:58:21.432510 2016] [core:warn] [pid 5307] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Apr 15 08:58:21.438925 2016] [core:warn] [pid 5307:tid 140495461242752] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

apache2.conf的第74行是我没有改变的默认值:

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default

编辑 使用以下链接解决了 Apache 日志中详述的问题:

https://askubuntu.com/questions/452042/why-is-my-apache-not-working-after-upgrading-to-ubuntu-14-04

唉,连接问题仍然存在

相关内容