I've set up DNS record to test out using virtual hosts prior to moving one of my wordpress installs out of a subdomain. I want to move from mysite.com/blog to blog.mysite.com.

I've tested the DNS resolution for blog.mysite.com with ping and I get a response with the correct public IP address.

Pinging blog.mysite.com [x.xxx.xx.xx] with 32 bytes of data:
Reply from x.xxx.xx.xx: bytes=32 time=52ms TTL=62
Reply from x.xxx.xx.xx: bytes=32 time=56ms TTL=62
Reply from x.xxx.xx.xx: bytes=32 time=54ms TTL=62
Reply from x.xxx.xx.xx: bytes=32 time=60ms TTL=62

Ping statistics for x.xxx.xx.xx:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 52ms, Maximum = 60ms, Average = 55ms

But trying to connect using Chrome I get:

Oops! Google Chrome could not connect to vhosts.youngbullindustries.com

And through telnet:

telnet blog.mysite.com 80
Connecting To blog.mysite.com...Could not open connection to
the host, on port 80: Connect failed

I've tried to tail /apache2/access.log but nothing shows up when I make a request (the level is set to debug). I was expecting to see something here but there's nothing at all. What could be going wrong and what should I try next to diagnose the problem?

Edited to add:

The server is running Raspbian, so Debian-style Apache 2.

vhosts file, /etc/apache2/sites-available/blog looks like:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName www.blog.mysite.com
        ServerAlias blog.mysite.com
    DocumentRoot /var/www/blog
    <Directory />
        Options FollowSymLinks
        AllowOverride All
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

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

    ErrorLog ${APACHE_LOG_DIR}/error.log

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

    CustomLog ${APACHE_LOG_DIR}/access.log combined

There's also an .htaccess file in /var/www/blog/.htaccess:

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /blog/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /blog/index.php [L] 

# END WordPress

1 Answer 1


How does your vhost configuration for the blog.mysite.com domain looks like?

It seems like apache isn't configured for the subdomain.

In what environment are you running your server in?


And Apache is starting up with this configuration without problems? Anything in the Apache error.log on startup?

There is no direcory-section for the blog directory - maybe adding the directory section helps.

[Update 2]

Are there more files located in the sites-enabled directory?

These files are loaded alphabetically - so maybe there is some directive in another file that stops the rendering of the logfiles?

[Update 3]

Dang - just saw it in your first post ... is the file linked in your sites-enabled directory? the sites-available directory isn't walked through by apache

[Update 4 - Chat Summary - Final Disclosure]

We figured out two problems in the chat.

The first one is the faulty .htaccess file: there was still a blog directory in the RewriteRule line which isn't right when using a subdomain

The second and even more fatal was a failing DNS configuration.

Both failures would've led to a similar error.

  • 1
    It's running on Raspbian, so Debian-style Apache 2 installation. Edited the question to include the vhost file.
    – Jamie Bull
    Commented Apr 30, 2014 at 12:18
  • Nothing that looks relevant in the error log on restart. [Wed Apr 30 13:21:23 2014] [notice] caught SIGTERM, shutting down [Wed Apr 30 13:21:25 2014] [notice] Apache/2.2.22 (Debian) PHP/5.4.4-14+deb7u8 configured -- resuming normal operations [Wed Apr 30 13:21:25 2014] [info] Server built: Feb 8 2014 17:44:20 I tried adding a directory section for the blog directory and no change.
    – Jamie Bull
    Commented Apr 30, 2014 at 13:22
  • once again a update
    – kkugelmann
    Commented Apr 30, 2014 at 13:29
  • Yes, there is: 000-default is also enabled - should I disable that?
    – Jamie Bull
    Commented Apr 30, 2014 at 13:34
  • Yes, it's linked. I've disabled 000-default and now error.log shows Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. - looks like progress of a kind. Though that is when navigating to mysite.com, not blog.mysite.com. That still has no response at all.
    – Jamie Bull
    Commented Apr 30, 2014 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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