[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Running Perl script on Ubuntu Gutsy using Webmin..

Posted on 2008-02-07
7
Medium Priority
?
1,190 Views
Last Modified: 2013-11-15
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,
0
Comment
Question by:nike_golf
  • 3
  • 3
7 Comments
 
LVL 4

Accepted Solution

by:
almilyo earned 1500 total points
ID: 20841409
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
 
LVL 4

Assisted Solution

by:almilyo
almilyo earned 1500 total points
ID: 20841421
0
 
LVL 13

Author Comment

by:nike_golf
ID: 20842043
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
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
LVL 4

Expert Comment

by:almilyo
ID: 20842750
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
 
LVL 13

Author Comment

by:nike_golf
ID: 20843560
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
 
LVL 17

Expert Comment

by:mjcoyne
ID: 20847566
"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
 
LVL 13

Author Comment

by:nike_golf
ID: 20867964
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question