Subdomains and VirtualHost

So in setting up my two domains today in Apache2 I am trying to configure VirtualHosts to point two domains and two sub-domains to several WP blogs installed and running.

For example, www.zerosubspace.com is my primary domain, blog.zerosubspace.com goes to my main blog

www.tldranimu.net goes to my second blog on the same server, and saimoe.tldranimu.net will point to the third blog on the same server

Currently, three of the four work, all but saimoe.tldranimu.net. I have two entries in sites-enabled, default and tldranimu. I could not get blog.zerosubspace.com working in default, but when I enter it in httpd.conf it works. Repeating that process does not work for saimoe.tldranimu.net. Both are set up in DNS Manager properly, so my guess is I am missing the point in configuration files in Apache2.

Possible someone could point me in the right (or proper) direction? Thanks.

default

 <virtualhost *:80="">ServerAdmin webmaster@zerosubspace.com
        ServerName zerosubspace.com
        ServerAlias zerosubspace.com *.zerosubspace.com
        DocumentRoot /var/www
        <directory>Options FollowSymLinks
                AllowOverride None</directory> 
        <directory var="" www="">Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all</directory> 

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <directory "="" usr="" lib="" cgi-bin"="">AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all</directory> 

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <directory "="" usr="" share="" doc="">Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128</directory></virtualhost> 

tldranimu

 <virtualhost *:80="">ServerAdmin webmaster@zerosubspace.com
        ServerName tldranimu.net
        DocumentRoot /var/www/tldranimu
        <directory>Options FollowSymLinks
                AllowOverride None</directory> 
        <directory var="" www="">Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all</directory> 

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <directory "="" usr="" lib="" cgi-bin"="">AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all</directory> 

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <directory "="" usr="" share="" doc="">Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128</directory></virtualhost> 

 <virtualhost *:80="">ServerName saimoe.tldranimu.net
        DocumentRoot /var/www/tldrsaimoe</virtualhost> 

httpd.conf

 <virtualhost *:80="">ServerName blog.zerosubspace.com
        DocumentRoot /var/www/blog</virtualhost> 

 <virtualhost *:80="">ServerName saimoe.tldranimu.net
        DocumentRoot /var/www/tldrsaimoe</virtualhost> 

2 Replies

Apparently it was just the DNS falling behind, everything works now.

Incidentally though, should the subdomain VH's go in httpd.conf? I'm familiar with how things worked in Apache 1.1 but it seems like those should have worked in their respective site files in 2.

Delete vhosts from httpd.conf.

There are some Include in apache2.conf, one of them is:

# Include the virtual host configurations:
Include sites-enabled/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct