Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 PHP Configuration
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
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Wed Apr 19, 2006 5:37 am    Post subject: Apache2 PHP Configuration Reply with quote

I am trying to set up my apache server to allow php access only via https, and not http.
All functions work correctly, however I just wish to dissallow php execution for pages loaded through http; and allow php execution for pages loaded through https.
Using apache 2.x, and php 5.x.
Can this be fairly easily implemented?
Back to top
View user's profile Send private message
!equilibrium
Bodhisattva
Bodhisattva


Joined: 06 Jun 2004
Posts: 2109
Location: MI/BG/LC

PostPosted: Wed Apr 19, 2006 12:45 pm    Post subject: Re: Apache2 PHP Configuration Reply with quote

liber8ate wrote:
I am trying to set up my apache server to allow php access only via https, and not http.
All functions work correctly, however I just wish to dissallow php execution for pages loaded through http; and allow php execution for pages loaded through https.
Using apache 2.x, and php 5.x.
Can this be fairly easily implemented?


you need to modify: /etc/apache2/modules.d/70_mod_php5.conf

than restart apache
_________________
Arch Tester for Gentoo/FreeBSD
Equilibrium's Universe

all my contents are released under the Creative Commons Licence by-nc-nd 2.5
Back to top
View user's profile Send private message
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Wed Apr 19, 2006 2:47 pm    Post subject: Reply with quote

Ok, I checked out the file, but I didn't see anything there related to limited php execution, aside from by file extension (.php, .phtml, etc).
Any hints as to how I need to edit it?
Back to top
View user's profile Send private message
anonybosh
Guru
Guru


Joined: 20 Nov 2005
Posts: 324

PostPosted: Thu Apr 20, 2006 5:26 am    Post subject: Reply with quote

Well, I seem to have found one way which seems to work. I moved the following from /etc/apache2/modules/70_mod_php5.conf into one of the vhosts in the the 41_mod_ssl.default-vhost.conf file:
Code:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php5
AddType application/x-httpd-php-source .phps
So basically only through that specific vhost should apache recognize any of the php files as php files.
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