Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 112247 - Apache not honoring RemoveType directives anymore
Summary: Apache not honoring RemoveType directives anymore
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-12 02:20 UTC by Marcel Meckel
Modified: 2006-08-16 14:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Meckel 2005-11-12 02:20:58 UTC
Hi,

i'm running apache2+mod_php on a server with several vhosts configured. For some 
friends i host their pages, too. For some reason i don't want them to be able to 
execute php Scripts, so i did this in their <virtualhost>:

<VirtualHost a.b.c.d:80>
        [..]
        RemoveType application/x-httpd-php .php
        RemoveType application/x-httpd-php .phtml
        RemoveType application/x-httpd-php .php3
        RemoveType application/x-httpd-php .php4
        RemoveType application/x-httpd-php-source .phps
        [..]
        <Directory "/foo">
                Options -All
                AllowOverride None
        </Directory>
</VirtualHost>

It definetly did work with apache-2.0.54-r9 maybe apache-2.0.54-r15 too, but 
with current apache-2.0.54-r15 it does 100% not work.

Since in /etc/apache2/modules.d/70_mod_php.conf you'll find

        <IfModule mod_mime.c>
                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-source .phps
        </IfModule>

RemoveType should work like it did in the past.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




# emerge info
Portage 2.0.51.22-r3 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.
11-hardened-r15 i686)
=================================================================
System uname: 2.6.11-hardened-r15 i686 Intel(R) Celeron(R) CPU 2.40GHz
Gentoo Base System version 1.6.13
ccache version 2.3 [disabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="x86 alsa apache2 arts avi bash-completion berkdb bitmap-fonts bzip2 crypt 
curl devfs26 eds emboss encode expat foomaticdb gd gdbm gif gstreamer hardened 
hardenedphp idn imagemagick imap imlib jpeg junit kde libg++ mbox memlimit mhash 
mmx mmx2 motif mp3 mpm-prefork ncurses nls noantlr nobcel nobeanutils nobsh 
nocommonslogging nocommonsnet nojdepend nojsch nojython nolog4j nooro nopop3d 
noregexp norhino noxerces ogg oggvorbis opengl oss pam pcre perl php png posix 
quicktime rtc sasl sdl sse sse2 ssl tcpd tiff truetype truetype-fonts type1 
type1-fonts udev vorbis xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY


# emerge -pv mod_php apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] dev-php/mod_php-4.4.0-r9  -X +apache2 +berkdb +crypt +curl -
debug -doc -fdftk -firebird -flash -freetds +gd -gd-external +gdbm -gmp 
+hardenedphp +imap -informix -ipv6 -java +jpeg -kerberos -ldap -mcal +memlimit -
mssql +mysql +nls -oci8 -odbc +pam +png -postgres -snmp -spell +ssl +tiff 
+truetype +xml2 -yaz 0 kB
[ebuild   R   ] net-www/apache-2.0.54-r31  +apache2 -debug -doc -ldap -mpm-
leader -mpm-peruser +mpm-prefork -mpm-threadpool -mpm-worker -no-suexec (-
selinux) +ssl -static-modules -threads 0 kB

Total size of downloads: 0 kB
Comment 1 Marcel Meckel 2005-11-12 02:24:09 UTC
Err, i ment

It definetly did work with apache-2.0.54-r9 maybe apache-2.0.54-r15 too, but 
with current apache-2.0.54-r31 it does 100% not work.
                            ^^
Comment 2 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-08-16 14:21:36 UTC
RemoveType take only an extension, not a mime-type, though that's not the full cause of this.

Your /etc/mime.types file is out of date (older ones have the php file types listed there and RemoveType has never removed associations from that file). Update apps-misc/mime-types and your problem should go away.

As an alternative, you can manually remove the php related lines from that file as well.