# cgi script showing text



## andrewm659 (Jan 30, 2017)

I am running apache 2.4 latest on FreeBSD 11.

When I display the web page it shows the actual text from the file instead of running the cgi script.   I can't think of what I am missing to run this.

Here is my Apache config:


```
<VirtualHost *:80>
LoadModule fcgid_module libexec/apache24/mod_fcgid.so
LoadModule perl_module libexec/apache24/mod_perl.so
ServerName      rancid3git.borg.local
RedirectMatch ^/$ /gitweb.cgi
SetEnv GITWEB_PROJECTROOT /usr/local/var/rancid/NetworkDevices
Alias /gitweb.js                /usr/local/www/gitweb/gitweb.js
Alias /gitweb.css               /usr/local/www/gitweb/gitweb.css
Alias /git-logo.png             /usr/local/www/gitweb/git-logo.png
Alias /git-favicon.png  /usr/local/www/gitweb/git-favicon.png
AddHandler cgi-script .cgi
ScriptAlias / "/usr/local/www/gitweb/"
  <Directory "/usr/local/www/gitweb/">
        DirectoryIndex gitweb.cgi
        AllowOverride none
        Options Indexes FollowSymLinks ExecCGI MultiViews
        Require all granted
  </Directory>
LogLevel DEBUG
ErrorLog "/var/log/httpd-git-pub.borg.local-access.log"
CustomLog "/var/log/httpd-git-pub.borg.local-error.log" common
</VirtualHost>
```


```
root@rancid3git:/usr/local/www # ls -la
total 20
drwxr-xr-x   5 root  wheel  512 Jan 30 12:47 .
drwxr-xr-x  15 root  wheel  512 Jan 11 10:05 ..
drwxr-xr-x   6 root  wheel  512 Jan 11 09:59 apache24
drwxr-xr-x   2 root  wheel  512 Jan 30 12:47 cgi-bin
drwxr-xr-x   2 root  wheel  512 Jan 30 10:15 gitweb
root@rancid3git:/usr/local/www #
root@rancid3git:/usr/local/www/gitweb # ls -la
total 256
drwxr-xr-x  2 root  wheel     512 Jan 30 10:15 .
drwxr-xr-x  5 root  wheel     512 Jan 30 12:47 ..
-rwxr-xr-x  1 root  www    252143 Jan 30 10:52 gitweb.cgi
root@rancid3git:/usr/local/www/gitweb #
```


----------



## andrewm659 (Jan 31, 2017)

Nm Never mind.  Have it mostly figured out.


----------



## drhowarddrfine (Jan 31, 2017)

andrewm659 Don't be that guy:


----------



## andrewm659 (Jan 31, 2017)

Still compiling step-by-step trying to figure out if I should use gitweb or something that's a little prettier...


----------



## SirDice (Jan 31, 2017)

It's a little more involved setting up but www/gitlab is in the ports tree.


----------



## tobik@ (Jan 31, 2017)

If the repositories are small www/stagit is also nice. It generates a bunch of static HTML files, so very little setup is required on the HTTP server side. Example output: http://git.2f30.org/sbm/log.html


----------

