2017-02-12 9 views
0

우분투 16.04 LTS를 서버로 실행하고 GitLab과 OpenProject를 설치했습니다. 그러나 GitLab을 설치 한 이후 OpenProject에 더 이상 액세스 할 수 없기 때문에 apache2 configs를 사용하여 다른 포트로 전달하려했지만 작동하지 않습니다.하나의 아파치 서버에서 두 개의 웹 사이트 실행하기

/etc/apache2/sites-available/000-default.conf :

# This configuration has been tested on GitLab 8.2 
# Note this config assumes unicorn is listening on default port 8080 and 
# gitlab-workhorse is listening on port 8181. To allow gitlab-workhorse to 
# listen on port 8181, edit or create /etc/default/gitlab and change or add the following: 
# 
# gitlab_workhorse_options="-listenUmask 0 -listenNetwork tcp -listenAddr 127.0.0.1:8181 -authBackend http://127.0.0.1:8080" 
# 
#Module dependencies 
# mod_rewrite 
# mod_proxy 
# mod_proxy_http 
<VirtualHost *:80> 
    ServerName YOUR_SERVER_FQDN 
    ServerSignature Off 

    ProxyPreserveHost On 

    # Ensure that encoded slashes are not decoded but left in their encoded state. 
    # http://doc.gitlab.com/ce/api/projects.html#get-single-project 
    AllowEncodedSlashes NoDecode 

    <Location /> 
    # New authorization commands for apache 2.4 and up 
    # http://httpd.apache.org/docs/2.4/upgrading.html#access 
    Require all granted 

    #Allow forwarding to gitlab-workhorse 
    ProxyPassReverse http://127.0.0.1:8181 
    ProxyPassReverse http://YOUR_SERVER_FQDN/ 
    </Location> 

    # Apache equivalent of nginx try files 
    # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files 
    # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab 
    RewriteEngine on 

    #Forward all requests to gitlab-workhorse except existing files like error documents 
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR] 
    RewriteCond %{REQUEST_URI} ^/uploads/.* 
    RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE] 

    # needed for downloading attachments 
    DocumentRoot /home/git/gitlab/public 

    #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up. 
    ErrorDocument 404 /404.html 
    ErrorDocument 422 /422.html 
    ErrorDocument 500 /500.html 
    ErrorDocument 502 /502.html 
    ErrorDocument 503 /503.html 

    # It is assumed that the log directory is in /var/log/httpd. 
    # For Debian distributions you might want to change this to 
    # /var/log/apache2. 
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded 
    ErrorLog /var/log/httpd/logs/YOUR_SERVER_FQDN_error.log 
    CustomLog /var/log/httpd/logs/YOUR_SERVER_FQDN_forwarded.log common_forwarded 
    CustomLog /var/log/httpd/logs/YOUR_SERVER_FQDN_access.log combined env=!dontlog 
    CustomLog /var/log/httpd/logs/YOUR_SERVER_FQDN.log combined 

</VirtualHost> 
<VirtualHost *:81> 
    ServerName euve252630.serverprofi24.de 
    DocumentRoot /opt/openproject/public 
Include /etc/apache2/sites-available/openproject.conf 
</VirtualHost> 

/etc/apache2/sites-available/openproject.conf :

Include /etc/openproject/addons/apache2/includes/server/*.conf 

<VirtualHost *:81> 
    ServerName euve252630.serverprofi24.de 
    DocumentRoot /opt/openproject/public 

    ProxyRequests off 

    Include /etc/openproject/addons/apache2/includes/vhost/*.conf 

    # Can't use Location block since it would overshadow all the other proxypass directives on CentOS 
    ProxyPass /openproject/ http://127.0.0.1:6000/openproject/ retry=0 
    ProxyPassReverse /openproject/ http://127.0.0.1:6000/openproject/ 
</VirtualHost> 

/etc/apache2/ports.conf :

# If you just change the port or add more ports here, you will likely also 
# have to change the VirtualHost statement in 
# /etc/apache2/sites-enabled/000-default.conf 

Listen 80 
Listen 81 

<IfModule ssl_module> 
    Listen 443 
</IfModule> 

<IfModule mod_gnutls.c> 
    Listen 443 
</IfModule> 

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet 

내가 할 수있는 다른 단서가 없습니다. 미리 감사드립니다!

참고 : I 포트 (81)

편집 포트 (80)와 OpenProject에 GitLab를 원하는 : 모두가 구성 EIDT의 문제이며, 실행 :하지가 표시되는 사이트를 일으키는 것을 발견했다. Nginx 서버가 gitlab 번들에서 기본적으로 실행 중임

+0

는 Gitlab이 제대로 작동합니까? Gitlab과 OpenProject - example.com/gitlab 및 example.com/openproject에 어떻게 액세스하고 싶습니까? – Justas

+0

@Justas gitlab은 현재 example.com |에서 실행 중입니다. yes example..com/gitlab example.com/openproject가 가장 좋을 것입니다 – d0ve

+1

'sudo nano /etc/gitlab/gitlab.rb'를 사용하여 Gitlab 구성을 수정하고 'external_url'https://example.com/gitlab '을 설정할 수 있습니다 . 두 프로젝트 모두 80 포트를 사용하고 특정 Apache를/gitlab 및/openproject로 리디렉션하도록 설정할 것입니다. – Justas

답변

0

Gitlab 기본적으로 Nginx에 서버를 실행하고, 장애인이 때문에 아파치 작품

0

두 프로젝트에 모두 액세스하려면 apache의 webapps 폴더 아래에서 두 프로젝트를 별도의 폴더로 두는 것만 큼 간단해야합니다. 폴더 (로컬 호스트 : 8080 /)

+0

전에이 작업을 한 적이 없었습니다. – d0ve

+0

내 로컬 아파치 서버에서 여러 사이트가 실행 중입니다. 그래서 webapps 폴더 안에는 여러 개의 사이트가 있습니다. 예 : webapps/ 웹 사이트 1 웹 사이트 2 내 브라우저에서 웹 사이트 1이 필요하면 localhost : 8080/Website1로 이동하십시오. 다른 웹 사이트와 동일 –