This question about Installation of Foswiki, Configuration: Answered

Ubuntu 14.04 Installation - FastCGI not working


I'm attempting to install Foswiki to a new Ubuntu 14.04 instance, and I can't seem to get FastCGI to work properly. When I go to the 'configure' link, it brings up a text page with raw perl code in it... which means it's not getting processed properly. Here are the install steps I've done while following the install instructions:
  1. installed apache2, rcs, cpanminus.
  2. installed all perl modules required via cpanminus.
  3. installed libfcgi-perl, libapache2-mod-fcgid, and apache2-utils (for htpasswd).
  4. untarred Foswiki-1.1.9.tgz so the root dir is /var/www/wiki. Set owner/group of that dir and subdirs to www-data:www-data.
  5. used the ApacheConfigGenerator to generate my config, placed at /etc/apache2/conf-available/foswiki.conf, and set up a link to it in /etc/apache2/conf-enabled.
  6. added user 'configadmin' to /var/www/wiki/data/.htpasswd via "htpasswd -c .htpasswd configadmin".
  7. restarted the service (service apache2 restart).
I can browse to http://localhost/wiki/, which shows the "Welcome to Foswiki" page, however like I mentioned, the Configure Foswiki link returns unprocessed perl code.

The other interesting thing is that the README, LICENSE, and Upgrade Guide links give 404 Not Found errrors, even though the files they point to are definitely in the right dirs. Not sure why that is happening either, but I'm more concerned with FastCGI.

I'm pretty new at configuring apache, so hopefully someone here can help out. Attached is the foswiki.conf file I got back from the web tool. Thanks in advance for any suggestions or pointers. smile

-- MkSester - 05 Dec 2014

foswiki does not ship with fcgi support by default. You need to install FastCGIEngineContrib. In general we recommend getting foswiki running with plain old CGI. Then use the configuer extensions tab to install the FastCGIEngineContrib. You should then be able to reconfigure apache for fcgi.

If you are using Apache 2.4, be sure to select Apache version 2.4 in the ApacheConfigGenerator.

-- GeorgeClark - 05 Dec 2014

Ah... also, did you use a2enmod to enable cgi? I don't think it's enabled by default. This can cause you to get perl code instead of execution. You also might need to install libcgi-perl, it's not included by default on recent distros. Perl is dropping it as a core module and some distros have already pulled it.

-- GeorgeClark - 05 Dec 2014

Hi, thanks for the tips. Yes, it is Apache 2.4. I already went through the FastCGIEngineContrib instructions, and based on those, I installed libfcgi-perl and libapache2-mod-fcgid. I tried the new 2.4 configuration tool, but it doesn't work either. I get 404 at http://localhost/wiki, and perl code at http://localhost/wiki/bin/configure.

I'll try your suggestion of using plain CGI first to get it working. It seems there is a step missing to configure mod-fcgid, or something. MkSester - 05 Dec 2014

-- MkSester - 05 Dec 2014

Update: CGI doesn't work either. I used "a2enmod cgi" to enable it; and I verified the links are set up in mods-enabled correctly. I still get perl code at http://localhost/wiki/bin/configure. Although now the broken links I mentioned above are now working, which is nice.

-- MkSester - 05 Dec 2014

I'm not sure how I did it, but I did get the CGI version to work. It 404s on the main page http://localhost/wiki, but I was able to access http://localhost/wiki/bin/configure and start the configuration process. Very strange. I restored to a previous snapshot to figure out how I got there but I wasn't able to. Will post again if I discover it.

-- MkSester - 05 Dec 2014

QuestionForm edit

Subject Installation of Foswiki, Configuration
Version Foswiki 1.1.9
Status Answered
Related Topics
I Attachment Action Size Date Who Comment
foswiki.confconf foswiki.conf manage 6 K 05 Dec 2014 - 01:22 MkSester The foswiki.conf file that the online tool generated.
Topic revision: r5 - 05 Sep 2016, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy