How do I get cgi script to run?

No, the installer and the apache2 packages are identical. If it had a problem with the GPL installer, it’ll have the same problem with the Pro installer.

I’m working on reproducing the problem here, and will hopefully figure out why apt won’t let us replace the default apache package soon.

OK, I won’t do anything until I hear from you.

I tried changing the default website template by selecting not to add suexec, but it won’t save. It gives an error “Failed to save server template : Missing or invalid Apache user”

OK, I’m seeing the problem here, too. I’ll get it fixed shortly.

Set the Apache user to www-data on your Server Template if you want to disable Suexec. This is another buglet on Debian.

OK. I used the find apache user automatically last night so I could test my cgi script and that worked. I’ve now changed the user to www-data.

Keep me informed on the doc-root problem so I can update my site and run it correctly.

Thanks for the excellent support.

Mike

Hey Joe did you get the doc root problem in the install fixed yet?

Mike

Unfortunatly I have tried installing the GPL version on a debian 4 clean server as well 2 times, ( I had to have my provider reimage the server 2 times with a clean debian 4 install ).

Both times it does not seem to pick up the APT replacement packages from virtualmin, causing numerous errors, not just in apache.

I’m going to try this on a local box now…

/etc/apt/sources.list after install.sh execution:

the main Debian packages.

deb http://ftp.nl.debian.org/debian/ etch main contrib

Uncomment the deb-src line if you want ‘apt-get source’

to work with most packages.

deb-src http://ftp.nl.debian.org/debian/ etch main contrib

uncommenting the following line will enable security updates

deb http://security.debian.org/ stable/updates main contrib
deb http://software.virtualmin.com/gpl/debian/ virtualmin-etch main

The install script does not give any error otherwise, it simply installs the wrong packages (debian equivilants) as far as I can see.

Since I generally I only want to use Debian, it would be very helpfull this will get fixed asap. I’m also considering of buying the Pro version, but I want a good few months of a stable working version first. And unfortunatly, most options do not work presumably due to the wrong packages installation.

After some investigation I found the following:

http://software.virtualmin.com/gpl/debian/dists/virtualmin-etch/main/binary-i386/Packages

apache2 references to mpm dependancies of version *-50, however there is no reference to this version in the packages file, nor does debian itself offer this version.

Presumably this is the customized version that needs to be installed, without a reference it seems the debian version gets installed instead. And apache2 itself is a virtual package.

This is only the preliminary problem I see, there may be a lot more problems why the packages dont get installed correctly.

Perhaps I am overlooking something, I tried the following in /etc/apt/preferences:
Package: *
Pin: origin software.virtualmin.com
Pin-Priority: 1001

and although this does apperently influence the priority, it still wont correctly install apache due to a dependancy problem.

Any ideas?

Regards,
Richard.
PowerHost4U Internet Services.

After 3 years,the same problem still happened.seems this is another reason to give up virtualmin.

After 3 years,the same problem still happened.seems this is another reason to give up virtualmin.

What problem are you talking about?

Hello,

I am having the same problem running Debian 4 X64, i am a bit at loss can you give me a hand.

where do i change the settings?
thanks!

Howdy,

Well, this thread is a bit old, so let’s start fresh… what problem are you having specifically, and what settings are you looking to change?
-Eric

Hey thanks Andrey,

I cannot make my CGI perl scripts to work, now following twhat is in this thread i changed ownership of the script to www-data and removed on the webserver the option to run scripts as owner. the script works as long as is inthe cgi-bin directory.

the suexec2 ETC did gave any results…
and if i understood well i should preffer that option over the www-data thing for securityreasons.

Also i would like to have the scripts running outside the cgi-bin folder i.e: in a folder under public_html as it is for a proxy im setting…

any help will be welcomed!

Just so I know the state of your system – did you by chance install with the install.sh script?

the script works as long as is inthe cgi-bin directory.

Okay, that’s a good start.

and if i understood well i should preffer that option over the www-data thing for securityreasons.

Yeah, suexec provide a nice security benefit since it can run as the individual Virtual Server owner, rather than the generic www-data user.

If you’re having trouble getting it to work, let us know what you’re trying, and what error you’re getting (be sure to take a peek in the Apache error_log for that domain in $HOME/logs/error_log).

i would like to have the scripts running outside the cgi-bin folder i.e: in a folder under public_html as it is for a proxy im setting...

Sure, you can do that by adding "ExecCGI" to the Options line.

To add it to an existing site, you can manually edit the VirtualHost section for that domain in /etc/apache2/sites-enabled.

For new domains, you can go into System Settings -> Server Templates -> Default -> Apache Website, and update the section at the top named "Directives and settings for new websites". Any new Virtual Server will get your updated configuration.
-Eric

Eric

Yes i installed with install.sh

The script works in the CGI-BIN since i changed with the filemanager the Ownership to www-data and 755ed it.

I also went to:
Services-> Configure Web site for SSL -> CGI programs

and added a CGI dir alias like this

from: /proxy/
to: /home/TLD/cgi-bin/

put the cgi on a folder under /cgi-bin/proxy and now it is accesible from

https://tld.com/proxy/nameofthecgiscript.cgi

But going back to Suexec2
when I do a:
o0d:~#/usr/lib/apache2/suexec2 -V

I get a:

-bash: /usr/lib/apache2/suexec2: No such file or directory

if i do:
o0d:~# /usr/lib/apache2/suexec -V

I get a:

-D SUEXEC_CONFIG_DIR=/etc/apache2/suexec/
-D AP_GID_MIN=100
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100

That’s it… so no reference to the home thing in the previous posts…

I looked at the error log in the folder you told me, it points to another folder in /var/logs/tld.log
I could not find any error related to the execution of the script execpt for once i made a typo in the address :smiley:

-bash: /usr/lib/apache2/suexec2: No such file or directory

Well, all that means is that if you call the program by the incorrect name from the command line, it won’t work :wink:

The suexec program is called directly by Apache – it’s part of an Apache module called mod_suexec.

Suexec is particular about the location of the script being run, and the permissions and ownership of that script and the directory it resides in.

Debian began making this a bit easier to tweak recently – take a look at this file:

/etc/apache2/suexec/www-data

Does it have two lines that look like:

[code:1]
/home
public_html/cgi-bin
[/code:1]

If so, try chopping off the "cgi-bin" part of the second line – that may be limiting you to the cgi-bin directory.

I suspect you’ll need to restart Apache after making that change.
-Eric

Brilliant eric!

I guess i could instead of chopping the cgi-bin part that will allow scripts to be run everywhere just add another line public_html/folderiwantmyscript2b ??

I will play a bit with it and revert!

thanks again

N