Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Installing Apache, PHP, and Perl
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
supster
n00b
n00b


Joined: 14 Feb 2004
Posts: 24

PostPosted: Fri Apr 02, 2004 4:21 am    Post subject: Installing Apache, PHP, and Perl Reply with quote

I'de like to install Apache with support for PHP and Perl

I notice whith
Code:
emerge --pretend apache mod_php mod_perl mod_ssl

It will try to install both Apache2 and Apache 1.3.

Whats the problem and how can I fix it? Through searching the forums I heard that mod_perl doesn't work with Apache2, so I suppose 1.3 is the path I need to go down, right?
Back to top
View user's profile Send private message
jmusits
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 117
Location: New York

PostPosted: Fri Apr 02, 2004 4:41 am    Post subject: Reply with quote

You will need to mask Apache 2
Code:
# echo '>=net-www/apache-2.0' >> /etc/portage/package.mask


should do it.

Jason
_________________
If you got the DO RE I got MI.

--Jerry Garcia "Run For The Roses"
Back to top
View user's profile Send private message
jabber
n00b
n00b


Joined: 23 Mar 2004
Posts: 6

PostPosted: Fri Apr 02, 2004 4:41 am    Post subject: Reply with quote

Sure you can install Apache2 without installing Apache 1.3. For mod_perl you need the 1.99.x version instead of the 1.29 version.

You may need to do this in multiple steps so you only emerge what you need.
Try:
Code:
 emerge -pv =apache-2.0.49


For the mod_perl you will need to use the development version:
Code:
 ACCEPT_KEYWORDS="~x86" emerge -pv =mod_perl-1.99.11


Then add in the other modules you want to emerge.

I suspect that you will have some trouble with mod_perl working the way you want -- seems like most people do. I've been working for a few days getting mod_perl-1.99.11 to work the way I need it to (I needed to add an additional flag within the ebuild to keep backwards compatibility with my mod_perl 1 system).
Back to top
View user's profile Send private message
supster
n00b
n00b


Joined: 14 Feb 2004
Posts: 24

PostPosted: Fri Apr 02, 2004 5:01 am    Post subject: Reply with quote

Thanks for the help, I don't really care for Apache2 so I'll just follow jmusits's suggestion, it seems like I'll have a greater chance of getting Perl to work that way.

Is there anything else I need to do to get Apache to load the Perl module or to know to parse .cgi files with Perl?


edit: /etc/portage/ doesn't seem to exist, I did find /usr/portage/profiles/package.mask though, is that what you were refering to?
Back to top
View user's profile Send private message
jmusits
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 117
Location: New York

PostPosted: Fri Apr 02, 2004 5:19 am    Post subject: Reply with quote

You will just need to tell apache to load mod_php, mod_ssl, and mod_perl when it starts up. Do this by changing this line in /etc/conf.d/apache
Code:
APACHE_OPTS="-D SSL -D PHP4 -D PERL"


and adding these lines to /etc/apache/conf/apache.conf
Code:

<IfDefine PHP4>
LoadModule php4_module    extramodules/libphp4.so
</IfDefine>
<IfDefine PERL>
LoadModule perl_module          extramodules/libperl.so
</IfDefine>
<IfDefine PHP4>
AddModule mod_php4.c
</IfDefine>
<IfDefine PERL>
AddModule mod_perl.c
</IfDefine>
Include  conf/addon-modules/mod_php.conf



and these lines in /etc/apache/conf/commonapache.conf
Code:

<IfModule mod_perl.c>
    PerlModule Apache::Registry
   
    #set Apache::Registry Mode for /perl Alias
    <Location /perl/*.pl>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options -Indexes ExecCGI
        PerlSendHeader On
    </Location>
   
    #set Apache::PerlRun Mode for /cgi-perl Alias
    <Location /cgi-perl/*.pl>
        SetHandler perl-script
        PerlHandler Apache::PerlRun
        Options -Indexes ExecCGI
        PerlSendHeader On
    </Location>
</IfModule>

<IfModule mod_php4.c>

AddType  application/x-httpd-php         .php .php4 .php3 .phtml
AddType  application/x-httpd-php-source  .phps

</IfModule>


You might not have to make all these changes some might already be there, I not sure, so I just included everything. Also I remember there being some scripts to automate this, but they did not work for me.

Hope this helps.

Jason
_________________
If you got the DO RE I got MI.

--Jerry Garcia "Run For The Roses"
Back to top
View user's profile Send private message
jmusits
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 117
Location: New York

PostPosted: Fri Apr 02, 2004 5:20 am    Post subject: Reply with quote

Sorry I forgot this in my previous post, you will need to create /etc/portage

Jason
_________________
If you got the DO RE I got MI.

--Jerry Garcia "Run For The Roses"
Back to top
View user's profile Send private message
supster
n00b
n00b


Joined: 14 Feb 2004
Posts: 24

PostPosted: Fri Apr 02, 2004 6:34 am    Post subject: Reply with quote

Hey thanks, I really aprecieate you trying to help me get this setup.

I added what you said but get this when trying to start Apache:
Code:

 * Starting apache...
[Fri Apr  2 09:17:52 2004] [warn] module mod_php4.c is already added, skipping
[Fri Apr  2 09:17:52 2004] [warn] module mod_perl.c is already added, skipping
Syntax error on line 3 of /etc/apache/conf/addon-modules/mod_php.conf:
Invalid command 'AddType', perhaps mis-spelled or defined by a module not included in the server configuration                                            [ !! ]



I can start Apache using the default config files, and PHP works then, but Perl doesn't. I get a 403 Forbidden error when trying to access a .cgi file. Any idea whats going on? I thought something along the lines of the perl and php modules are already being called somewhere else before what I added is ran, searching for php and perl in the config files shows up this in commonapache.conf:
Code:

<IfModule mod_perl.c>
    <Location /perl-status>
   SetHandler perl-script
   PerlHandler Apache::Status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
   #Allow from .your_domain.com
    </Location>
</IfModule>
... and ...
<IfModule mod_perl.c>
    <Directory /home/*/public_html/perl>
   SetHandler perl-script
   PerlHandler Apache::PerlRun
   Options -Indexes ExecCGI
   PerlSendHeader On
    </Directory>
</IfModule>




Oh, and my perl scripts are pointing to /usr/bin/perl, I'm pretty sure thats right.



edit: I tried putting the script in the /cgi-bin directory rather than just htdocs, now I get a 500 Internal Server Error while calling the "test-cgi" script from the /cgi-bin folder (or any perl script) rather than the 403 error.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum