[opensuse] perl cgi on opensuse10.2
Dear my friends...
I use opensuse10.2.
I am developing a website using perl for it cgi. This is the firsttime for me to use perl for website application.
I've installed perl::CGI and create a very simple script as the very first step:
"
#!/usr/bin/perl
print "Content-type: text/html";
print "<html>";
print "<head>";
print "<title>";
print "Try if the webserver understand my perl CGI";
print "</title>";
print "</head>";
print "<body>";
print "tes dulu";
print "</body>";
print "</html>";
".
But my apache2 does not understand my perlscript.
I put the script (index.cgi) under /srv/www/htdocs/klien/boel/cgi-bin so the url of my first perl cgi script (index.cgi) is: http://127.0.0.1/klien/beol/cgi-bin/index.cgi .
I tried to find the solution by looking up on my perl book. I found about ScriptAlias. So I add this lines into the "httpd.conf":
ScriptAlias /cgi-bin/ /srv/www/htdocs/klien/beol/cgi-bin
On Fri, 2007-09-21 at 21:01 +0700, Patrik Hasibuan wrote:
Dear my friends...
I use opensuse10.2.
I am developing a website using perl for it cgi. This is the firsttime for me to use perl for website application. I've installed perl::CGI and create a very simple script as the very first step:
#!/usr/bin/perl print "Content-type: text/html"; print "<html>"; print "<head>"; print "<title>"; print "Try if the webserver understand my perl CGI"; print "</title>"; print "</head>"; print "<body>"; print "tes dulu"; print "</body>"; print "</html>";
This program won't work as it stands. I googled for 'perl cgi example' and this site http://inconnu.isu.edu/~ink/perl_cgi/lesson1/hello_world.html seems OK to give you a working example.
But my apache2 does not understand my perlscript.
I put the script (index.cgi) under /srv/www/htdocs/klien/boel/cgi-bin so the url of my first perl cgi script (index.cgi) is: http://127.0.0.1/klien/beol/cgi-bin/index.cgi .
The easiest way to make it work is to put it in the existing preconfigured script directory: /srv/www/cgi-bin/ Try that directory first. Once you get it working you can try reconfiguring things so it will work in another directory.
I tried to find the solution by looking up on my perl book. I found about ScriptAlias. So I add this lines into the "httpd.conf": ScriptAlias /cgi-bin/ /srv/www/htdocs/klien/beol/cgi-bin
Options ExecCGI </Directory> If I restart the apache2 I get this error message: " suseonthelap:/etc/apache2 # rcapache2 restart [Fri Sep 21 20:56:08 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. Syntax OK Shutting down httpd2 (waiting for all children to terminate) done Starting httpd2 (prefork) [Fri Sep 21 20:56:11 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. done suseonthelap:/etc/apache2
It's telling you that you're trying to use the same URL that is preconfigured for /srv/www/cgi-bin/ Configuring Apache is not really hard but it's not the simplest thing in the world either. You can find tutorials and reference materials with Google but be aware that the SUSE setup is different to the default way of configuring Apache, so make sure you understand things properly. Take it one step at a time. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dear Dave...
Thank you very much for your help.
Yes, if I put the perl cgi script into the /srv/www/cgi-bin, the perl run properly.
Mmmm...... I wonder if it's possible to put the perl cgi script on another location? Just I am curious.
Thank you very much for your help.
On Fri, 21 Sep 2007 21:11:29 +0100
Dave Howorth
On Fri, 2007-09-21 at 21:01 +0700, Patrik Hasibuan wrote:
Dear my friends...
I use opensuse10.2.
I am developing a website using perl for it cgi. This is the firsttime for me to use perl for website application. I've installed perl::CGI and create a very simple script as the very first step:
#!/usr/bin/perl print "Content-type: text/html"; print "<html>"; print "<head>"; print "<title>"; print "Try if the webserver understand my perl CGI"; print "</title>"; print "</head>"; print "<body>"; print "tes dulu"; print "</body>"; print "</html>";
This program won't work as it stands. I googled for 'perl cgi example' and this site http://inconnu.isu.edu/~ink/perl_cgi/lesson1/hello_world.html seems OK to give you a working example.
But my apache2 does not understand my perlscript.
I put the script (index.cgi) under /srv/www/htdocs/klien/boel/cgi-bin so the url of my first perl cgi script (index.cgi) is: http://127.0.0.1/klien/beol/cgi-bin/index.cgi .
The easiest way to make it work is to put it in the existing preconfigured script directory: /srv/www/cgi-bin/
Try that directory first. Once you get it working you can try reconfiguring things so it will work in another directory.
I tried to find the solution by looking up on my perl book. I found about ScriptAlias. So I add this lines into the "httpd.conf": ScriptAlias /cgi-bin/ /srv/www/htdocs/klien/beol/cgi-bin
Options ExecCGI </Directory> If I restart the apache2 I get this error message: " suseonthelap:/etc/apache2 # rcapache2 restart [Fri Sep 21 20:56:08 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. Syntax OK Shutting down httpd2 (waiting for all children to terminate) done Starting httpd2 (prefork) [Fri Sep 21 20:56:11 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. done suseonthelap:/etc/apache2
It's telling you that you're trying to use the same URL that is preconfigured for /srv/www/cgi-bin/
Configuring Apache is not really hard but it's not the simplest thing in the world either. You can find tutorials and reference materials with Google but be aware that the SUSE setup is different to the default way of configuring Apache, so make sure you understand things properly. Take it one step at a time.
Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
--
Patrik Hasibuan
Dear my friends...
I found that my perl cgi script only run if they're placed into /srv/www/cgi-bin.
Could I have some other locations for keeping and running my perl cgi script by my apache2?
ScriptAlias /cginya/ /srv/www/htdocs/klien/beol/cgi-bin
Dear my friends...
I use opensuse10.2.
I am developing a website using perl for it cgi. This is the firsttime for me to use perl for website application. I've installed perl::CGI and create a very simple script as the very first step: " #!/usr/bin/perl print "Content-type: text/html"; print "<html>"; print "<head>"; print "<title>"; print "Try if the webserver understand my perl CGI"; print "</title>"; print "</head>"; print "<body>"; print "tes dulu"; print "</body>"; print "</html>"; ". But my apache2 does not understand my perlscript.
I put the script (index.cgi) under /srv/www/htdocs/klien/boel/cgi-bin so the url of my first perl cgi script (index.cgi) is: http://127.0.0.1/klien/beol/cgi-bin/index.cgi .
I tried to find the solution by looking up on my perl book. I found about ScriptAlias. So I add this lines into the "httpd.conf": ScriptAlias /cgi-bin/ /srv/www/htdocs/klien/beol/cgi-bin
Options ExecCGI </Directory> If I restart the apache2 I get this error message: " suseonthelap:/etc/apache2 # rcapache2 restart [Fri Sep 21 20:56:08 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. Syntax OK Shutting down httpd2 (waiting for all children to terminate) done Starting httpd2 (prefork) [Fri Sep 21 20:56:11 2007] [warn] The ScriptAlias directive in /etc/apache2/httpd.conf at line 215 will probably never match because it overlaps an earlier ScriptAlias. done suseonthelap:/etc/apache2 "
Please tell me what I should do to make my apache2 understand the perl cgi script.
Thank you very much in advance. -- Patrik Hasibuan
Junior Programmer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
--
Patrik Hasibuan
participants (2)
-
Dave Howorth
-
Patrik Hasibuan