Forums

Create a New Blog - get a 404 page (5 posts)

  1. avjazelur
    Member
    Posted 1 month ago #

    Hi there -

    I've setup a very vanilla installation of wordpress_mu.

    I've taken the sub-folder approach.

    My "root" blog (the default created by the installation process) is displaying just fine at http://mydomain.com/.

    However, when I try to create a new blog at http://mydomain.com/mynewblog - the browser cannot find it.

    I have apache mod_rewrite enabled:

    root@domU-12-31-39-06-8D-81:~# ls -l /etc/apache2/mods-enabled/
    lrwxrwxrwx 1 root root 27 2009-09-29 17:29 php5.conf -> ../mods-available/php5.conf
    lrwxrwxrwx 1 root root 27 2009-09-29 17:29 php5.load -> ../mods-available/php5.load
    lrwxrwxrwx 1 root root 30 2009-09-29 17:49 rewrite.load -> ../mods-available/rewrite.load
    lrwxrwxrwx 1 root root 31 2009-09-29 17:29 setenvif.conf -> ../mods-available/setenvif.conf
    lrwxrwxrwx 1 root root 31 2009-09-29 17:29 setenvif.load -> ../mods-available/setenvif.load
    lrwxrwxrwx 1 root root 29 2009-09-29 17:29 status.conf -> ../mods-available/status.conf
    lrwxrwxrwx 1 root root 29 2009-09-29 17:29 status.load -> ../mods-available/status.load

    (for brevity not all results shown)

    The contents of my .htaccess file are here.

    root@domU-12-31-39-06-8D-81:~# cat /var/www/.htaccess
    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Does anyone have any ideas? I haven't changed the default apache config at all - apart from enabling mod_rewrite.

    Thanks -

  2. andrea_r
    Member
    Posted 1 month ago #

    "I haven't changed the default apache config at all"

    So it may not be actually *reading* the htaccess file. :)

    You need to AllowOverride FileInfo Options.

  3. avjazelur
    Member
    Posted 1 month ago #

    Thanks for the quick reply.

    I tried altering my /etc/apache2/apache2.conf file. It now contains the following:

    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
    
    AccessFileName .htaccess
    
    #
    # The following lines prevent .htaccess and .htpasswd files from being
    # viewed by Web clients.
    #
    #<Files ~ "^\.ht">
    #    Order allow,deny
    #    Deny from all
    #</Files>
    
    <Directory /var/www/>
       AllowOverride Options FileInfo
    </Directory>

    But still 404s at http://mydomain/mynewblog/

    The .htaccess file is present in the /var/www/ directory.

    root@domU-12-31-39-06-8D-81:~# ls -la /var/www/.htaccess
    -rw-r--r-- 1 www-data www-data 651 2009-09-30 00:48 /var/www/.htaccess

    and the owner of the file (www-data) is the same owner as the apache process:

    root@domU-12-31-39-06-8D-81:~# ps -ef | grep apache2
    root     13612     1  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13616 13612  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13617 13612  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13618 13612  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13619 13612  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13620 13612  0 21:05 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13621 13612  0 21:06 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13622 13612  0 21:06 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13623 13612  0 21:06 ?        00:00:00 /usr/sbin/apache2 -k start
    www-data 13624 13612  0 21:06 ?        00:00:00 /usr/sbin/apache2 -k start
    root     14061 14018  0 22:54 pts/0    00:00:00 grep apache2

    So I'm guessing I've mucked up the config file for apache. Can you give me anymore clues?

    Thanks -

  4. avjazelur
    Member
    Posted 1 month ago #

    Managed to figure this one out...

    With Ubuntu, the apache configuration files are spread over a number of directories. The file that must be changed is NOT /etc/apache2/apache2.conf, but /etc/apache2/sites-available/default. (Or at least it was in my case - if you're not using the default site it might be different).

    Look for a VirtualHost directive then change the "AllowOverride None" to "AllowOverride FileInfo Options" for the directory that the .htaccess file resides in.

    Hope that helps anyone who has the same problem as I did....

  5. andrea_r
    Member
    Posted 1 month ago #

    Yeah, different OS have different locations for that. Glad you found it & it worked. :)

Reply

You must log in to post.

About this Topic