Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2/mod_php/mod_ssl
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ClippyHater
Apprentice
Apprentice


Joined: 06 Nov 2002
Posts: 247
Location: Wisconsin

PostPosted: Sat Dec 28, 2002 12:38 pm    Post subject: Apache2/mod_php/mod_ssl Reply with quote

I see the install instructions for apache/php/mod_php/mod_ssl in the desktop config guide, but are there comparable instructions somewhere for apache2?
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Sat Dec 28, 2002 5:24 pm    Post subject: Reply with quote

Moving to Network & Security.
_________________
"I'm just very selective about the reality I choose to accept." -- Calvin
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Wed Jan 08, 2003 9:40 pm    Post subject: Reply with quote

Well I got apache2 and mod_php to install just fine. You have to have "apache2" in your USE flag.

However apache2 still isn't handling php files. It wants to download them. You know that old gag. Yes, I've added "-D PHP4" to /etc/conf.d/apache2. No dice. Then I noticed inside that file they say to use "-D PHP", which I tried and still no dice.

So if anyone has this working please let us know!
Back to top
View user's profile Send private message
Rihkama
n00b
n00b


Joined: 16 May 2002
Posts: 21
Location: Finland

PostPosted: Thu Jan 09, 2003 6:52 am    Post subject: Reply with quote

PHP doesn't support Apache 2 yet. Or actually it supports but it is fairly buggy. I suppose PHP's own manual has quite accurate warning about it: "Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows".

You might check http://www.php.net/manual/en/install.apache2.php in case it has some extra instrucutions which you haven't done.
Back to top
View user's profile Send private message
Dalrain
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2002
Posts: 136
Location: Wooster, OH USA

PostPosted: Thu Jan 09, 2003 2:35 pm    Post subject: Reply with quote

I've had apache2 + mysql + php running quite well on my Gentoo box for a while. The main thing on the PHP is that you'll definitely want to get the latest development PHP though. 4.3.x any release also seems to work fine with 2.0.43 as well.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Jan 09, 2003 5:09 pm    Post subject: Reply with quote

Dalrain did you have to do any special configs other than edit the /etc/conf.d/apache2? I have apache 2.0.43-r1 and mod_php 4.3.0-r1.

This is the only uncommented line in /etc/conf.d/apache2:

Code:
APACHE2_OPTS="-D SSL -D PHP"


I've tried also "PHP4" instead of just "PHP" in that line, but no change.
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Thu Jan 09, 2003 8:13 pm    Post subject: Reply with quote

OK I guess it had been working this whole time ... sort of. I made a "phpinfo.php" page with just this code:

Code:
<? phpinfo(); ?>


That worked great. However my index.php file was still not being handled. So out of curiosity I moved my phpinfo.php to index.php and now that wasn't working. Sure enough other php files worked, just not that index.php in my doc root.

So for some reason apache (both 1 and 2 behave this way) doesn't like files named index.php in the doc root. I'll keep digging.
Back to top
View user's profile Send private message
opello
n00b
n00b


Joined: 01 Jul 2002
Posts: 35
Location: USA

PostPosted: Thu Jan 16, 2003 12:30 am    Post subject: Reply with quote

maybe try adding "index.php" do your list of default pages in the DirectoryIndex of the commonapache.conf, mine is like:
Code:
<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.php3 index.shtml index.cgi index.$
</IfModule>


but then, I believe that I just added index.php at the front.

Anyway, it works for me (apache 1.3.26-r4) but I'm going to 2.0.43-r1 as I type :)

Going to get the newest php and ssl with the use flag set, and I'll post back here if it works flawlessly ... right ... heh.
Back to top
View user's profile Send private message
opello
n00b
n00b


Joined: 01 Jul 2002
Posts: 35
Location: USA

PostPosted: Thu Jan 16, 2003 2:57 am    Post subject: Reply with quote

Just got Apache 2.0.43-r1 and mod_php 4.3.0-r2 emerged, and with just configuring apache to my liking, and mod_php emerged with the apache2 use flag, everything worked great.

Hope this helps someone.
Back to top
View user's profile Send private message
lordjoe
n00b
n00b


Joined: 16 Jan 2003
Posts: 16
Location: California, USA

PostPosted: Thu Jan 16, 2003 3:40 am    Post subject: Reply with quote

I've been trying to setup apache 2.0.43-r1 and mod_php 4.3.0-r2 today without much luck. I have specified "-D PHP" in the /etc/conf.d/apache2 (despite what the ebuild says, 70_mod_php.conf in /etc/apache2/conf/modules.d/ looks for PHP to be defined, not PHP4). I see "Apache/2.0.43 (Gentoo/Linux) mod_ssl/2.0.43 OpenSSL/0.9.6h PHP/4.3.0" in the logs so i'm assuming mod_php is getting loaded just fine. I'm trying to use webvcrplus. When I try to run the config.php (or just let it load the index.php) i'm prompted to save/view the file. It does report the correct mime-type (application/x-httpd-php) as the mod_php modules.d conf is supposed to set... would be nice to figure this one out :p
Back to top
View user's profile Send private message
opello
n00b
n00b


