You are on page 1of 2

gitlab-ctl stop nginx

yum install -y httpd;


systemctl start httpd;
systemctl enable httpd;

vi /etc/gitlab/gitlab.rb

external_url 'http://192.1468.43.197/'

Find:
# web_server['external_users'] = []
web_server['external_users'] = ['apache']

Find:
# nginx['enable'] = true
nginx['enable'] = false

gitlab-ctl reconfigure
gitlab-ctl restart

To check which group gitlab installed itself under, you can run:
getent group

Now lets modify apache's user and add it to the gitlab-www group:
usermod apache --append --groups gitlab-www

Now we need an Apache Virtual Host to point to the gitlab install.


Add a virtual host to Apache's conf.d directory (this will create a new file):

vi /etc/httpd/conf.d/gitlab.conf

<VirtualHost *:80>
ServerName 192.168.43.197
ServerSignature Off

ProxyPreserveHost On

<Location />
Order deny,allow
Allow from all

ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://192.168.43.197/
</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

ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log combined env=!dontlog
</VirtualHost>
And now restart Apache:
systemctl stop httpd
systemctl start httpd

Load page 192.168.43.197


Erreur 503 =>

You can set things to permissive for debugging purposes.


setenforce 0
[root@gitlab ttimco]# getenforce
Permissive

Debugging Log
cat/var/log/httpd/error_log

[Mon Dec 19 17:11:45.518916 2022] [proxy:error] [pid 3741] (13)Permission denied:


AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (*) failed
[Mon Dec 19 17:11:45.519066 2022] [proxy_http:error] [pid 3741] [client
192.168.43.200:49447] AH01114: HTTP: failed to make connection to backend:
127.0.0.1, referer: http://192.168.43.197/ttimco/Inventory

On passe la commande:
/usr/sbin/setsebool -P httpd_can_network_connect 1

setenforce 1
[root@gitlab ttimco]# getenforce
Enforcing

You might also like