2

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>
Daithí
  • 1,333
  • 1
  • 11
  • 14

1 Answers1

0

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.

steve c c
  • 158
  • 5
  • yep I'm using wordpress multi site. I have changed my vhost.conf file to: ` 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 ` 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 127.0.0.1:80 and the other having *:80, both now have *:80 as attribute to . 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 06:09