Re: the scripts under mod_perl are running as mod_cgi
[prev]
[thread]
[next]
[Date index for 2004/12/02]
Hi Stas,
Thank you for your speedy response. Now, when I try to
run the script
(http://www.mydoamin.com/perl/test.pl) I get a "404 -
file not found page"
and get the following message in the error log.
"/usr/local/httpd_perl/cgi-bin/test.pl not found or
unable to stat"
I was getting this message until I changed the proxy
setting and added another
line (ScriptAlias /cgi-bin/
/home/user-name/public_html/cgi-bin/) in my backend
server configuration file.
Could you please give me some idea what needs to done
now? Here is my revised config
files. Thank you in advance for your cooperation.
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
++ httpd_perl.conf - start ++
++ (backend) ++
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
BindAddress 127.0.0.1
port 8000
# add the folloing lines at the bottom of your
configuration file:
##### mod_perl settings#####
PerlRequire
/usr/local/perl_server/conf/startup.pl
PerlFixupHandler Apache::SizeLimit
PerlPostReadRequestHandler Book::ProxyRemoteAddr
PerlSetupEnv Off
Listen 8000
<VirtualHost localhost:8000>
ServerAlias www.mydomain.com mydomain.com
ServerAdmin webmaster@xxxxxxxx.xxx
ServerName www.mydomain.com
DocumentRoot /home/user-name/public_html
DirectoryIndex index.shtml index.html
# ScriptAlias /cgi-bin/
/home/user-name/public_html/cgi-bin/
Alias /perl/ /home/user-name/public_html/cgi-bin/
PerlModule Apache::Registry
<Location /perl>
# AllowOverride None
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
Allow from all
</Location>
</VirtualHost>
+++++++++++++++++++++++++++
+++++++++++++++++++++++++++
++ httpd_perl.conf - end ++
++ (backend) ++
+++++++++++++++++++++++++++
+++++++++++++++++++++++++++
++++++++++++++++++++++++
++++++++++++++++++++++++
++ httpd.conf - start ++
++ (frontend) ++
++++++++++++++++++++++++
++++++++++++++++++++++++
# I added the following lines at the 'LoadModule'
section
LoadModule proxy_add_forward_module
libexec/mod_proxy_add_forward.so
LoadModule proxy_module
libexec/mod_proxy.so
# and added the following lines at the 'AddModule'
section
AddModule mod_proxy_add_forward.c
AddModule mod_proxy.c
# this is the proxy setting as per your sugggestion
<IfModule mod_proxy.c>
ProxyRequests On
ProxyPass /perl/ http://localhost:8000/perl/
ProxyPassReverse /perl/ http://localhost:8000/perl/
</ifModule>
# this is the exact setting of my VirtualHost
<VirtualHost xx.xx.xx.xxx>
ServerAlias www.mydomain.com mydomain.com
ServerAdmin webmaster@xxxxxxxx.xxx
DocumentRoot /home/user-name/public_html
BytesLog domlogs/mydomain.com-bytes_log
<IfModule mod_userdir.c>
UserDir disabled
UserDir enabled user-name
</IfModule>
ServerName www.mydomain.com
### this is the only line I added here...####
Alias /perl/ /home/maium/public_html/cgi-bin/
###### ###### ###### ###### ######
ScriptAlias /cgi-bin/
/home/maium/public_html/cgi-bin/
# I tried this way and it didn't work. So, I comment
it out.
# RewriteEngine on
# RewriteOptions 'inherit'
# RewriteRule ^/(perl/.*)$
http://127.0.0.1:8000/perl/$1 [P,L]
# ProxyPassReverse /
http://www.infoquestusainc.net/perl
<IfModule mod_php4.c>
php_admin_value open_basedir
"/home/user-name:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
User user-name
Group user-name
CustomLog domlogs/mydomain.com combined
</VirtualHost>
+++++++++++++++++++++++
+++++++++++++++++++++++
++ httpd.conf - end ++
++ (frontend) ++
+++++++++++++++++++++++
+++++++++++++++++++++++
--- Stas Bekman <stas@xxxxxx.xxx> wrote:
> SHAHNAWAZ OSMAN wrote:
> > Hi! I have been trying to configure two servers
> under Linux (CentOS-3.3) - one vanilla (frontend) &
> one mod_perl (backend) enabled server with a proxy
> setting in the front end. The frontend server is on
> port: 80 and the backend is on port 8000 and they
> are both in the same IP. The installation seems
> successful and the error log is as follows:
> >
> > [Wed Nov 24 02:53:55 2004] [notice]
> Apache/1.3.33 (Unix) mod_perl/1.29 configured --
> resuming normal operations
> > [Wed Nov 24 02:53:55 2004] [notice] Accept
> mutex: sysvsem (Default: sysvsem)
> >
> > I can also verify that mod_perl is installed by
> typing 'httpd -l'. Anyway, the configuration became
> a real pain since all I can get is only "running
> under mod_cgi" - if I run the following script:
> >
> >
>
-----------------------------------------------------------------------------------------
> > #!/usr/bin/perl
> > print "Content-type: text/plain\n\n";
> > print "running under mod_" . ($ENV{MOD_PERL} ?
> "perl" : "cgi");
> >
>
-----------------------------------------------------------------------------------------
> >
> > I am really confused and can't figure out a
> solution so far. I tried to follow the guideline and
> reading a lot in the last few days but I don't seem
> to find a clue. I would really appreciate, if you
> guys can point out - what am I doing wrong here.
> Thank you in advance.
> > Here are my settings...
> >
> > This is the frontend configuration setting...
> [...]
> > ProxyPass /perl/ http://localhost:8000/cgi-bin/
> > ProxyPassReverse /perl/
> http://localhost:8000/cgi-bin/
>
> it should be:
>
> ProxyPass /perl/ http://localhost:8000/perl/
> ProxyPassReverse /perl/ http://localhost:8000/perl/
>
> > Here is the backend config file for mod_perl
> enabled server...
> [...]
> > Alias /perl/ /home/user-name/public_html/cgi-bin/
> > <Location /perl>
>
>
>
> --
>
__________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another
> mod_perl Hacker
> http://stason.org/ mod_perl Guide --->
> http://perl.apache.org
> mailto:stas@xxxxxx.xxx http://use.perl.org
> http://apacheweek.com
> http://modperlbook.org http://apache.org
> http://ticketmaster.com
>
> --
> Report problems: http://perl.apache.org/bugs/
> Mail list info:
> http://perl.apache.org/maillist/modperl.html
> List etiquette:
> http://perl.apache.org/maillist/email-etiquette.html
>
>
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html