...but it totally ignores the new configuration, going straight to /var/www in defiance of the new virtualhost whenever subname.servername.com is accessed. So I get the 'it works!' page, instead of someone's particular wordpress instance.
I can tell it's at least reading the configuration though, since adding the virtualhost somehow breaks apache's ability to follow symbolic links.
I tried lots and lots of things, including NameVirtualHost in various combinations.
The system is Ubuntu. I am trying to find the apache version.
If I add "NameVirtualHost *:80" to the top, apache2 will complain "NameVirtualHost *:80 has no VirtualHosts" in defiance of the default virtual host and however many virtual hosts I add.
As for hosts/DNS entry, whatevername.mywebsite.com already works, the site can tell what name you call it with. Except that virtual hosting does not work.
Does the exact same thing as described above, the exact same way as described above: Sites continue going to /var/www despite the virtualhost telling them to go somewhere else.
I even have the 'NameVirtualHost *:80 has no VirtualHosts' error despite having obvious virtualhosts, just like described above.
Adding 127.0.0.1 to /etc/hosts would be counterproductive since I want to access this site from the server's main address -- the server really does have a working domain name, and I am accessing it from the outside. I will attempt adding the real IP to /etc/hosts...
It is a home server, and not any sort of VPS.
[edit] Adding the IP to /etc/hosts made no difference.
[edit] Just for laughs, I tried 127.0.0.1 in /etc/hosts too. It didn't make any difference.
I am trying to get access to the domain name to verify it has the right settings.
Well it does not work unless I put sitetest.com, not just sitetest.
It still complains that NameVirtualHost *:80 has no virtualhosts, and nothing but my first vhost works, so I suspect I haven't gotten vhosting working -- just broken my default vhost, to force it to use mine instead.
I removed all NameVirtualHosts from my virtualhosts. There appears to be one in the /etc/apache2/ports.conf however. Should I edit it there?
[edit] Edited there. No difference.
Whenever I try to subdomain my site I get warnings like
[Mon Jan 20 10:46:38 2014] [warn] VirtualHost lmcmg.mysite.com:80 overlaps with VirtualHost mysite.com:80, the first has precedence, perhaps you need a NameVirtualHost directive
...but adding a NameVirtualHost does not help. Sometimes I can get it to stop printing the warning, but it still overrides everything, not just the URLs I wanted.
I have wordpress installed in /usr/share/wordpress, shared. I also have a few user-modifiable directories in /srv/www/wp-content/lmgmg.sitename.com/uploads and so forth.
I am hoping to be able to define mysite.com with a documentroot of /usr/share/wordpress, and alias /wp-content/uploads into the various /srv/www/wp-content/site/uploads directories individually. So far, I can't alias /wp-contents/uploads individually, only globally.
Every other apache configuration file has been left at ubuntu defaults.
When I start apache with this exact configuration I get these warnings:
# /etc/init.d/apache2 restart * Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Mon Jan 20 11:10:17 2014] [warn] VirtualHost lmcmg.mysite.com:80 overlaps with VirtualHost mysite.com:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Mon Jan 20 11:10:17 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Mon Jan 20 11:10:18 2014] [warn] VirtualHost lmcmg.mysite.com:80 overlaps with VirtualHost mysite.com:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Mon Jan 20 11:10:18 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
[ OK ]
#
I get /wp-content/uploads overrided for every subdomain inside mysite.com, not just lmcmg.
I did not read the entire thread, but normally with apache, each virtual host is defined in it's on file in the directory:
/etc/apache2/sites-available
Then you make a symlink to the file(s) in that directory from:
/etc/apache2/sites-enabled
When I read (maybe too quickly) though the thread, it seems you were trying to create a new virtual host with the configuration file of an existing virtual host. If that's not the case, I apologize; as I only quickly glanced over the thread.