简体   繁体   English

Gitlab + Apache Ubuntu 14.04

[英]Gitlab + Apache Ubuntu 14.04

Please, I need to set the Github with Apache on Ubuntu Server 4.14 I want to set up my localhost to the / var / www Apache, done that actually. 请,我需要在Ubuntu Server 4.14上使用Apache设置Github我想将我的localhost设置为/ var / www Apache,实际上是这样做的。 But when I install Gitlab I lose this setting, when you type localhost it falls on the page of Gitlab and I need it from falling in the / var / www Could anyone help me? 但是当我安装Gitlab时我失去了这个设置,当你键入localhost时,它会落在Gitlab的页面上,我需要它来自/ var / www任何人都可以帮助我吗?

Assuming that you already have installed gitlab, try this: 假设您已经安装了gitlab,请尝试以下方法:

sudo sh -c "echo 'external_url \"http://localhost:8080\"' > /etc/gitlab/gitlab.rb"

sudo gitlab-ctl reconfigure

sudo gitlab-ctl restart

So now gitlab should be running and set to be listening on port 8080 and be set for your correct url. 所以现在gitlab应该运行并设置为侦听端口8080并设置为正确的URL。

Now Apache needs to proxy traffic for requests from that url to gitlab. 现在,Apache需要将来自该URL的请求的流量代理到gitlab。

Enable the Apache Proxy module. 启用Apache代理模块。

sudo a2enmod proxy_http

Now create a file for the virtual host, we will call this one gitlab.conf. 现在为虚拟主机创建一个文件,我们将这个称为gitlab.conf。

sudo vi /etc/apache2/sites-available/gitlab.conf

This is your config file 这是您的配置文件

<VirtualHost *:80>
        ServerName gitlab.localhost
        #git lab passthrough
        ProxyPass         / http://localhost:8080/
        ProxyPassReverse  / http://localhost:8080/
</VirtualHost>

And in your hosts file add this line: 在您的主机文件中添加以下行:

127.0.0.0       gitlab.localhost

Enable the host and test Apache configuration. 启用主机并测试Apache配置。

sudo a2ensite gitlab.conf

sudo apachectl configtest

Did that last test throw an error? 这最后一次测试是否会引发错误?

You may want to check your Apache configs prior to reloading or restarting Apache. 您可能需要在重新加载或重新启动Apache之前检查Apache配置。

Otherwise you can run the below command, and visit the url you setup 否则,您可以运行以下命令,并访问您设置的网址

sudo service apache2 reload

Source: http://jasonrichardsmith.org/blog/gitlab-apache-ubuntu 资料来源: http//jasonrichardsmith.org/blog/gitlab-apache-ubuntu

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM