Ubuntu 在标准gitlab安装上运行另一个网站
我不知道我是否要转储以找到或搜索解决方案,或者根本不可能。不久前,我进行了标准Gitlab安装()。Gitlab目前运行良好 现在,我想在Gitlab安装旁边运行另一个网站。这怎么可能?我找不到gitlab正在使用的服务器以及如何配置其他网站。 操作系统是Ubuntu 17.04Ubuntu 在标准gitlab安装上运行另一个网站,ubuntu,gitlab,Ubuntu,Gitlab,我不知道我是否要转储以找到或搜索解决方案,或者根本不可能。不久前,我进行了标准Gitlab安装()。Gitlab目前运行良好 现在,我想在Gitlab安装旁边运行另一个网站。这怎么可能?我找不到gitlab正在使用的服务器以及如何配置其他网站。 操作系统是Ubuntu 17.04 编辑:我想运行一个php项目。通常我使用的是Apache,我对它有足够的了解。建议的方法是禁用内部Web服务器并使用Ubuntu提供的Apache。这方面有一些文档 基本上,您必须更改以下内容: 1.)etc/gitl
编辑:我想运行一个php项目。通常我使用的是Apache,我对它有足够的了解。建议的方法是禁用内部Web服务器并使用Ubuntu提供的Apache。这方面有一些文档 基本上,您必须更改以下内容: 1.)etc/gitlab/gitlab.rb:
nginx['enable'] = false
2.)将www数据添加到gitlab www组
3.)创建一个虚拟主机,看起来有点像这样:
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
<Location />
Require all granted
#Allow forwarding to gitlab-workhorse
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://gitlab.thoughtgang.de/
</Location>
DocumentRoot/opt/gitlab/embedded/service/gitlab-rails/public
要求所有授权
#允许转发到gitlab workhorse
ProxyPassReversehttp://127.0.0.1:8181
ProxyPassReversehttp://gitlab.thoughtgang.de/
您可以在Gitlab文档中找到详细的指南:
我已经用我们的Gitlab做了很多年了,它运行起来没有任何问题。推荐的方法是禁用内部Web服务器并使用Ubuntu提供的Apache。这方面有一些文档 基本上,您必须更改以下内容: 1.)etc/gitlab/gitlab.rb:
nginx['enable'] = false
2.)将www数据添加到gitlab www组
3.)创建一个虚拟主机,看起来有点像这样:
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
<Location />
Require all granted
#Allow forwarding to gitlab-workhorse
ProxyPassReverse http://127.0.0.1:8181
ProxyPassReverse http://gitlab.thoughtgang.de/
</Location>
DocumentRoot/opt/gitlab/embedded/service/gitlab-rails/public
要求所有授权
#允许转发到gitlab workhorse
ProxyPassReversehttp://127.0.0.1:8181
ProxyPassReversehttp://gitlab.thoughtgang.de/
您可以在Gitlab文档中找到详细的指南:
我已经用我们的Gitlab做了很多年了,它运行起来没有任何问题。根据
编辑gitlab的/etc/gitlab/gitlab.rb:
nano /etc/gitlab/gitlab.rb
和sroll到nginx['custom_nginx_config']并进行如下修改,确保取消注释
# Example: include a directory to scan for additional config files
nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"
创建新的配置目录:
mkdir -p /etc/nginx/conf.d/
nano /etc/nginx/conf.d/new_app.conf
并将内容添加到新配置中
# my new app config : /etc/nginx/conf.d/new_app.conf
# set location of new app
upstream new_app {
server localhost:1234; # wherever it might be
}
# set the new app server
server {
listen *:80;
server_name new_app.mycompany.com;
server_tokens off;
access_log /var/log/new_app_access.log;
error_log /var/log/new_app_error.log;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
location / { proxy_pass http://new_app; }
}
然后重新配置gitlab
以插入新设置
gitlab-ctl reconfigure
然后重新启动nginx
gitlab-ctl restart nginx
你的新应用应该可以访问
ps:要查看nginx
错误日志:
tail -f /var/log/gitlab/nginx/error.log
依照
编辑gitlab的/etc/gitlab/gitlab.rb:
nano /etc/gitlab/gitlab.rb
和sroll到nginx['custom_nginx_config']并进行如下修改,确保取消注释
# Example: include a directory to scan for additional config files
nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"
创建新的配置目录:
mkdir -p /etc/nginx/conf.d/
nano /etc/nginx/conf.d/new_app.conf
并将内容添加到新配置中
# my new app config : /etc/nginx/conf.d/new_app.conf
# set location of new app
upstream new_app {
server localhost:1234; # wherever it might be
}
# set the new app server
server {
listen *:80;
server_name new_app.mycompany.com;
server_tokens off;
access_log /var/log/new_app_access.log;
error_log /var/log/new_app_error.log;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
location / { proxy_pass http://new_app; }
}
然后重新配置gitlab
以插入新设置
gitlab-ctl reconfigure
然后重新启动nginx
gitlab-ctl restart nginx
你的新应用应该可以访问
ps:要查看nginx
错误日志:
tail -f /var/log/gitlab/nginx/error.log
GItLab自带了自己的nginx。您只需安装另一个nginx或apache并在其上运行您的网站。但是您必须指定端口和代理。为什么不设置另一个VM?就性能或配置管理而言,这确实不是一个好主意。如果您真的想,您需要查看自定义NGINX配置以添加不同的路由/vhosts。这是我的问题。我没有找到任何nginx配置。我还试图安装apache,但我无法运行该服务。可能是因为它们运行在同一端口(80)?要将gitlab nginx配置为在不同的端口上运行,可以使用OMG。。。对我来说是漫长的一天。的确是港口!哈哈。现在Apache正在工作!谢谢!!!!GItLab自带了自己的nginx。您只需安装另一个nginx或apache并在其上运行您的网站。但是您必须指定端口和代理。为什么不设置另一个VM?就性能或配置管理而言,这确实不是一个好主意。如果您真的想,您需要查看自定义NGINX配置以添加不同的路由/vhosts。这是我的问题。我没有找到任何nginx配置。我还试图安装apache,但我无法运行该服务。可能是因为它们运行在同一端口(80)?要将gitlab nginx配置为在不同的端口上运行,可以使用OMG。。。对我来说是漫长的一天。的确是港口!哈哈。现在Apache正在工作!谢谢!!!!