Running Perl script on Ubuntu Gutsy using Webmin..

I'm currently running Gutsy with Webmin and virtual  hosting is in working order at the moment with a number of virtual sites running.
 
I'm trying to get a Perl script to work on one of the virtual hosts and I'm just not having any luck, so I'm hoping someone can  help me out.
 
What I want to do is allow each virtual host to be able to have their own /cgi-bin directory for their scripts, sounds simple but implementation is a bit elusive for me, hopefully someone can  help.

NG,
LVL 13
nike_golfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

almilyoCommented:
can you add a script alias to the virtualhost definition:

ScriptAlias /cgi-bin /path/to/cgi-bin/folder

see http://httpd.apache.org/docs/1.3/mod/mod_alias.html#scriptalias
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
almilyoCommented:
0
nike_golfAuthor Commented:
I'm still cutting my teeth on WebMin and Apache how exactly would I implement a scriptalias? what about permissions and the like how would those be handled?

Thanks.

0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

almilyoCommented:
Sorry, I didn't read properly that you were using webmin.

I've had a  quick look and *think* this will implement what you want, but backup all your configuration first (or wait for someone better at webmin that I am) - instructions taken from webmin 1.310.

1> On the appache server configuration page, click the virtual server you want to configure
2> On that virtual server page click the 'cgi programs' icon
3> for 'CGI Directory Aliases' type the path in the browser in the first box ie '/cgi-bin' and the path on the server, eg '/path/to/cgi/files/onserver' in the second.
4> Hit save, hit apply

You need to make sure the user running apache has execute permissions on the files, which you can do from the shell by making apache own the files 'chown apache /path/to/files/* -R' then setting them to mode 700: 'chmod 700 /path/to/files/* -R'

0
nike_golfAuthor Commented:
I'm assuming the directives for each virtual server should get modified if done correctly with the following or some derivative thereof?

 Alias /cgi-bin/ /web/cgi-bin/
<Location /cgi-bin >
SetHandler cgi-script
Options +ExecCGI
</Location>

"You need to make sure the user running apache has execute permissions on the files, which you can do from the shell by making apache own the files 'chown apache /path/to/files/* -R' then setting them to mode 700: 'chmod 700 /path/to/files/* -R'"

Would Webmin create the cgi-bin folder when running the 'CGI Directory Aliases' and supplying the folder for the scripts?

Thanks.

NG,
0
mjcoyneCommented:
"Would Webmin create the cgi-bin folder when running the 'CGI Directory Aliases' and supplying the folder for the scripts?"

No.  Webmin is just an easier way of editing Apache's configuration files, something you can do just as effectively with a simple text editor, but without the assistance the Webmin interface provides.  The files you are editing just tell Apache what to do, if you point Apache at a directory to use as its script directory, you'll have to make that directory yourself, and with the proper permissions and ownership.
0
nike_golfAuthor Commented:
Well, even though I did need to run a Script Alias I also had to modify the apache.conf file to permit .pl scripts as I followed the instructions here (http://www.thesitewizard.com/archive/addcgitoapache.shtml).

The scripting seems to be working since I'm able to execute a script within the cgi folder, thanks for the help.

NG,

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.