I'm using gitolite as my git base with cgit as my front-end and its lua-based auth-filter so that not everyone can see all repos. But I have a problem with the configuration of lua and cgit on the apache2 server. The main cgit configuration works but it doesn't recognize the .lua files when using the authentication-filters by adding following line to the cgitrc:
auth-filter=/usr/lib/cgit/filters/simple-authentication.lua
The error I get from apache2 error.log is:
AH01215: /usr/lib/cgit/filters/simple-authentication.lua: 1: : /usr/lib/cgit/cgit.cgi
AH01215: --: not found: /usr/lib/cgit/cgit.cgi
AH01215: : /usr/lib/cgit/cgit.cgi
AH01215: /usr/lib/cgit/filters/simple-authentication.lua: 2: --: not found: /usr/lib/cgit/cgit.cgi
AH01215: /usr/lib/cgit/filters/simple-authentication.lua: 3: --: not found: /usr/lib/cgit/cgit.cgi
AH01215: /usr/lib/cgit/filters/simple-authentication.lua: 4: --: not found: /usr/lib/cgit/cgit.cgi
AH01215: /usr/lib/cgit/filters/simple-authentication.lua: 6: Syntax error: newline unexpected: /usr/lib/cgit/cgit.cgi
This is my cgit part in the apache2.conf:
<VirtualHost *80:>
LoadModule lua_module modules/mod_lua.so
LoadModule ssl_module modules/mod_ssl.so
DocumentRoot /var/www/html/cgit
ScriptAlias /cgit "/usr/lib/cgit/cgit.cgi"
Alias /cgit-css "usr/share/cgit/"
<Directory "/home/git/repositories">
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex /cgit
Order allow,deny
Allow from all
RewriteEngine on
</Directory>
<Directory "/var/www/html/cgit">
AllowOverride None
Options +ExecCGI
Order deny,allow
Allow from all
</Directory>
<Directory "/usr/lib/cgit/">
<Files "*.lua">
SetHandler lua-script
</Files>
Options +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex /cgit
</Directory>
</VirtualHost>
I enabled the cgi and lua mods for apache (with a2enmod) and apt installed luajit, lua-posix and luaossl.
I'm not really sure how to fix this problem but maybe somebody had or will have this problem aswell and knows how to fix it.
Greetings, Yaz