Little cgit problem.. cgit.png and cgit.css 404 error

Hello there :wave:

I have a little problem to configure apache with cgit. So far it works with:

https://git.example.com/cgit

but if i change the root from /cgit to / it works… but the server cant retrieve the cgit.png and the cgit.css . Therefore it fully functional, but text-only.

grafik

Any idea what i could do wrong?

Here are the configs:
(if changing ScriptAlias and virtual-root to /cgit or anything else, then it works again)

vhost

ScriptAlias /  "/usr/lib/cgit/cgit.cgi/"
Alias "/favicon.ico" "/usr/share/webapps/cgit/favicon.ico"
Alias "/robots.txt" "/usr/share/webapps/cgit/robots.txt"
Alias "/cgit.png" "/usr/share/webapps/cgit/cgit.png"
Alias "/cgit.css" "/usr/share/webapps/cgit/cgit.css"


<Directory "/usr/share/webapps/cgit/">
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all
   Require all granted
</Directory>

<Directory "/usr/lib/cgit/">
   AllowOverride None
   Options ExecCGI FollowSymlinks
   Order allow,deny
   Allow from all
   Require all granted
</Directory>

<Directory "/srv/git">
     Allow from all
</Directory>

/etc/cgitrc

css=/cgit.css
logo=/cgit.png
virtual-root=/

Any help is appreciated… thanks :slight_smile:

Shame on me… i didn’t change the DocumentRoot :sweat:

The correct configuration:

<VirtualHost *:443>
    ServerAdmin webmaster@example.com
    DocumentRoot "/usr/share/webapps/cgit/"
    ServerName example.com
    ErrorLog "/var/log/httpd/example.com-error_log"
    CustomLog "/var/log/httpd/example.com-access_log" common
    LogLevel info   

Alias /cgit-data "/usr/share/webapps/cgit/"
ScriptAlias /  "/usr/lib/cgit/cgit.cgi/"

<Directory "/usr/share/webapps/cgit/">
   AllowOverride None
   Options None
   Require all granted
</Directory>

<Directory "/usr/lib/cgit/">
   AllowOverride None
   Options ExecCGI FollowSymlinks
   Require all granted
</Directory>

<Directory "/srv/git">
     Allow from all
</Directory>

SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
css=/cgit-data/cgit.css
logo=/cgit-data/cgit.png
virtual-root=/

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.