Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 Problems (With PHP)
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
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Sat Sep 11, 2004 3:24 am    Post subject: Apache2 Problems (With PHP) Reply with quote

I'm trying to setup a Gentoo Linux server (not the first one I've done) to run Apache2 + mod_php to setup a website for myself. I'm having some trouble though.

http://130.215.233.79

That's the website, and from what I can tell, even the default apache page is broken (shouldn't it have the apache logo somewhere?) If you append a "/gallery/" to that, you get another problem, this one PHP specific. I know that session_id() is a legal function, because I've used it before and I've checked the documentation, yet for some reason I get this error:


Fatal error: Call to undefined function session_id() in /var/www/localhost/htdocs/gallery/session.php on line 39

Everything is default, nothing has been touched, so it should all work no problem. Any ideas?
Back to top
View user's profile Send private message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Sat Sep 11, 2004 4:21 am    Post subject: Reply with quote

I figured out the gallery problem, now my problem is that Apache2 is set to the default extremely restrictive settings, and no matter what I do, it doesn't seem to listen to me and allow anything to be run correctly.

For instance:

http://130.215.233.79/gallery/index.php

That should work, but doesn't. I haven't a clue why, worked fine the last time I tried this (over half a year ago, so things obviously changed).
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1411

PostPosted: Sat Sep 11, 2004 5:47 am    Post subject: Reply with quote

Hello

Looks like you are using php5. The session problem is related to a new USE flag related to sessions.

re-emerge mod_php...
Code:

ACCEPT_KEYWORDS="~x86" USE="session" emerge -pv mod_php


I would also recommend changing some of the values.. to not display so much information.. in commonapache.conf
Code:

ServerTokens Prod
ServerSignature Off


As far as the restriction on the directory.. I would create a directive for that directory... maybe in vhosts.conf

Code:
<Directory "/var/www/localhost/htdocs/gallery/">
        RewriteEngine On
        RewriteCond %{REQUEST_METHOD} ^TRACE
        RewriteRule .* - [F]
        ErrorDocument 404 /index.php
        ErrorDocument 403 /index.php
        ErrorDocument 401 /index.php
        Options Includes -FollowSymLinks IncludesNoExec +SymLinksIfOwnerMatch
        AllowOverride AuthConfig
        DirectoryIndex index.php index.htm
        <Limit GET POST>
                Order Allow,Deny
                Allow from all
        </Limit>

</Directory>


The Order allow,deny...allow from all should fix your other problem.

I hope this helps
hanji
Back to top
View user's profile Send private message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Sun Sep 12, 2004 3:54 am    Post subject: Reply with quote

PHP works, but I'm still getting errors trying to actually reach any page other than an index.*, and if I type in "/gallery/index.php" it'll actually give me an error (where as "/gallery/" gives me the index gallery page). Any ideas?
Back to top
View user's profile Send private message
imbiea
Tux's lil' helper
Tux's lil' helper


Joined: 23 Nov 2004
Posts: 91
Location: Colorado Rockies

PostPosted: Tue Sep 20, 2005 7:27 pm    Post subject: Reply with quote

when running gallery/setup and waiting a LONG time... you will see that you need to add these lines to your /etc/apache2/httpd.conf file:

Try that...

Code:



<Directory /var/www/localhost/htdocs/gallery>
   AllowOverride Options FileInfo
</Directory>

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