Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#23 Perl not rendered by Apache2. Text served instead

v2.0
closed
Andre-Littoz
5
2015-02-15
2014-06-26
dvs
No

Hi,

First of all, thank you for providing this project. It makes browsing source code very efficient.

/#######################################################/
Here's my setup.

LXR lxr-2.0.2

Ubuntu 14.04, 3.13.0-29-generic, 64-bit

/------------------------------------------------/

$ ./genxref --url=http://localhost/lxr --allversions --checkonly
[ OK ] Perl version ... 5.18.2
[ OK ] ctags version ... 5.9
Checked: glimpse version ... 4.18.5
Checked: glimpseindex version ... 4.18.5
Parameter 'swishbin' not defined - trying to find swish-e
swish-e not found, command -v swish-e returned a null string
genxref stopped without indexing by --checkonly option

/------------------------------------------------/

$ apache2 -version
Server version: Apache/2.4.7 (Ubuntu)
Server built: Apr 3 2014 12:20:28

/------------------------------------------------/

$ apache2ctl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
:80 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: MODPERL2
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used
/
------------------------------------------------*/

apache error.log
[Thu Jun 26 09:13:24.064315 2014] [mpm_event:notice] [pid 25908:tid 139935572629376] AH00491: caught SIGTERM, shutting down
[Thu Jun 26 09:13:48.893601 2014] [mpm_event:notice] [pid 1226:tid 139850027440000] AH00489: Apache/2.4.7 (Ubuntu) mod_perl/2.0.8 Perl/v5.18.2 configured -- resuming normal operations
[Thu Jun 26 09:13:48.893978 2014] [core:notice] [pid 1226:tid 139850027440000] AH00094: Command line: '/usr/sbin/apache2'

/------------------------------------------------/

apache acces.log
127.0.0.1 - - [26/Jun/2014:10:05:54 -0700] "GET /lxr/source HTTP/1.1" 200 21724 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0"
127.0.0.1 - - [26/Jun/2014:10:05:56 -0700] "GET /lxr/source HTTP/1.1" 304 180 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0"
127.0.0.1 - - [26/Jun/2014:10:05:56 -0700] "GET /lxr/source HTTP/1.1" 304 180 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0"

/#######################################################/

I'm having trouble getting Perl pages to render on the browser.

I'm only being served the text of the Perl file. Please see snapshots attached.

I followed the instructions for webserver setup on http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install5server.php

In the step "Copy the file to the Apache configuration directory", we are asked to
cp custom.d/apache-lxrserver.conf /etc/httpd/conf.d

However, on my system, there is no /etc/httpd/ folder (I guess it used to be present in earlier versions of apache2).

Instead, I added the apache-lxrserver.conf file to /etc/apache2/sites-available and enabled it using
sudo a2ensite apache-lxrserver.conf
and restarted the server.

However, the Perl is not being rendered. I am being served the text of the file instead.

BTW, this used to work perfectly fine on (Ubuntu 12.04 + Older Apache2 version).

Thanks in advance for your time and support.

2 Attachments

