Fondo
Quiero configurar cgit usando apache 2.4 en mi ubuntu 18.04 vps. Ya tengo el servidor git ejecutándose con acceso ssh para mí. Pero también quiero tener un visor web para mis repositorios.
Proceso de depuración
Cuando visito mi subdominio (git.example.com), aparece un error no encontrado. El registro de errores de apache no muestra errores. El registro de acceso de apache muestra el estado 404. Esto me hace pensar que Apache no puede ver los archivos. Sin embargo, los archivos existen y parecen permitir que el usuario de datos www de apache lea y escriba (ejecutar, según sea necesario).
Pregunta
No estoy seguro de cómo proceder para depurar este problema.
Permisos
user@vps ~$ sudo -u www-data ls -l /home/www-data/cgit
total 1148
-rwxrwsr-x 1 www-data gitusers 1140464 Jul 26 03:08 cgit.cgi
-rw-rwSr-- 1 www-data gitusers 14237 Jul 26 03:08 cgit.css
-rw-rwSr-- 1 www-data gitusers 1278 Jul 26 03:08 cgit.png
-rw-rwSr-- 1 www-data gitusers 1078 Jul 26 03:08 favicon.ico
drwxrwsr-x 3 www-data gitusers 4096 Jul 26 03:08 filters
-rw-rwSr-- 1 www-data gitusers 47 Jul 26 03:08 robots.txt
Registro de errores
No error
Registro de acceso
[ip address] - - [utc timestamp] "GET / HTTP/1.1" 404 3950 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0"
Pantallas del navegador
Not Found
The requested URL / was not found on this server.
Apache/2.4.29 (Ubuntu) Server at git.example.com Port 443
Archivo VirtualHost
<VirtualHost *:443>
#======================================================================#
# Basic admin setings #
#======================================================================#
ServerAdmin [email protected]
ServerName git.example.com
ServerAlias www.git.example.com
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/error.log
#======================================================================#
# cgit settings #
#======================================================================#
DocumentRoot /home/www-data/cgit
SetEnv CGIT_CONFIG /home/www-data/cgit/cgitrc
Alias /cgit.css /home/www-data/cgit/cgit.css
Alias /cgit.png /home/www-data/cgit/cgit.png
Alias /favicon.ico /home/www-data/cgit/favicon.ico
Alias /robots.txt /home/www-data/cgit/robots.txt
Alias / /home/www-data/cgit/cgit.cgi/
<Directory /home/www-data/cgit>
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Require all granted
AddHandler cgi-script .cgi
DirectoryIndex cgit.cgi
</Directory>
RewriteEngine on
RewriteRule ^/(.*\.git(|(/(?!(HEAD|info|objects|refs|git-(upload|receive)-pack)).*)))?$ /home/www-data/cgit/cgit.cgi/$1
Alias /cgit-css /home/www-data/cgit/
#======================================================================#
# Use Git's Smart HTTP Protocol #
#======================================================================#
# Allow exporting of all repos. To choose which repos to allow exporting of,
# comment this out and use touch /path/to/repo.git/git-daemon-export-ok
# for each exportable repo.
SetEnv GIT_HTTP_EXPORT_ALL
# Set location of git repos.
SetEnv GIT_PROJECT_ROOT /home/git
# Make writes require authentication via apache gitusers password file.
<Files "git-http-backend">
AuthType Basic
AuthName "git.example.com Git Repo Push Access"
AuthUserFile /home/git/gitusers
Require valid-user
</Files>
#Alternatives to the require expr above
ScriptAliasMatch "^/(.*\.git/(HEAD|info/refs))$" /usr/lib/git-core/git-http-backend/$1
ScriptAliasMatch "^/(.*\.git/git-(upload|receive)-pack)$" /usr/lib/git-core/git-http-backend/$1
#======================================================================#
# SSL configuration #
#======================================================================#
SSLEngine on
SSLProtocol -ALL -SSLv2 -SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2
SSLHonorCipherOrder on
SSLCipherSuite TLSv1.2:RC4:HIGH:!aNULL:!eNULL:!MD5
SSLCompression off
TraceEnable Off
SSLCertificateFile "/etc/letsencrypt/live/example.com/fullchain.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/example.com/privkey.pem"
</VirtualHost>
fuente