Installing nL on Rockets gives index.cgi text

Q&A's, tips, howto's
Locked
joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Installing nL on Rockets gives index.cgi text

Post by joejoe »

Hi!

I am running a Debian (Linux Mint) and have installed apache2, sqlite3 and downloaded all the requirements for Rockets from here:

http://newlisponrockets.com/rockets-item.lsp?p=99

I am seeing the text of the index.cgi that I have unpacked into /var/www of Rockets when I go to:

http://localhost/index.cgi

Looks like this:

Code: Select all

#!/usr/bin/env newlisp
(load "newlisp-rockets.lisp") ; this is where the magic happens!
(page-redirect "rockets-main")
I have done both of these suggestions:
You could try adding the line:


AddHandler cgi-script .cgi .lsp


To /etc/apache2/sites-available/default (or instead of default, your site name)

If things really don't want to execute, try this:

cd /var/www
sudo nano .htaccess

Add the line "Options +ExecCGI"
from here: http://newlisponrockets.com/rockets-item.lsp?p=99

I am having no problem seeing newLISP here:

Code: Select all

 /var/www $ /usr/bin/env newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (exit)
Any quick thoughts on what to try? Thanks big! :O)

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Installing nL on Rockets gives index.cgi text

Post by cormullion »

I think you've done the right thing by asking Jeremy for help... :) Although it sounds like an Apache/file permissions thing, rather than newLISP.

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Installing nL on Rockets gives index.cgi text

Post by rickyboy »

joejoe wrote:

Code: Select all

 /var/www $ /usr/bin/env newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

> (exit)
Any quick thoughts on what to try? Thanks big! :O)
Try doing the /usr/bin/env newlisp bit for the Apache user. My guess is that the Apache user can't see newlisp on its PATH. (Just a wild guess.)

This is how I did it on my Ubuntu machine.

1. Find out "who" the Apache user is.

Code: Select all

$ grep APACHE_RUN_USER /etc/apache2/envvars
export APACHE_RUN_USER=www-data
2. Run /usr/bin/env newlisp for the Apache user, www-data.

Code: Select all

$ sudo su www-data
[sudo] password for <your username>:
$ /usr/bin/env newlisp
newLISP v.10.4.5 64-bit on Linux IPv4/6 UTF-8, execute 'newlisp -h' for more info.

> 
Ok, that seems good. (Yeah, that's an old version of newLISP. :))
(λx. x x) (λx. x x)

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: Installing nL on Rockets gives index.cgi text

Post by joejoe »

Hi and thanks for the quick thoughts and suggestions!

I have done here what rickyboy suggested and I think apache user sees nL no problem.

Code: Select all

joe@kvskn /var/www $ grep APACHE_RUN_USER /etc/apache2/envvars
export APACHE_RUN_USER=www-data
[...]

Code: Select all

$ /usr/bin/env newlisp
newLISP v.10.6.0 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h
Hmm..

Code: Select all

-rwxr-xr-x 1 root     root   119 May  6 20:30 index.cgi
Would root being owner and group be causing an issue?

Thanks big again for any further poking and prodding! :D

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Installing nL on Rockets gives index.cgi text

Post by rickyboy »

joejoe,

Did Jeremy's advice work out for you?

Jeremy's advice:
Hi jojo!

Usually if you can't get Apache to execute .cgi scripts (it just shows the text of the page code instead) this means that some other configuration file is overriding the one that you edited.

Apache uses a whole bunch of configuration files depending on what distribution of Linux you are using. Can you tell me what distro you have?

Oh, and no, you don't need to run a nL server. Apache works fine.

This is an example of how I edited my httpd.conf file on CentOS:

Code: Select all

<VirtualHost *:80>
    ServerAdmin jreimer@demonware.net
    DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks +ExecCGI
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews +ExecCGI
                AllowOverride All
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews +ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
    ServerName alexandria.van.demonware.net
    ErrorLog /var/log/error_log
#   CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
(λx. x x) (λx. x x)

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: Installing nL on Rockets gives index.cgi text

Post by joejoe »

Hi rickyboy!

Thanks for the help with this! :D

I did try Jeremy's suggestion. It did not work for me.

My (Debian) Linux Mint said I had to add "+" symbols before everything after Options.

I did that and was able to restart Apache2 successfully.

After trying his Apache config file additions, I got an internal server error.

No idea. I might be in over my head w/ Rockets.

What about just using a nL server w/ Rockets? and forget Apache?

Thank again for everyone's help! :0)

Locked