Joined: 01 Jul 2002
Posts: 35
Location: USA

PostPosted: Thu Jan 16, 2003 3:11 pm    Post subject: Reply with quote

Well, I kept my version of apache1 just in case, but all I did was:
emerge apache-2.0.43-r1.ebuild
edit the /etc/make.conf to include apache2 as a use flag
emerge mod_php

I didn't do ssl, but can if you want me to test it.

As for the php stuff, all I did was leave the ini and other settings as default. I did add index.php (as I said above) to the DirectoryIndex directive in commonapache2.conf
Back to top
View user's profile Send private message
lordjoe
n00b
n00b


Joined: 16 Jan 2003
Posts: 16
Location: California, USA

PostPosted: Fri Jan 17, 2003 7:29 am    Post subject: Reply with quote

alright... all is well now somehow. I'm not sure what did it; i cleaned out all the config files and remerged (is that a word?) and it works... weird
Back to top
View user's profile Send private message
opello
n00b
n00b


Joined: 01 Jul 2002
Posts: 35
Location: USA

PostPosted: Fri Jan 17, 2003 11:00 pm    Post subject: Reply with quote

good deal ... I don't know what it could have been unless it was hung up on something from apache1 ... But mine emerged into another folder /etc/apache2 iirc ...

I guess i'd say remerged (re-merged) but re-emerged sounds just as strange :)

Glad you got it working.
Back to top
View user's profile Send private message
crossfire
n00b
n00b


Joined: 05 Feb 2003
Posts: 4

PostPosted: Wed Feb 05, 2003 1:58 pm    Post subject: index.php not working Reply with quote

rizzo - did you ever get this fixed? I just installed apache2 and php4 and have the same problem - everything works excpet for index.php



rizzo wrote:
OK I guess it had been working this whole time ... sort of. I made a "phpinfo.php" page with just this code:

Code:
<? phpinfo(); ?>


That worked great. However my index.php file was still not being handled. So out of curiosity I moved my phpinfo.php to index.php and now that wasn't working. Sure enough other php files worked, just not that index.php in my doc root.

So for some reason apache (both 1 and 2 behave this way) doesn't like files named index.php in the doc root. I'll keep digging.
Back to top
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Fri Feb 07, 2003 1:09 pm    Post subject: Reply with quote

No problem here. Does your commonapache2.conf contain the following?
Code:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.html.var index.php index.php3 index.shtml index.cgi index.pl index.htm Default.htm default.htm
</IfModule>

and does your apache2.conf load commonapache2.conf?
Back to top
View user's profile Send private message
crossfire
n00b
n00b


Joined: 05 Feb 2003
Posts: 4

PostPosted: Sat Feb 08, 2003 12:07 am    Post subject: Reply with quote

Yes, I have both,

in my apache2.conf file:

