Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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/127.0.0.1 also I called the file 'domain' and not 'localhost'

Also /etc/resolv.conf:

# Generated by NetworkManager
domain home
search home
nameserver 127.0.0.1
nameserver 192.168.1.1

/var/log/apache2/error.log:

[error] [client 127.0.0.1] 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.

cheers

update, my vhosts conf:

    $ cat /etc/apache2/sites-available/domain.conf 
<VirtualHost 127.0.0.1:80>

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

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/domain/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>
share|improve this question
    
thats a problem with you apache config, not with you dns i think. Please provide the vhost configurations –  Thomas Berger 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 –  Coombesy Aug 22 '11 at 7:07

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
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:~$ –  Coombesy Aug 22 '11 at 15:08
    
gettting closer... that last redirect to the wrong domain was caused by one domain.conf having 127.0.0.1:80 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? –  Coombesy 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. –  Coombesy 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 ;) –  Coombesy Aug 23 '11 at 6:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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