This question about Installation of Foswiki: Answered
CGI Setup
Having a basic setup problems just getting Perl CGI to work. I've been using ubuntu 10.10 (tried both server and desktop) to try and install to. I've downloaded, extracted foswiki and put the files in the /var/www/foswiki. I'm just not getting a full connect on how to setup the configuration and get the initial
https://localhost/foswiki/bin/configure page to actually run not just dump the perl code into the browser.
Basic steps I've taken:
1. Installed Apache2
2. Already have PHP and Perl installed (phphinfo() works)
3. did a sudo apt-get install php5 libapache2-mod-php5 (installed with no errors)
4. Used the standard foswiki_httpd_conf.txt and edited to setup/path/to/foswiki to be my default path of /var/www/foswiki. Basically I renamed it to foswiki.conf did a mv to /etc/apache2 then added it into the include line on the apache2.conf.
5. Followed perm directions and did a
chown -R www-data:www-data /var/www/foswiki
6. At this point I try to run the
https://localhost/foswiki/bin/configuration but end up getting the perl code dumped into the browser as text.
Any hints or tips? I've been trying to figure out how to setup perl cgi for a week now (just standard hello world) but not too much luck.
I just tried editing /etc/apache2/sites-available/default to add a cgi handler extension but still didn't work. The lines I added are included below:
ScriptAlias /foswiki/bin /var/www/foswiki/bin <Directory /var/www/foswiki/bin> Options ExecCGI AddHandler cgi-script cgi pl </Directory>
Well I just got a simple perl script to work in the /usr/lib/cgi-bin. I was using a sample "Helloworld" script from and
UbuntuGeeks sample that was coming back with a 500 Error. Tried a different script which ran correctly. So at least the basic perl mods should be installed.
#### 4-5-2011 ######
So wanted to make sure I was being clear in my questions. I do have mods setup to run CGI in apache2 on my ubuntu desktop (test environment). My question is how to hook up the foswiki.conf file to have the initial /foswiki/bin/configure script run as code other then text dump. I am using the sample foswiki_httpd_conf.txt that comes with the deb package. I edited the file paths in the config file to match my location /var/www/foswiki.
Here is a pastebin
dump of the foswiki.conf
I wasn't sure if apache2 would put the parameters from foswiki.conf so poking around the apache2.conf (httpd.conf is blank in ubuntu distro) I added foswiki for the apache2.conf in the include section. I also added the
ScriptAlias (posted above). Are there any missing steps I need to take to get the basic package setup?
##### 4-5-2011 ####
Okay guess you can delete or close out this question. The foswiki.conf file did need to be added as an Include line in the basic apache2.conf file. I guess I may have confused apache because I entered those scriptalias cgi handlers in sites-available/default when those directives were already in the foswiki.conf file. After I cleaned out those lines in the default file finally was able to get it working.
I presume you did
http:// and not only
https://, since that would be default. Access to the configure script should be restricted in the foswiki.conf.
What I do when installing on Ubuntu is copy or move the file in nr.4 as you did but to /etc/apache2/sites-available/foswiki. Then you manually or let apache create a symlink to sites-enabled, normally I do the command:
a2ensite foswiki
(or foswiki.conf).
The page
Foswiki:System.InstallationGuide has all info, and I recommend the
Foswiki:Support.ApacheConfigGenerator which also is mentioned in the guide.
There are also deb packages available, unofficial at the moment, here:
http://fosiki.com/Foswiki_debian/.
--
LarsEik - 10 Apr 2011