Discussion

  • Andre-Littoz
    Andre-Littoz
    2014-06-27

    Hi dvs,

    In the present state of the problem, it looks more like a support request, so I moved your ticket to the appropriate category.

    You describe 2 sub-problems:

    1 - Configuration directory names

    The procedure given on the http://lxr.sourceforge.net site applies to the Fedora distro but this is not explicitly stated neither on the site nor in the User's Manual. Ubuntu is known to have a different set of configuration directories. I should probably add an addendum for it, considering the large circulation of this distro, but it worries me to install yet another distro on my computer.

    Follow the instructions given with Ubuntu. It looks like you succeeded in installing and enabling your LXR server since pages are displayed (though not correctly).

    2 - Perl interpretation

    LXR main scripts (source, ident, ...) must be interpreted as Perl CGI scripts. This is controlled by file .htaccess (don't forget the dot) which has been customized and copied during LXR configuration step. It is located at the top level of the LXR root directory. Check it or send it to me for verification.

    2.1 - Apache version

    You say it worked fine under Ubuntu 12.04. Did you went anew through the LXR configuration step when you switched to Ubuntu 14.04 ?

    If you kept your LXR configuration files (which is OK for lxr.conf and initdb.sh), you might have failed if Apache was 2.2 in Ubuntu 12.04. You need to rerun the configuration step to get the correct server configuration directives. If you do not want to rerun genxref (because indexing is very long), take a look at tip "Fixing 500 internal server error without reconfiguration" at http://lxr.sourceforge.net/en/Tips/tiperror500.php

    Error 500 occurs when you misconfigured 2.4 for Apache 2.2. There is no error 500 the other way round, but I think it can't work. You can also use the tip for 2.2 -> 2.4.

    2.2 - Enabled Apache modules in Ubuntu

    File apache-lxrserver.conf contains directive to configure mod_perl depending on Apache version as detected by module mod_version.

    This latter module (mod_version) is not enabled by default under Ubuntu. See http://lxr.sourceforge.net/en/bugsandlimits.php on how to enable it if it was not done.

    This is all I can suggest without further description of your LXR. If it does not cure your problem, report back here.

    Regards,
    ajl

     
    Last edit: Andre-Littoz 2015-02-15
  • Andre-Littoz
    Andre-Littoz
    2014-06-27

    Ticket moved from /p/lxr/bugs/253/

     
  • dvs
    dvs
    2014-06-28

    Bonjour Andre,

    Thank you very much for your quick response. We really appreciate it.

    Here are my updates (along with good news).

    I installed LXR 2.02 from scratch on a fresh installation of Ubuntu 14.04. It was not an upgrade from an earlier 12.04 setup.

    So, I was able to fix the issue on Ubuntu 14.04 with Apache 2.4.7. It turns out we need to enable the apache2 module called mpm_worker manually. The indexed C code is coming up normally on the browser now.

    Please note that these steps are relevant to Ubuntu 14.04 with Apache 2.4.7. I request you to verify these steps at your end as well.

    Here are the steps.

    1. Remove all older setups for LXR. This includes deleting any .conf files you might have copied into the apache2 folders. Delete the old /lxr folder.

    2. Start the installation procedure as explained beautifully on http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install1tools.php

    3. Copy the custom.d/apache-lxrserver.conf file into /etc/apache2/conf-available folder.

    4. First disable all mpm related modules by issuing "sudo a2dismod mpm*". Ignore any warnings. Then install mpm_worker module by "sudo apt-get install apache2-mpm-worker"

    5. "sudo a2enmod mpm_worker" Enable mpm_worker module.

    6. "sudo a2enconf apache-lxrserver.conf". Enable the new config.

    7. "apache2ctl restart"

    8. Clear your browser cache and then visit the LXR home page.

    9. Everything should be fine now.

     
    Last edit: Andre-Littoz 2015-02-15
  • Andre-Littoz
    Andre-Littoz
    2014-06-28

    Hello dvs,

    Thank you for this information.

    I added a caveat on the site in the "Step 5: configure web server" page and wrote an "Ubuntu specifics" tip page.

    Could you tell me if the new page is clear enough for a casual Ubuntu user?

    If everything is OK, I'll close this support request.

    Don't hesitate to make contact when you feel like it. It encourages developers to keep going in their effort.

    Regards,
    ajl

     
  • dvs
    dvs
    2014-06-28

    Hi ajl,

    Thank you for your response.

    I think the steps you added to Ubuntu caveats are clear.

    Just one point.

    In the step "Once you have copied configuration file apache-lxrserver.conf into the Apache configuration directory", we should specify that the .conf files should be copied into the
    "/etc/apache2/conf-available" folder.

    Apart from that, it looks good to me!

    How about this? When I get access to my work PC, I will do a final test for a fresh installation from scratch, using the exact steps mentioned on the Caveats page.

    If it's all OK, I will send you an update and we can confirm that the steps are good.

    In the meantime, I think you can close the support ticket.

    Thank you once again for sharing this project. Have a good weekend.

     
  • Andre-Littoz
    Andre-Littoz
    2014-06-29

    Hi dvs,

    I made the suggested clarification by explicitly giving the copy command. I also draw the attention on the unfortunate mixture of dashes and underscores between the package names and Apache module names.

    Waiting for your confirmation.

     
  • dvs
    dvs
    2014-06-30

    Hi ajl,

    I can confirm that the Ubuntu 14.04 caveats at http://lxr.sourceforge.net/en/Tips/tipubuntu.php work.

    I think we can close the support ticket.

    Thanks once again and hope you have a great week!

    Regards,

    Dhiraj

     
    Last edit: Andre-Littoz 2015-02-15
  • Andre-Littoz
    Andre-Littoz
    2014-07-01

    • status: open --> closed
    • assigned_to: Andre-Littoz
     
  • Andre-Littoz
    Andre-Littoz
    2015-02-15

    changed all links to point to the new lXR page names

     
  • Andre-Littoz
    Andre-Littoz
    2015-02-15

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -66,7 +66,7 @@
    
     I'm only being served the text of the Perl file. Please see snapshots attached.
    
    -I followed the instructions for webserver setup on http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install5server.shtml
    +I followed the instructions for webserver setup on http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install5server.php
    
     In the step "Copy the file to the Apache configuration directory", we are asked to 
     cp custom.d/apache-lxrserver.conf /etc/httpd/conf.d