[php-maint] Bug#601602: libapache2-mod-php5: php in userdir broken (even with conf comment) - wordpress broken

Mark Hedges hedges at scriptdolphin.org
Wed Oct 27 18:25:02 UTC 2010


Package: libapache2-mod-php5
Version: 5.3.2-2
Severity: normal


I just upgraded my server from Lenny to Squeeze.  I had been using
wordpress from Squeeze before with everything else from Lenny, and
that was working in a userdir.  Now wordpress does not work in the
userdir, but it still works fine in a normal site.

I followed the instructions in mods-available/php5.conf to comment
out the lines that turn it off in userdir directories, but no luck.

Below are the working and the non-working config.  (They both use 
symlinks to link the directory 'blog' to /usr/share/wordpress.)

I also tried adding 'AddType application/x-httpd-php .php .phtml .php3'
but that didn't help.

In the userdir, it downloads the text of /usr/share/wordpress/index.php.

WORKING:

 <Virtualhost ....>
 # ...
    <Directory /var/www/domainsite/html>
        Options FollowSymLinks Indexes MultiViews Includes IncludesNOEXEC
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.html index.php
        Order allow,deny
        allow from all

        # rewrite wp-uploads to a directory in homedir
        RewriteEngine On
        RewriteRule ^(.*?)blog/wp-uploads/(.*)$ /var/www/domainsite/wp-uploads/$2 [PT]

        RewriteBase /blog/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /blog/index.php [L]
    </Directory>
 # ... works fine in a regular virtualhost
 </VirtualHost>

NOT WORKING:

<IfModule mod_userdir.c>
    UserDir public_html
    UserDir disabled root
    UserDir disabled
    UserDir enabled thisuser
</IfModule>


#
<VirtualHost 1.2.3.4:80>
    ServerAdmin me at mydomain.com
    ServerName userdir_domain.com
    ServerAlias www.userdir_domain.com
    
    DocumentRoot /var/www/userdir_domain
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/userdir_domain/>
        Options Indexes MultiViews Includes IncludesNOEXEC
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/userdir_domain/
    <Directory "/usr/lib/cgi-bin/userdir_domain">
        AllowOverride None
        Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

    Alias /yui/ "/usr/share/yui/html/"
    <Directory "/usr/share/yui/html/">
        Options None
        AllowOverride None
    </Directory>

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
      # Order deny,allow
      # Deny from all
      # Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

  # <Files *.cgi>
  #     SetHandler cgi-script
  # </Files>

    <Directory /home/thisuser/public_html> 
      # AllowOverride FileInfo AuthConfig Limit Indexes
      # Options Indexes +ExecCGI MultiViews Includes SymLinksIfOwnerMatch
        AllowOverride FileInfo AuthConfig Limit Indexes
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec FollowSymLinks +Includes

        # these were the only options/overrides before and they worked fine:
        #Options FollowSymLinks
        #AllowOverride Limit Options FileInfo

        DirectoryIndex index.php index.html
        Order allow,deny
        Allow from all

        # rewrite wp-uploads to a directory in homedir
        RewriteEngine On
        RewriteRule ^(.*?)blog/wp-uploads/(.*)$ /~thisuser/wp-uploads/$2 [PT]

        RewriteBase /~thisuser/blog/
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /~thisuser/blog/index.php [L,PT]
    </Directory>

</VirtualHost>



-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.16-linode28 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libapache2-mod-php5 depends on:
ii  apache2-mpm-prefork    2.2.16-3          Apache HTTP Server - traditional n
ii  apache2.2-common       2.2.16-3          Apache HTTP Server common files
ii  libbz2-1.0             1.0.5-6           high-quality block-sorting file co
ii  libc6                  2.11.2-6+squeeze1 Embedded GNU C Library: Shared lib
ii  libcomerr2             1.41.12-2         common error description library
ii  libdb4.8               4.8.30-2          Berkeley v4.8 Database Libraries [
ii  libgssapi-krb5-2       1.8.3+dfsg-2      MIT Kerberos runtime libraries - k
ii  libk5crypto3           1.8.3+dfsg-2      MIT Kerberos runtime libraries - C
ii  libkrb5-3              1.8.3+dfsg-2      MIT Kerberos runtime libraries
ii  libmagic1              5.04-5            File type determination library us
ii  libonig2               5.9.1-1           Oniguruma regular expressions libr
ii  libpcre3               8.02-1.1          Perl 5 Compatible Regular Expressi
ii  libqdbm14              1.8.77-3.1        QDBM Database Libraries [runtime]
ii  libssl0.9.8            0.9.8o-2          SSL shared libraries
ii  libxml2                2.7.7.dfsg-4      GNOME XML library
ii  mime-support           3.48-1            MIME files 'mime.types' & 'mailcap
ii  php5-common            5.3.2-2           Common files for packages built fr
ii  tzdata                 2010l-1           time zone and daylight-saving time
ii  ucf                    3.0025+nmu1       Update Configuration File: preserv
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

Versions of packages libapache2-mod-php5 recommends:
ii  php5-cli                      5.3.2-2    command-line interpreter for the p

Versions of packages libapache2-mod-php5 suggests:
pn  php-pear                      <none>     (no description available)

-- Configuration Files:
/etc/apache2/mods-available/php5.conf changed:
<IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
	SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
	SetHandler application/x-httpd-php-source
    </FilesMatch>
    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
  # <IfModule mod_userdir.c>
  #     <Directory /home/*/public_html>
  #         php_admin_value engine Off
  #     </Directory>
  # </IfModule>
</IfModule>


-- no debconf information





More information about the pkg-php-maint mailing list