Web app only firing in shell

Ok, FINALLY got a sample web app off the ground on a Ubuntu server. It is working in both http and https, with one “little” hitch.

The dreaded “Unable to launch application ‘tester’ on port 2288”.

BUT, I can run the app in the shell (without sudo) and once I start it in the shell, it works for web clients until someone stops using the app, it times out and unloads itself from the server.

Any clues to what I’m looking for in either security (chmod or chown) and/or apache?

it sounds like apache doesn’t have permission to launch the app. Typically the ones that give users grief are:

-rwxr-xr-x. user user 4096 MyApplication -rwxr-xr-x. user user 4096 myapplication.cgi -rwxr-xr-x. user user 4096 MyApplication Libs -rw-rw-r--. user user 4096 config.cfg

The tricky part is that the permissions depend largely on the configuration of the server, but if you know that Apache runs under the user apache, just make sure it’s in your group.

Hi Greg,
Thanks for the response.
In Ubuntu, apache2 runs as www-data and www-data group. Here are the permissions of /var/xojo

-rwxrwxr-x 1 root www-data 54 Oct 21 15:46 config.cfg -r-xr-xr-- 1 root www-data 177 Oct 20 15:54 index.html drwxrwsr-x 3 root www-data 4096 Sep 14 09:04 Resources -rwxrwxr-x 1 root www-data 3421520 Oct 21 15:46 tester -rwxrwxr-x 1 root www-data 10396 Jul 11 20:16 tester.cgi drwxrwsr-x 2 root www-data 4096 Oct 21 15:21 tester Libs
I verified the user/group by actually adding “user www-data” and “group www-data” to the /var/apache2/apache2.conf file and restarting the service.
The apache2.conf includes the httpd.conf file which is as follows.

<VirtualHost *:80> ServerName xojo.myserver.local DocumentRoot /var/www DirectoryIndex index.html <Directory "/var/www/"> Options Indexes FollowSymLinks Includes MultiViews AllowOverride none Order allow,deny Allow from all </Directory> ScriptAlias /cgi-bin/ /var/XoJo/ RedirectMatch "^/outside" "https://xojo.surplussales.local/cgi-bin/outside.cgi" <Directory "/var/XoJo"> AllowOverride none Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny deny from all <Files *.cgi> allow from all </Files> </Directory> </VirtualHost>
I realize the allowoverride none then excludes the .htaccess file, but I didn’t see anything in there that I didn’t already have in my httpd.conf.
See anything else funky?

Did you check the permissions of the files in the tester Libs directory?

Hi Andre,
I did, here is what those permissions are:

-rwxr-xr-x 1 root www-data 143400 Oct 21 15:25 libGZip.so -rwxr-xr-x 1 root www-data 2622376 Oct 21 15:25 libRBCrypto.so -rwxr-xr-x 1 root www-data 68592 Oct 21 15:25 libRBInternetEncodings.so -rwxr-xr-x 1 root www-data 173552 Oct 21 15:25 libRBRegEx.so -rwxr-xr-x 1 root www-data 25714025 Oct 21 15:25 libRBScript.so.6 -rwxr-xr-x 1 root www-data 2288248 Oct 21 15:25 RBConsoleFramework.so -rwxr-xr-x 1 root www-data 1278976 Oct 21 15:25 SSLSocket.so

Jim, I only serve stand-alone now, but back when I did .cgi deployments, I found that modifying the .cgi script to give the WE process more time to launch often helped on some slower VPS systems. You might dig into that .cgi and see if you can find a way to do that now.

-rwxrwxr-x 1 root www-data 54 Oct 21 15:46 config.cfg

If i remember correctly this should be:
-rwxrwxrwx 1 root www-data 54 Oct 21 15:46 config.cfg

See that ‘w’ just before the last ‘x’ in the permissions? The config.cfg file must be writable.

I hope that solves the problem, i don’t have my linux system at hand now.

Ok, server reboot and it works. I’ve changed so much, I don’t know what was causing it.
Possibly Apache was caching the results?
One thing I did towards the last was give all permissions (777) to every directory and every file with chmod -R 777 directory_name.
That is now scary, but I’ll look into that later…