# For Apache2 we load all conf files in conf/modules.d
Include conf/modules.d/*.conf
Include conf/commonapache2.conf

and in commonapache2.conf

### DirectoryIndex: Name of the file or files to use as a pre-written HTML
### directory index. Separate multiple entries with spaces.
###
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.html.var index.php3 index.shtml index.cgi index.pl index.htm Default.htm default.htm
</IfModule>




Sven Vermeulen wrote:
No problem here. Does your commonapache2.conf contain the following?
Code:

<IfModule mod_dir.c>
    DirectoryIndex index.html index.html.var index.php index.php3 index.shtml index.cgi index.pl index.htm Default.htm default.htm
</IfModule>

and does your apache2.conf load commonapache2.conf?
Back to top
View user's profile Send private message
slott_hansen
n00b
n00b


Joined: 03 Feb 2003
Posts: 40
Location: Denmark, Copenhagen

PostPosted: Sat Feb 08, 2003 6:50 pm    Post subject: Still having problems... Reply with quote

I have had similar problems and I still have them... :cry:

I emerged apache2 and mod_php and when ever I access a PHP file it prompts for download. I use lynx on localhost but that shouldn't be the problem.

To further depress me my apache2 won't startup automatically when I reboot. I have to do a start/stop (restart won't make it work) in order for it to accept connections.
And the spooky thing is that when I do a apache2 status it tells me it's started. Netstat shows NO apache and thus I'm lead to belive there must be something wrong!!!!

So if anyone could PLEASE shed some light on this I would be greatly apriciated...
_________________
Best regards,
Morten Slott Hansen
Back to top
View user's profile Send private message
slott_hansen
n00b
n00b


Joined: 03 Feb 2003
Posts: 40
Location: Denmark, Copenhagen

PostPosted: Sat Feb 08, 2003 7:07 pm    Post subject: Reply with quote

Phew- got the PHP stuff working.
I manually had to add the following stuff to my apache2.conf...

LoadModule php4_module /usr/lib/apache2-extramodules/libphp4.so

Well thats one problem solved. But still my apache refuses to be "connectable" after a reboot!!!!
_________________
Best regards,
Morten Slott Hansen
Back to top
View user's profile Send private message
slott_hansen
n00b
n00b


Joined: 03 Feb 2003
Posts: 40
Location: Denmark, Copenhagen

PostPosted: Sun Feb 09, 2003 12:05 pm    Post subject: What is called on startup...? Reply with quote

I have been looking at my problem for quite some time now and I'm still not getting closer to finding a solution. I installed postgreSQL and when I try to connect after a reboot I have no trouble at all - so what could be wrong with my apache2 ???
_________________
Best regards,
Morten Slott Hansen
Back to top
View user's profile Send private message
bertrand
n00b
n00b


Joined: 23 Sep 2002
Posts: 11
Location: Paris

PostPosted: Wed Feb 12, 2003 4:08 pm    Post subject: Reply with quote

I added the following to my /etc/apache2/conf/apache2.conf and it start working for .php files

Code:

LoadModule php4_module                  /usr/lib/apache2-extramodules/libphp4.so

AddType application/x-httpd-php         php
<Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
</Files>

# PHP Syntax Coloring (recommended):
AddType application/x-httpd-php-source  phps
<Files *.phps>
        SetOutputFilter PHP
        SetInputFilter PHP
</Files>


I hope this can help someone else!
Back to top
View user's profile Send private message
DarkJedi9
Apprentice
Apprentice


Joined: 28 Oct 2002
Posts: 204

PostPosted: Fri Feb 14, 2003 9:33 pm    Post subject: Reply with quote

Okay, I have apache2 in my USE flag, and I have emerged apache and mod_php. I also added the lines bertrand suggested into apache2.conf. Then I did /etc/init.d/apache start. Apache is working, but when I try to go to http://localhost/hello.php, it wants to save or open then file, like others have had trouble with. As far as I can tell, I've done everything that has worked for the others, and it isn't helping me. Any suggestions?
Back to top
View user's profile Send private message
DarkJedi9
Apprentice
Apprentice


Joined: 28 Oct 2002
Posts: 204

PostPosted: Sat Feb 15, 2003 2:09 am    Post subject: Reply with quote

Alright, this is really strange. I have two files in my /home/httpd/htdocs directory, phpinfo.php and hello.php. When I try to go to http://localhost/hello.php, I get that accursed save or open dialog box, but when I go to http://localhost/phpinfo.php, I get this page full of stuff. (BTW, both files contain only one line: <? phpinfo(); ?>) That lines sure looks like it would generate the page I see, so I guess that's good, but I can't for the life of me see why one file would be interpreted correctly and one not.
Back to top
View user's profile Send private message
slott_hansen
n00b
n00b


Joined: 03 Feb 2003
Posts: 40
Location: Denmark, Copenhagen

PostPosted: Sat Feb 15, 2003 8:27 am    Post subject: Reply with quote

Did you change your /etc/conf.d/apache2 to the following ?


APACHE2_OPTS="-D SSL -D PHP"
_________________
Best regards,
Morten Slott Hansen
Back to top
View user's profile Send private message
DarkJedi9
Apprentice
Apprentice


Joined: 28 Oct 2002
Posts: 204

PostPosted: Sat Feb 15, 2003 5:29 pm    Post subject: Reply with quote

Actually, I just got it working. I'm not sure exactly why though. My /etc/conf.d/apache2 has APACHE2_OPTS="-D PHP4", and my /etc/apache2/conf/apache2.conf has LoadModule php4_module /usr/lib/apache2-extramodules/libphp4.so in it, which I would swear I had before, but now it's working. I did notice what was noted above (I believe; I'm having a hard time finding it now) about rebooting. I had to reboot the whole comp, not just restart apache2. But hey, it works. Thanks all for the help.
Back to top
View user's profile Send private message
Trumpcard
n00b
n00b


Joined: 27 May 2002
Posts: 36

PostPosted: Thu Mar 20, 2003 5:42 pm    Post subject: Reply with quote

I have a similiar problem to this... Any php in my root directory works fine, but anything in a subdirectory is not recognized....

If I move my php to / , they work fine, if I try to access them from subdirectories, they wont work at all. I've even set up my sub <DIRECTORY ...> to look exactly like the root directory, so Im not sure what the issue is.
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
Goto page 1, 2  Next
Page 1 of 2

 
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