tyring to set up wildcard subdomains for wordpress 3 on localhost in Ubuntu 11 and no idea how to go about debugging this. Wordpress and wildcards seem to be set up correctly. If I create /var/www/domain/test.domain then that subdomain works. The wordpress network settings are working on their end, with all the network options available and can create a new site. But when I create a new site in wordpress I get a 404 not found.

I set up dns according to this: http://ubuntuforums.org/archive/index.php/t-1719832.html the only difference is with the domain name. So my entry to /etc/dnsmasq.d/domain is address=/domain/ also I called the file 'domain' and not 'localhost'

Also /etc/resolv.conf:

# Generated by NetworkManager
domain home
search home


[error] [client] File does not exist: /var/www/domain/test.domain

Has anybody got any idea where to go to next? I'm out of ideas on how to go from here.


update, my vhosts conf:

    $ cat /etc/apache2/sites-available/domain.conf 

    VirtualDocumentRoot /var/www/domain/%0
    VirtualScriptAlias /var/www/domain/%0

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/domain/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
  • thats a problem with you apache config, not with you dns i think. Please provide the vhost configurations Aug 21 '11 at 1:24
  • @thomas , thanks for your help. i was unable to post it hear so added it as an edit to my original question
    – Daithí
    Aug 22 '11 at 7:07

Are you using wordpress multi-site? If so, you don't need the VirtualDocumentRoots. The wordpress files themselves will stay in one place.

If you really do need different wordpress installs with different DocumentRoots, then you'll have to create the directories ahead of time, which is what makes me think you just want multi-site (which is included in 3.x)

If you need to use NameVirtualHosts, just be sure to include something like:

ServerAlias *.domain.tld so requests for any subdomain go to this vhost.

  • yep I'm using wordpress multi site. I have changed my vhost.conf file to: <VirtualHost *:80> ServerName domain ServerAlias *.domain #added by daithi coombes to allow sub domains for wordpress network DocumentRoot /var/www/domain/ CustomLog /var/log/apache2/domain-access.log combined </VirtualHost> With this configuration all requests to 'domain' go to another virtual host I have on my machine! Also I have changed my hostname of my laptop to 'domain' so in my terminal it now says daithi@domain:~$
    – Daithí
    Aug 22 '11 at 15:08
  • gettting closer... that last redirect to the wrong domain was caused by one domain.conf having and the other having *:80, both now have *:80 as attribute to <VirtualHost>. The problem now is that vhosts go to the login page for PostFixAdmin and to make matters worse I can't find any config file for postfixadmin in /etc/apache2/conf.d/ Any ideas?
    – Daithí
    Aug 22 '11 at 15:45
  • found the config for postfixadmin, there was one in /etc/apache2/sites-available/. So that fixed it - issue was with apache conf.
    – Daithí
    Aug 22 '11 at 16:07
  • ... one last note, MU won't work on localhost with out a tld. So had to set up domain.loc instead of domain, but everything works now ;)
    – Daithí
    Aug 23 '11 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.