Re: running cgi scripts locally
by chas (Priest) on May 24, 2005 at 11:47 UTC
|
| [reply] |
Re: running cgi scripts locally
by gwhite (Friar) on May 24, 2005 at 11:10 UTC
|
You didn't tell us what kind of system you are running or the OS, but put Perl and a web server on your local machine or network.
| [reply] |
Re: running cgi scripts locally
by blazar (Canon) on May 24, 2005 at 11:06 UTC
|
This comes out often. I have not much experience in these issues, though one answer that I found to be interesting once, was about lynx (or was it links or elinks or...?) which should have exactly the kind of feature you're after. I don't have the slightest idea wether this could apply to some graphic browser as well. | [reply] |
Re: running cgi scripts locally
by rlucas (Scribe) on May 24, 2005 at 13:24 UTC
|
If you have relatively simple CGI scripts on Windows, a tool called "OptiPerl" from Xarka has most of an IDE, plus a mini-webserver that allows you to view the outputs as web pages. I haven't been down the road of reevaluating *nix Perl IDEs lately (although I imagine there are some good plugins for NetBeans and Eclipse by now; I've been sticking to the "Unix IS the IDE" mentality), but I know from working with NetBeans and Eclipse for Java that they do offer something similar.
Once you start getting complicated enough, it makes sense to just to write a script to set up your development environment and require that Apache (or whatever) be a part of that.
Something we often do for testing is set up a single-instance webserver on a nonprivileged port; this is generally enough for day to day, and as long as it's actually CGI and not mod_perl or similar, you can use a very low key webserver. Of course, there's nothing like testing in the exact environment in which you anticipate deployment.
| [reply] |
Re: running cgi scripts locally
by Angharad (Pilgrim) on May 24, 2005 at 14:00 UTC
|
Thanks everyone for the help so far. I installed apache2 on suse 9.1. I modified the conf script and ensured that the permissions on /srv/www/htdocs were ok but although I can read the test page for Apache I cant get to read the index.html page. It says
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server
I know this isnt a perl question, but thought I would ask anyway, if anyone has any suggestion as to how to sort this out because it is driving me nuts! | [reply] |
|
but although I can read the test page for Apache I cant get to read the index.html pageWhich index.html?
If you can read the test page for apache, which is probably /srv/www/htdocs/index.html, I'm assuming you mean the index.html in your ~/public_html? If so, make sure your toplevel home directory , like /home/Angharad is at least mode 711, so the server can descend into your home dir. Remember, that apache will run as (nobody,nogroup) or some other lowest possible permissions, unless suexec is enabled, then it will run as (user,group) in the public_html directories.
I'm not really a human, but I play one on earth.
flash japh
| [reply] |
Re: running cgi scripts locally
by Angharad (Pilgrim) on May 24, 2005 at 11:14 UTC
|
Well, I'm running Suse 9.1 at the moment. And perl is of course already installed. So, I have to install a web server on my local machine before I can test these scripts out?
Gulp. How do I do that? | [reply] |
|
#
# UserDir: The name of the directory which is appended onto a user's h
+ome
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
UserDir public_html
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride All
AddHandler perl-script .cgi
Options All +ExecCGI
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
</IfModule>
Which means that every user's "public_html" directory in their homedir is accessible as http://localhost/~username/ and that files ending in .cgi will be run as cgi scripts.
| [reply] [d/l] [select] |
|
| [reply] [d/l] |