[SOLVED] Cgit install
by Tonus from LinuxQuestions.org on (#523Q0)
Hi all,
I'm trying to have cgit installed for personnal use but encounter some kind of troubles to have it working.
As it might be specific to Slackware, and because the help I find here is always much valuable, I'll post that here :-)
I've installed on a slackware-arm current ponce's slackbuild for cgit.
I changed ownership of /var/cache/cgit to apache:apache and the stuff is in /var/www/cgi-bin/
Code:#ls /var/www/cgi-bin/
-rwxr-xr-x 1 apache apache 1,2M avril 13 16:17 cgit.cgi*
-rw-r--r-- 1 apache apache 14K avril 13 16:17 cgit.css
-rw-r--r-- 1 apache apache 1,4K avril 13 16:17 cgit.png
-rw-r--r-- 1 apache apache 1,1K avril 13 16:17 favicon.ico
-rwxr-xr-x 1 apache apache 99K aoit 7 2019 htsearch*
-rw-r--r-- 1 apache apache 820 di(C)c. 17 2012 printenv
-rw-r--r-- 1 apache apache 1,1K di(C)c. 17 2012 printenv.vbs
-rw-r--r-- 1 apache apache 1,2K di(C)c. 17 2012 printenv.wsf
-rwxr-xr-x 1 apache apache 42K aoit 7 2019 qtest*
-rw-r--r-- 1 apache apache 47 avril 13 16:17 robots.txt
-rwxr-xr-x 1 apache apache 1,3K avril 13 23:55 test-cgi*I have a few vhost on that machine, the relevant part for cgit is :
Code:<VirtualHost *:443>
ServerName git.server.com
ServerAdmin admin@server.com
ErrorLog "/var/log/httpd/error_log_git"
TransferLog "/var/log/httpd/access_log"
SSLEngine on
SSLCertificateFile "/etc/dehydrated/certs/server.com/cert.pem"
SSLCertificateKeyFile "/etc/dehydrated/certs/server.com/privkey.pem"
SSLCertificateChainFile "/etc/dehydrated/certs/server.com/chain.pem"
SSLCACertificatePath "/etc/ssl/certs"
#SSLCACertificateFile "/usr/share/curl/ca-bundle.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/srv/httpd/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
Alias /.well-known/acme-challenge /usr/local/dehydrated
<Directory /usr/local/dehydrated>
Options None
AllowOverride None
Require all granted
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
SetEnv CGIT_CONFIG /etc/cgitrc
Options FollowSymlinks ExecCGI
DirectoryIndex cgit.cgi
<Directory "/srv/httpd/htdocs/git/">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /cgit.png /var/www/htdocs/git/cgit.png
Alias /cgit.css /var/www/htdocs/git/cgit.css
Alias /cgit/ /var/www/htdocs/git/
<Location />
Options ExecCGI
Require all granted
</Location>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cgit.cgi?url=$1 [L,QSA]
</VirtualHost>I have a symlink from /var/www/htdocs/git/ to /var/www/cgi-bin/ but when I get to my root url git.sitename.com, the scripts won't execute and shiw text for the test, no permission for cgit.cgi and offers to download htsearch...
Trying to adapt to my usecase I might have messed something, obviously.
Does someone have a clue of where I have to look ?
Thanks in advance
Regards


I'm trying to have cgit installed for personnal use but encounter some kind of troubles to have it working.
As it might be specific to Slackware, and because the help I find here is always much valuable, I'll post that here :-)
I've installed on a slackware-arm current ponce's slackbuild for cgit.
I changed ownership of /var/cache/cgit to apache:apache and the stuff is in /var/www/cgi-bin/
Code:#ls /var/www/cgi-bin/
-rwxr-xr-x 1 apache apache 1,2M avril 13 16:17 cgit.cgi*
-rw-r--r-- 1 apache apache 14K avril 13 16:17 cgit.css
-rw-r--r-- 1 apache apache 1,4K avril 13 16:17 cgit.png
-rw-r--r-- 1 apache apache 1,1K avril 13 16:17 favicon.ico
-rwxr-xr-x 1 apache apache 99K aoit 7 2019 htsearch*
-rw-r--r-- 1 apache apache 820 di(C)c. 17 2012 printenv
-rw-r--r-- 1 apache apache 1,1K di(C)c. 17 2012 printenv.vbs
-rw-r--r-- 1 apache apache 1,2K di(C)c. 17 2012 printenv.wsf
-rwxr-xr-x 1 apache apache 42K aoit 7 2019 qtest*
-rw-r--r-- 1 apache apache 47 avril 13 16:17 robots.txt
-rwxr-xr-x 1 apache apache 1,3K avril 13 23:55 test-cgi*I have a few vhost on that machine, the relevant part for cgit is :
Code:<VirtualHost *:443>
ServerName git.server.com
ServerAdmin admin@server.com
ErrorLog "/var/log/httpd/error_log_git"
TransferLog "/var/log/httpd/access_log"
SSLEngine on
SSLCertificateFile "/etc/dehydrated/certs/server.com/cert.pem"
SSLCertificateKeyFile "/etc/dehydrated/certs/server.com/privkey.pem"
SSLCertificateChainFile "/etc/dehydrated/certs/server.com/chain.pem"
SSLCACertificatePath "/etc/ssl/certs"
#SSLCACertificateFile "/usr/share/curl/ca-bundle.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/srv/httpd/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
Alias /.well-known/acme-challenge /usr/local/dehydrated
<Directory /usr/local/dehydrated>
Options None
AllowOverride None
Require all granted
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
SetEnv CGIT_CONFIG /etc/cgitrc
Options FollowSymlinks ExecCGI
DirectoryIndex cgit.cgi
<Directory "/srv/httpd/htdocs/git/">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /cgit.png /var/www/htdocs/git/cgit.png
Alias /cgit.css /var/www/htdocs/git/cgit.css
Alias /cgit/ /var/www/htdocs/git/
<Location />
Options ExecCGI
Require all granted
</Location>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /cgit.cgi?url=$1 [L,QSA]
</VirtualHost>I have a symlink from /var/www/htdocs/git/ to /var/www/cgi-bin/ but when I get to my root url git.sitename.com, the scripts won't execute and shiw text for the test, no permission for cgit.cgi and offers to download htsearch...
Trying to adapt to my usecase I might have messed something, obviously.
Does someone have a clue of where I have to look ?
Thanks in advance
Regards