在Debian 8.0上,我试图让Apache 2.4.10pipe理一个GitLab CE 7.10 Omnibus作为虚拟主机。
Apache 2已经安装并运行了几个虚拟主机,它们看起来都像vhost.example.com 。
我想configurationApache和GitLab,以便git.example.com被Apache处理以显示GitLab Web界面。
为此,我遵循https://stackoverflow.com/a/25809733/4352108中所述的过程。
我可以在git.example.com上使用GitLab的主页git.example.com ,但是我无法访问任何其他资源,如CSS或图标。 Apache日志显示了四个错误:
[Sun May 10 20:24:57.146329 2015] [authz_core:error] [pid 4141] [client 1.2.3.4:80] AH01630: client denied by server configuration: /opt/gitlab/embedded/service/gitlab-rails/public/assets/application-TOKEN.css, referer: http://git.example.com/
在search网页并尝试了几个变化,我卡在这里。 有没有人有一个如何解决这个问题的想法?
另外这里是我使用的“有趣的”configuration文件:
/etc/apache2/sites-enabled/git.conf :
<VirtualHost git.example.com:80> ServerAdmin [email protected] DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public ServerName git.example.com ServerAlias git.example.com ProxyPreserveHost On <Location /opt/gitlab/embedded/service/gitlab-rails/public> Order deny,allow Allow from all Options FollowSymLinks Require all granted ProxyPassReverse http://localhost:8080 ProxyPassReverse http://git.example.com </Location> RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://localhost:8080%{REQUEST_URI} [P,QSA] ErrorDocument 404 /404.html ErrorDocument 422 /422.html ErrorDocument 500 /500.html ErrorDocument 503 /deploy.html LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded ErrorLog /${APACHE_LOG_DIR}/gitlab.error.log CustomLog /${APACHE_LOG_DIR}/gitlab.forwarded.log common_forwarded CustomLog /${APACHE_LOG_DIR}/gitlab.access.log combined env=!dontlog CustomLog /${APACHE_LOG_DIR}/gitlab.log combined </VirtualHost>
/etc/gitlab/gitlab.rb :
external_url 'http://git.example.com' web_server['external_users'] = ['http'] nginx['enable'] = false
一些有趣的Apache mods:
proxy proxy_http
这对我工作:
<VirtualHost *:80> ServerName git.example.com ServerSignature Off DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public ProxyPreserveHost On <Location /> Require all granted ProxyPassReverse http://127.0.0.1:8080 ProxyPassReverse http://git.example.com/ </Location> RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA] # needed for downloading attachments DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public </VirtualHost>
并尝试将用户从http更改为www-data
在你的VirtualHost文件中:
更换
Order deny,allow Allow from all
通过
Require all granted
而你的问题解决了