View previous topic :: View next topic |
Author |
Message |
anonybosh Guru

Joined: 20 Nov 2005 Posts: 324
|
Posted: Wed Apr 19, 2006 5:37 am Post subject: Apache2 PHP Configuration |
|
|
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 |
|
 |
!equilibrium Bodhisattva


Joined: 06 Jun 2004 Posts: 2109 Location: MI/BG/LC
|
Posted: Wed Apr 19, 2006 12:45 pm Post subject: Re: Apache2 PHP Configuration |
|
|
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 |
|
 |
anonybosh Guru

Joined: 20 Nov 2005 Posts: 324
|
Posted: Wed Apr 19, 2006 2:47 pm Post subject: |
|
|
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 |
|
 |
anonybosh Guru

Joined: 20 Nov 2005 Posts: 324
|
Posted: Thu Apr 20, 2006 5:26 am Post subject: |
|
|
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 |
|
 |
|