Take the 2-minute tour ×

I've never had this problem before, but I'm sure it's something I'm doing wrong.

I just set up another virtual host on Debian with Apache, and I'm trying to get it directed to the MediaWiki installation, but whenever I try to pull up example.com it gives me example.com/defaultsite which gives me a 404. It should be directing me to example.com/index.php which does work if I put that in.

Here's what I put in for the conf file:

<VirtualHost *:80>
    DocumentRoot "/var/lib/mediawiki/"
    ServerName example.com
    # Uncomment this to add an alias.                                                                                                        
    # This does not work properly with virtual hosts..                                                                                       
    #Alias /mediawiki /var/lib/mediawiki                                                                                                     

    DirectoryIndex index.php

    RedirectMatch permanent / index.php                                                                                                      

    RewriteEngine On
    RewriteRule (.*) /var/lib/mediawiki/$1

    <Directory /var/lib/mediawiki/>
        Options +FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from all

    # some directories must be protected                                                                                                     
    <Directory /var/lib/mediawiki/config>
        Options -FollowSymLinks
        AllowOverride None
    <Directory /var/lib/mediawiki/upload>
        Options -FollowSymLinks
        AllowOverride None
share|improve this question
adding access_log entries would help, plus did you check for .htaccess files in /var/lib/mediawiki? –  fuero Jan 20 '13 at 23:17
There's no .htaccess file in that directory. access_log doesn't output anything when accessing the website, but error_log does, but it's just basically this: File does not exist: /var/lib/mediawiki/defaultsite. –  supercheetah Jan 21 '13 at 0:08
Short of using tcpdump and wireshark to figure out what exactly is happening here I'm out of ideas. Redirects (301/302) and File not found (404) usually show up in access_log. Perhaps you are accessing the wrong vhost somehow. apache2ctl -S will list all defined vhosts + hostname. –  fuero Jan 21 '13 at 0:18
Actually, you're right, I was looking at the wrong access log file. When I try to access / it gives me "GET /defaultsite HTTP/1.1" 404 507 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0" –  supercheetah Jan 21 '13 at 1:53
add comment

Your Answer



Browse other questions tagged or ask your own question.