Rin*_*nma 16 apache nginx gitlab
我已经7.2.1使用GitLab.org的.deb软件包在我拥有root访问权限的虚拟服务器上为Debian 7 安装了GitLab .在这个虚拟服务器上,我已经安装了Apache,版本2.2.22,我不想将Ngnix用于GitLab.
现在我不知道GitLab的公共文件夹在哪里,我必须做什么,或者我必须注意什么.
所以我的问题是:我如何配置我的vhost for apache或我还需要做什么,我可以在我的apache web服务器上使用像"gitlab.example.com"这样的子域?
Bog*_*n T 21
考虑到两件事:
sudo netstat -pant | grep unicorn)/opt/gitlab/embedded/service/gitlab-rails/public您可以使用以下配置在apache中为gitlab创建新的vhost:
<VirtualHost *:80>
ServerName gitlab.example.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://gitlab.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>
Run Code Online (Sandbox Code Playgroud)
sha*_*aft 11
我按照这篇文章http://eserdeniz.fr/articles/view/4/installer-gitlab-sous-debian-7-avec-nginx-et-mysql工作,但我需要apache而不是nginx.
在使用gitlab-ce 7.9.0.rc3配置apache2时遇到了很多麻烦,我查看了关于ProxyPass和ProxyPassReverse指令的apache文档.
我用这个vhost解决了我的问题:
<VirtualHost *:80>
ServerName gitlab.me
# those options below are recommanded by apache, dealing with the simple Proxy we need for gitlab
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
# here we don't want to proxify the requests for the existing assets in gitlab's public directory
ProxyPassMatch ^(/[^/]+\.(html|png|ico|css|txt))$ !
ProxyPass /assets !
# here we "redirect" the requests for http://gitlab.me/ to http://127.0.0.1:8080/
ProxyPass / http://127.0.0.1:8080/
# here we "rewrite" the redirections form unicorn for http://127.0.0.1:8080/ into http://gitlab.me/
ProxyPassReverse / http://127.0.0.1:8080/
# And of course the DocumentRoot to handle the assets requests
DocumentRoot /home/git/gitlab/public/
# In the last versions of apache, there is a deny,allow default order so we put those two sections to prevent 'client denied by server configuration' 403 error
<Directory /home/git/gitlab/public/>
# apache 2.2
Order allow,deny
Allow from all
# apache 2.4
Require all granted
</Directory>
<Location />
# apache 2.2
Order allow,deny
Allow from all
# apache 2.4
Require all granted
</Location>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
现在它的速度非常快!
希望这会有所帮助!
| 归档时间: |
|
| 查看次数: |
27390 次 |
| 最近记录: |