[Bug 245173] New: apache mod perl not working in for userdir default hosts
https://bugzilla.novell.com/show_bug.cgi?id=245173 Summary: apache mod perl not working in for userdir default hosts Product: openSUSE 10.2 Version: Final Platform: i586 OS/Version: Linux Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: richard.bos@xs4all.nl QAContact: jsrain@novell.com I switch on the perl server module for apache using yast (yast2 > network services > httpd server > tab server modules No whatever I tried it was not possible to get perl working in my regular user enviroment (userdir /home/*/public_html/cgi-bin). The solution seems to be to create a vhosts (which I called www.domain.tld) and now it was suddenly possible to run perl scripts in a vhost. It looks like this bug: https://bugzilla.novell.com/show_bug.cgi?id=176758#c3 stating: These two lines are needed: UserDir public_html Include /etc/apache2/mod_userdir.conf They *are*, in a fresh installation, present in /etc/apache2/default-server.conf, as well as in the template files in vhosts.d which server as starting point for new virtual hosts. Now this is not there for me: # grep -i userdir /etc/apache2/default-server.conf # just empty.. This is a fresh install. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 ------- Comment #1 from richard.bos@xs4all.nl 2007-02-13 14:04 MST ------- Created an attachment (id=118968) --> (https://bugzilla.novell.com/attachment.cgi?id=118968&action=view) y2log of my attempt to activate mod for regular users for default hosts -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 judas_iscariote@shorewall.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |judas_iscariote@shorewall.net AssignedTo|bnc-team- |mzugec@novell.com |screening@forge.provo.novell| |.com | ------- Comment #2 from judas_iscariote@shorewall.net 2007-02-13 23:11 MST ------- looks like there is a room of improvement for this module, people is complaining too frecuently this module does not work for them. Let'see if I can devote some time to fix at least the parts Im proficient with... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 mzugec@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Comment #3 from mzugec@novell.com 2007-02-14 03:20 MST ------- Cristian: If you know about something, just write a bugreport, enhancement or just describe what it needs to be tested, otherwise your comment is completely useless -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 mwfolsom@swcp.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mwfolsom@swcp.com ------- Comment #4 from mwfolsom@swcp.com 2007-03-15 08:27 MST ------- Hi: Just added my mod_perl module via Yast2 - not in the way described above. Frankly it seems that installing the mod_perl rpm creates a couple of files (/etc/apache2/mod_perl-startup.pl and /etc/apache2/conf.d/mod_perl.conf) and the directory /srv/www/perl-lib but when I follow the instructions in the "Registry Scripts" section at: http://perl.apache.org/docs/2.0/user/intro/start_fast.html and create the file rock.pl it doesn't work. Permission on rock.pl: -rwxr-xr-x 1 nobody nobody 85 2007-03-14 21:56 rock.pl Messages in /var/log/apache2/access.log and /var/log/apache2/error.log don't tell me much, i.e..... from access_log............... xxx.xxx.223.41 - - [14/Mar/2007:22:17:35 -0600] "GET /rock.pl HTTP/1.1" 200 85 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2" xxx.xxx.223.41 - - [14/Mar/2007:22:19:10 -0600] "GET /rock.pl HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2" xxx.xxx.223.41 - - [14/Mar/2007:22:28:11 -0600] "GET /perl-lib/rock.pl HTTP/1.1" 404 1005 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2" xxx.xxx.223.41 - - [14/Mar/2007:22:30:26 -0600] "GET /perl-lib/rock.pl HTTP/1.1" 404 1005 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2" xxx.xxx.223.41 - - [14/Mar/2007:22:35:52 -0600] "GET /rock.pl HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2" from error.log................. [Wed Mar 14 22:15:19 2007] [error] [client 192.168.223.41] File does not exist: /srv/www/htdocs/perl-lib [Wed Mar 14 22:15:48 2007] [error] [client 192.168.223.41] File does not exist: /srv/www/htdocs/perl-lib [Wed Mar 14 22:16:44 2007] [error] [client 192.168.223.41] File does not exist: /srv/www/htdocs/rock.pl [Wed Mar 14 22:28:11 2007] [error] [client 192.168.223.41] File does not exist: /srv/www/htdocs/perl-lib [Wed Mar 14 22:30:26 2007] [error] [client 192.168.223.41] File does not exist: /srv/www/htdocs/perl-lib Thanks for any help! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 ------- Comment #5 from mzugec@novell.com 2007-03-19 05:16 MST ------- Richard: reproduced in wizard mode Michael: correct way to do it is use http-server module for *enable and install* mod_perl Did you enabled perl in /etc/sysconfig/apache2 variable APACHE_MODULES? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 mzugec@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #6 from mzugec@novell.com 2007-03-21 02:57 MST ------- fixed in yast2-http-server-2.14.10 (you should test it from factory) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173
------- Comment #7 from mwfolsom@swcp.com 2007-03-21 08:00 MST -------
HI:
Attached below is a conversation on opensuse's mailing list at
opensuse@opensuse.org about this -
The long and short is that yes the mod_perl was always enabled but no
perl script in /srv/www/perl-lib works however the same script
in /srv/www/cgi-bin works fine.
The question is why do they fail in /srv/www/perl-lib?
Thanks for working on this -
Michael
......................................
Folks:
New to mod_perl and am having trouble getting mod_perl going on OpenSuse
10.2.
Have a system with apache installed and working and used yast to
install mod_perl from the install DVD. It created the directory
/srv/www/perl-lib and in /etc/apache2 I find mod_perl-startup.pl and
in /etc/apache2/conf.d I find mod_perl.conf.
Problem is when I dropped the file rock.pl (see below) in
/srv/www/perl-lib it doesn't run - meaning I go to
http://server_name/perl-lib/rock.pl in a browser and get an "Object
not found!".
Permissions on rock.pl:
-rwxr-xr-x 1 nobody nobody 85 2007-03-14 21:56 rock.pl
.......................... rock.pl
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";
Suggestions appreciated!
Michael
......................................
what do the apache logs tell you?
......................................
Thanks!
Sorry for not listing that -
from access_log...............
xxx.xxx.223.41 - - [14/Mar/2007:22:17:35 -0600] "GET /rock.pl
HTTP/1.1" 200 85 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2"
xxx.xxx.223.41 - - [14/Mar/2007:22:19:10 -0600] "GET /rock.pl
HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2"
xxx.xxx.223.41 - - [14/Mar/2007:22:28:11 -0600] "GET /perl-lib/rock.pl
HTTP/1.1" 404 1005 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2"
xxx.xxx.223.41 - - [14/Mar/2007:22:30:26 -0600] "GET /perl-lib/rock.pl
HTTP/1.1" 404 1005 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2"
xxx.xxx.223.41 - - [14/Mar/2007:22:35:52 -0600] "GET /rock.pl
HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2"
from error.log.................
[Wed Mar 14 22:15:19 2007] [error] [client 192.168.223.41] File does
not exist: /srv/www/htdocs/perl-lib
[Wed Mar 14 22:15:48 2007] [error] [client 192.168.223.41] File does
not exist: /srv/www/htdocs/perl-lib
[Wed Mar 14 22:16:44 2007] [error] [client 192.168.223.41] File does
not exist: /srv/www/htdocs/rock.pl
[Wed Mar 14 22:28:11 2007] [error] [client 192.168.223.41] File does
not exist: /srv/www/htdocs/perl-lib
[Wed Mar 14 22:30:26 2007] [error] [client 192.168.223.41] File does
not exist: /srv/www/htdocs/perl-lib
Frankly I'm not sure what this is saying -
I searched both files and find no mention of mod_perl -
Thanks for the help -
Michael
......................................
Is it similar to this:
https://bugzilla.novell.com/show_bug.cgi?id=245173
--
Richard
......................................
Richard:
Thanks!
I logged in and voted for the bug and added a comment.
It just seems that all the parts and pieces are installed but it doesn't
work.
Thanks again!
M-
......................................
On Wed, 14 Mar 2007, Michael Folsom
Folks:
New to mod_perl and am having trouble getting mod_perl going on OpenSuse 10.2.
Have a system with apache installed and working and used yast to install mod_perl from the install DVD. It created the directory /srv/www/perl-lib and in /etc/apache2 I find mod_perl-startup.pl and in /etc/apache2/conf.d I find mod_perl.conf.
Problem is when I dropped the file rock.pl (see below) in /srv/www/perl-lib it doesn't run - meaning I go to http://server_name/perl-lib/rock.pl in a browser and get an "Object not found!".
Not surprising really. If you look at mod_perl.conf, you'll find the
first few lines are:
Permissions on rock.pl: -rwxr-xr-x 1 nobody nobody 85 2007-03-14 21:56 rock.pl
........................... rock.pl #!/usr/bin/perl print "Content-type: text/plain\n\n"; print "mod_perl 2.0 rocks!\n";
Suggestions appreciated!
Copy it into /cgi-bin/ ? It'll work from there:
davjam@donnas:~> cat /srv/www/cgi-bin/test.pl
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";
davjam@donnas:~> telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /cgi-bin/test.pl HTTP/1.0
HTTP/1.1 200 OK
Date: Thu, 15 Mar 2007 17:42:46 GMT
Server: Apache/2.2.3 (Linux/SUSE)
Content-Length: 20
Connection: close
Content-Type: text/plain
mod_perl 2.0 rocks!
Connection closed by foreign host.
Regards,
David Bolt
......................................
David:
Thanks!
You are right - it works from the cgi-bin directory.
Now why oh why did they ship the mod_perl.conf file that way when they
had created the directory /srv/www/perl-lib to put perl scripts in?
The next question is - how do you fix the file to get it to work?
Contents of the default mod_perl.conf in OpenSuse 10.2 below -
...mod_perl.conf.......
David:
Thanks!
You are right - it works from the cgi-bin directory.
Now why oh why did they ship the mod_perl.conf file that way when they had created the directory /srv/www/perl-lib to put perl scripts in?
No idea. I always install any scripts into /cgi-bin/. It makes things much easier as it "just works".
The next question is - how do you fix the file to get it to work?
If you really want to use it, it just needs a few of changes.
Contents of the default mod_perl.conf in OpenSuse 10.2 below -
<Snip>
Deny from all
Change this to "Allow from all" <snip>
ScriptAlias /perl/ "/srv/www/cgi-bin/"
Change this to: ScriptAlias /perl/ "/srv/www/perl-lib/" <snip>
ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
Now why oh why did they ship the mod_perl.conf file that way when
And this to: ScriptAlias /cgi-perl/ "/srv/www/perl-lib/" Then, after restarting, it should work as you're expecting it to do. ...................................... Op donderdag 15 maart 2007 21:30, schreef David Bolt: they
had created the directory /srv/www/perl-lib to put perl scripts in?
No idea. I always install any scripts into /cgi-bin/. It makes things much easier as it "just works".
The next question is - how do you fix the file to get it to work?
If you really want to use it, it just needs a few of changes.
Op donderdag 15 maart 2007 21:30, schreef David Bolt:
Now why oh why did they ship the mod_perl.conf file that way when
Do perl scripts work from userdir ($HOME/public_html or
$HOME/public_html/cgi-bin) as well. Or does that need changes to the
config
file as well?
......................................
On Thu, 15 Mar 2007, Richard Bos
had created the directory /srv/www/perl-lib to put perl scripts in?
No idea. I always install any scripts into /cgi-bin/. It makes things much easier as it "just works".
The next question is - how do you fix the file to get it to work?
If you really want to use it, it just needs a few of changes.
Do perl scripts work from userdir ($HOME/public_html or $HOME/public_html/cgi-bin) as well.
Not here they don't[0], which is a Good Thing(tm).
Or does that need changes to the config file as well?
To open up that sort of security hole would require changes to the
config file(s), changes I personally would not make.
As to the security hole. Adding a binary or script to /srv/www/cgi-bin,
/srv/www/cgi-perl or /srv/www/perl-lib requires the root password.
Adding a random binary or script to ~/public_html/cgi-bin/ only requires
user-level access. It's possible, although unlikely, that this could be
a vector for installing a root-kit.
[0] Tested because, even though I thought it wouldn't work, I just
wanted to make sure I didn't have a hole to close:
davjam@donnas:~> mkdir public_html/cgi-bin
davjam@donnas:~> sed -e 's#2.0 rocks#2.0 breaks rocks#g'
~/public_html/cgi-bin/test.pl
davjam@donnas:~> telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /~davjam/cgi-bin/test.pl HTTP/1.0
HTTP/1.1 200 OK
Date: Thu, 15 Mar 2007 21:33:54 GMT
Server: Apache/2.2.3 (Linux/SUSE)
Last-Modified: Thu, 15 Mar 2007 21:33:35 GMT
ETag: "69143-5c-42bbde01309c0"
Accept-Ranges: bytes
Content-Length: 92
Connection: close
Content-Type: application/x-perl
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 breaks rocks!\n";
Connection closed by foreign host.
Regards,
David Bolt
......................................
David, Richard, & Bruce -
Thanks to all - I have learned lots however still not enough to solve
the original problem -
Anyway, after I edit mod_perl.con to include the suggested changes I
still can't run scripts from /srv/www/perl-lib that work in
/srv/www/cgi-bin --
...................................................................
edited mod_perl.conf
David, Richard, & Bruce -
Thanks to all - I have learned lots however still not enough to solve the original problem -
Anyway, after I edit mod_perl.con to include the suggested changes I still can't run scripts from /srv/www/perl-lib that work in /srv/www/cgi-bin --
Okay, I know I missed out a change that's required.
.................................................................... edited mod_perl.conf
AllowOverride None Options None Order allow,deny Allow from all </Directory>
My working mod_perl.conf contains the following changes:
David:
Thanks for your help on this -
I hate to say it but its still hosed -
I continue to be surprised that OpenSuse 10.2 got shipped with such a broken mod_perl. When I look at the original file its so wrong its amazing that it didn't get noticed.
I don't see how it's broken as they work just fine on my system[0]. Perl
scripts work inside /cgi-bin/ as I'd expect them to do, and by adding
the snippet below to mod_perl.conf and restarting apache2, Perl scripts
work when placed in /srv/www/perl-lib .
***** Start snippet *****
ScriptAlias /perl-lib/ "/srv/www/perl-lib/"
Anyway, the current state of my mod_perl.conf is below but I'm beginning to wonder if something is broken elsewhere even though perl scripts in /srv/www/cgi-bin still work.
On Fri, 16 Mar 2007, Michael Folsom
wrote:- David:
Thanks for your help on this -
I hate to say it but its still hosed -
I continue to be surprised that OpenSuse 10.2 got shipped with such a broken mod_perl. When I look at the original file its so wrong its amazing that it didn't get noticed.
I don't see how it's broken as they work just fine on my system[0]. Perl scripts work inside /cgi-bin/ as I'd expect them to do, and by adding the snippet below to mod_perl.conf and restarting apache2, Perl
Have you made sure you restarted apache2? Without a restart it won't
pick up the changes.
[0] openSUSE 10.2:
davjam@donnas:~> uname -a
Linux donnas 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006
x86_64 x86_64 x86_64 GNU/Linux
davjam@donnas:~> cat /etc/SuSE-release
openSUSE 10.2 (X86-64)
VERSION = 10.2
davjam@donnas:~> rpm -q apache2
apache2-2.2.3-20
- Show quoted text -
Regards,
David Bolt
--
Member of Team Acorn checking nodes at 50 Mnodes/s:
http://www.distributed.net/
RISCOS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
RISCOS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3a1 32bit
work when placed in /srv/www/perl-lib .
***** Start snippet *****
ScriptAlias /perl-lib/ "/srv/www/perl-lib/"
# mod_perl mode SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Location> ***** End snippet *****
Anyway, the current state of my mod_perl.conf is below but I'm beginning to wonder if something is broken elsewhere even though perl scripts in /srv/www/cgi-bin still work.
Have you made sure you restarted apache2? Without a restart it won't pick up the changes.
[0] openSUSE 10.2: davjam@donnas:~> uname -a Linux donnas 2.6.18.2-34-default #1 SMP Mon Nov 27 11:46:27 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux davjam@donnas:~> cat /etc/SuSE-release openSUSE 10.2 (X86-64) VERSION = 10.2 davjam@donnas:~> rpm -q apache2 apache2-2.2.3-20
Regards, David Bolt
-- Member of Team Acorn checking nodes at 50 Mnodes/s: http://www.distributed.net/ RISCOS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit RISCOS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3a1 32bit
AllowOverride None Options None # Options +ExecCGI -Includes Order allow,deny
Deny from all # Allow from all
</Directory>
<IfModule mod_perl.c> PerlRequire "/etc/apache2/mod_perl-startup.pl"
ScriptAlias /perl-lib/ "/srv/www/perl-lib/"
# mod_perl mode SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Location>
ScriptAlias /perl/ "/srv/www/cgi-bin/"
# mod_perl mode SetHandler perl-script PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders Options +ExecCGI </Location>
ScriptAlias /cgi-perl/ "/srv/www/cgi-bin/"
# perl cgi mode SetHandler perl-script PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders Options +ExecCGI </Location>
......................................
On Fri, 16 Mar 2007, Michael Folsom
David:
I agree entirely -
Yes, I've been restarting apache after each change -
Question - are you using the stock stuff that came with OpenSuse 10.2?
Yes.
On my box I just installed apache and it either came with mod_per or I used yast to add it later. Same for you?
Yes. When doing the install I used the expert mode, clicked package groups and then went through and made sure both Perl and PHP were installed.
When I get back to it tonight I'll go through things again to make sure I haven't hosed things elsewhere but don't think I have -
There's an easy to make sure you haven't. Use YaST to force a re-install of the apache2-mod_perl RPM.
By-the-by, the 4th posting in this thread lists a bug that has been turned into Suse/Novell re: this issue.
Yes, I noticed it. I'm not sure that your problem is the same one but, since no-one from Novell/SUSE has yet replied to it, that's just my feeling. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=245173 ------- Comment #8 from mzugec@novell.com 2007-03-21 08:18 MST ------- Michael, copy content from comment #7 into new bugreport please. Original report was about UserDir option and is fixed already, your report is probably about Alias option -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com