How do I get cgi script to run?

I have a cgi script for my autoresponder in cgi-bin/fump/install.cgi I have set all permissions as per developer, but when I run the script, I get a blank page and the script does nothing. I am testing virtualmin gpl, but just can’t seem to get this to work.

It works on my cpanel domains, so I know it isn’t the script. I’ve probably missed a setting somewhere.

Any help is greatly appreciated.

Thanks.

Mike Murphy

Here’s a bit more info from the Apache log:

[Sun Sep 16 15:23:50 2007] [error] [client 207.47.130.132] Premature end of script headers: autoinstall.cgi
[Sun Sep 16 15:23:51 2007] [error] [client 207.47.130.132] suexec policy violation: see suexec log for more details

I don’t know where the suexec log is. Can I turn suexec off?

You don’t have an Apache that’s built correctly for Virtualmin (suexec docroot needs to be set to /home). If you’re on one of the supported platforms for the Virtualmin GPL installer (which I recommend using, when possible, as it automates away all of the common problems like this).

Yes, you can disable suexec, but I don’t recommend it. Probably better to get your Apache built right. Let me know what OS and version you’re running and I’ll give you some pointers (either where to download our packages, or how to rebuild yours).

But if you do want to disable SuExec, go to the “Website options” for the virtual server in question in the Server Configuration menu (assuming you’re using the Virtualmin Framed Theme). First option is labeled “Run CGI scripts as domain owner?” Set it to no and save it.

For future virtual servers, you’ll want to turn it off in the Server Template(s) that you use in the “Apache website” section. Option is labeled “Automatically add appropriate SuExec directive?”

But, again, I don’t recommend it. It this is a shared server, it’s somewhat hazardous to not use suexec for everything.

Hi Joe. Actually the box was a brand new fresh install of Debian 4, which should be a supported operating system for the gpl version (if I understood it correctly).

It is my own server and at this point will only run a few of my domains. I didn’t have any plans of doing hosting for others, but you never know where life leads you. :slight_smile: I did a basic install and then let virtualmin gpl do it’s thing. I haven’t touched anything after it set itself up, except to set up my domain.

Thanks.

Mike Murphy

Hey Mike,

Cool. So did you actually use the install.sh for Virtualmin GPL? It should have setup the right apache for you. If it didn’t, I’ve got something to fix in the installer.

Anyway, since you’re using Debian 4.0, you can hook into our Debian repository, and use our Apache build (identical to the Debian build, except for being built with suexec docroot set to /home). The path for sources.list is:

deb http://software.virtualmin.com/gpl/debian/ virtualmin-etch main

Or you could use our install.sh and it will not only setup the sources for you, it’ll configure everything correctly for Virtualmin use. (install.sh sometimes gets confused if you’ve already setup some stuff, though…)

Yes, I did a fresh install of Debian, changed my network settings, ran echo server1.example.com > /etc/hostname, rebooted, commented out the cd for updates, ran apt-get update, ran apt-get upgrade, and then I used wget http://software.virtualmin.com/gpl/scripts/install.sh to get the software and then I used /bin/sh install.sh to install it.

I sort of followed the perfect Debian setup from howtoforge, until it came time to install software, which I did not do.

Other problem was no mailman list, so I ran newlist mailman. Once the website was up, I ran the check configuration and it said everything was good.

Oh, OK. So the install, for some reason didn’t replace your apache.

Try updating it:

apt-get update
apt-get install apache2

And see if it actually installs our version. You can check by running suexec2 from the command line with the -V option. You’re looking to see “/home” in the DOCROOT field.

Here is the result of the suexec -V and installing apache2. Oh and the "deb http://software.virtualmin.com/gpl/debian/ virtualmin-etch main" was already in the sources.list file.

ns1:~# suexec -V
-bash: suexec: command not found
ns1:~# apt-get install apache2
Reading package lists… Done
Building dependency tree… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
apache2: Depends: apache2-mpm-worker (>= 2.2.3-50) but it is not going to be installed or
apache2-mpm-prefork (>= 2.2.3-50) but 2.2.3-4+etch1 is to be installed or
apache2-mpm-event (>= 2.2.3-50) but it is not going to be installed
E: Broken packages

OOPs wrong suexec command, but same results:

ns1:~# suexec2 -V
-bash: suexec2: command not found

I also don’t mind paying for the pro version if that will fix the problems with cgi and email. I just wanted to make sure it worked before investing. :slight_smile:

ns1:~# suexec2 -V -bash: suexec2: command not found

Right. Debian hides it in /usr/lib/apache2, or somewhere…it’s not in the path.

The following packages have unmet dependencies: apache2: Depends: apache2-mpm-worker (>= 2.2.3-50) but it is not going to be installed or apache2-mpm-prefork (>= 2.2.3-50) but 2.2.3-4+etch1 is to be installed or apache2-mpm-event (>= 2.2.3-50) but it is not going to be installed E: Broken packages

Egads…I just don’t understand apt. It’s so damned stubborn. I don’t know why it’s saying this. There’s nothing wrong with our packages–they’re identical to the Debian ones!

OK, there’s no suexec2, but there is a suexec:

ns1:~# /usr/lib/apache2/suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="www-data"
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100
-D AP_USERDIR_SUFFIX="public_html"
ns1:~# /usr/lib/apache2/suexec2 -V
-bash: /usr/lib/apache2/suexec2: No such file or directory

Yep. Definitely the wrong one.

Now if we could just convince that bastard apt to let you install apache2 from our repositories…you’d be set.

Is there a preferred OS?

I have debian, but I could just as easily wipe it out and install centos 5. There’s really nothing on the server yet.

What do you think?

No, I like Debian 4 as well as anything out there. CentOS 5 is also great.

These are minor issues. The installer isn’t perfect on anything, though I had thought that both of these issues were dealt with correctly. Not sure how you managed to hit them both. :wink:

For the apache thing, maybe try forcing apt to use our repo and install all of the bits it’s asking for:

apt-get -t virtualmin-etch install apache2 apache2-mpm-prefork apache2-mpm-event

And dovecot is an easy fix…just make the change I mentioned.

Didn’t work:

ns1:~# apt-get -t virtualmin-etch install apache2 apache2-mpm-prefork apache2-mpm-event
Reading package lists… Done
Building dependency tree… Done
apache2-mpm-prefork is already the newest version.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
apache2: Depends: apache2-mpm-worker (>= 2.2.3-50) but it is not going to be installed or
apache2-mpm-prefork (>= 2.2.3-50) but 2.2.3-4+etch1 is to be installed or
apache2-mpm-event (>= 2.2.3-50) but 2.2.3-4+etch1 is to be installed
apache2-mpm-prefork: Conflicts: apache2-mpm-event but 2.2.3-4+etch1 is to be installed
E: Broken packages

Another question while I have your attention :slight_smile:
Why do punctuation marks such as ’ and “” show up as question marks on my site?

Encoding mismatch, or possibly your editor is replacing regular quotes with fancy pants quotes (Microsoft products do this, and it’s ugly and nasty behavior on their part, but if you force both the product generating and the encoding from your server to Unicode, modern browsers will work fine…old browsers will be SOL–other alternative is to turn off this “feature” in the product producing the text).

Do you think if I bought the pro version it would install correctly so my cgi script would run so I can set up my autoresponder program?

Or is there another way you can think of to install your apache modules?

I tried your last suggestion and posted the results above.

Mike