apache - Gitlab + Apache Ubuntu 14.04

标签 apache ubuntu apache2 gitlab

拜托,我需要在 Ubuntu Server 4.14 上使用 Apache 设置 Github 我想将我的本地主机设置为/var/www Apache,实际上已经完成了。 但是当我安装 Gitlab 时,我丢失了这个设置,当你输入 localhost 时,它落在 Gitlab 的页面上,我需要它不落在/var/www 谁能帮帮我?

最佳答案

假设你已经安装了gitlab,试试这个:

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

sudo gitlab-ctl reconfigure

sudo gitlab-ctl restart

所以现在 gitlab 应该正在运行并设置为监听端口 8080 并设置为正确的 url。

现在 Apache 需要代理从该 url 到 gitlab 的请求流量。

启用 Apache 代理模块。

sudo a2enmod proxy_http

现在为虚拟主机创建一个文件,我们将其命名为 gitlab.conf。

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

这是你的配置文件

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

然后在你的主机文件中添加这一行:

127.0.0.0       gitlab.localhost

启用主机并测试 Apache 配置。

sudo a2ensite gitlab.conf

sudo apachectl configtest

上次测试是否抛出错误?

您可能需要在重新加载或重新启动 Apache 之前检查您的 Apache 配置。

否则你可以运行下面的命令,并访问你设置的url

sudo service apache2 reload

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

关于apache - Gitlab + Apache Ubuntu 14.04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33698346/

相关文章:

java - 在哪里存储 Apache Commons Math 以及如何实际导入它?

ubuntu - docker 坏安装驱动程序

Ubuntu-Linux 的 Objective-C 环境设置

php - Apache 不执行 php 文件,但启用了 mod_php5

php - REQUEST_URI 意外包含 FQDN

regex - 将 URL 从 http ://example. com/blog/重写为 http ://blog. example.com/

c++ - 在 lxml2 中找不到 -lz 库

apache2 - 为什么 Ubuntu 16.04 上不存在 apache2 模块 http2?

mod-rewrite - Apache 2.4代理为所有请求添加请求参数

python - OpenShift、python 2.7 和带 htaccess 的静态文件