【发布时间】:2019-08-27 16:16:45
【问题描述】:
我不是系统管理员,但我会尽力而为,所以提前为我的无知道歉。
我运行一个带有 apache2 的 linux 服务器。我尝试在其上托管 3 个网站,但 sites-enabled/000-default.conf 文件必须配置错误。
根据标题中的错误消息,基本上, website_c 似乎正在阻止 website_b 出现。 website_a 和 website_c 正确显示。
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/ghost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
# Servers to proxy the connection, or
# List of application servers Usage
ProxyPass / http://localhost:2369/
ProxyPassReverse / http://localhost:2369/
ServerName website_a.com
ServerAlias www.website_a.com
</VirtualHost>
<VirtualHost *:80>
ServerName website_b.com:80
DocumentRoot /var/www/website_b
ServerAlias www.website_b.com
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
<VirtualHost *:80>
ServerName website_c.com:80
ServerAlias .*
WSGIScriptAlias / /home/username/python_envs/production/website_c/apache/production-website_c.wsgi
<Directory /home/username/python_envs/production>
Require all granted
</Directory>
</VirtualHost>
WSGIScriptAlias / /home/username/python_envs/production/website_c/apache/production-website_c.wsgi
WSGIPythonHome /home/username/python_envs/production
WSGIPythonPath /home/username/python_envs/production/website_c
Alias /rgc-dev/static/ /home/username/python_envs/dev/website_c-static/
WSGIScriptAlias /rgc-dev /home/username/python_envs/dev/website_c/apache/dev-website_c.wsgi
Alias /rgc-staging/static/ /home/username/python_envs/staging/website_c-static/
WSGIScriptAlias /rgc-staging /home/username/python_envs/staging/project_container/website_c/apache/staging-website_c.wsgi
Alias /rgc-production/static/ /home/username/python_envs/production/website_c-static/
WSGIScriptAlias /rgc-prod /home/username/python_envs/production/website_c/apache/production-website_c.wsgi
当我尝试访问website_b时apache日志中的错误信息是:client denied by server configuration: /home/username/python_envs/production/website_c/apache/production-website_c.wsgi, referer: http://website_b.com/
谁能发现我的 apache conf 的问题?如果您需要我发布 production-website_c.wsgi,请告诉我,我在那里看不到任何相关的内容。
谢谢!
【问题讨论】: