Apache VHosts configuration ERR_CONNECTION_TIMED_OUT

apache-2.2subdomainvirtualhost

The problem

My Apache/2.2.15 doesn´t serve websites I want to acces via subdomains.
When hitting an URL, e.g. domain.tld or subdomain.domain.tld an error occurs ERR_CONNECTION_TIMED_OUT.

My file structure

In /var/www/html there are the folders

  • domain-production – contains index.html with test <h1></h1>
  • domain-staging – contains index.html with other test <h1></h1>
  • phpMyAdmin – contains a standard installation of that tool

What I did

Check httpd for listening on port 80

tcp   0   0   :::80   :::*   LISTEN   2227/httpd

In /etc/httpd/conf/httpd.conf
set document root to

DocumentRoot "/var/www/html"

Later on set directory to

<Directory "/var/www/html">

Finally set subdomains staging and phpmyadmin.

NameVirtualHost *:80

<VirtualHost *:80>
    ServerName domain.tld
    DocumentRoot /var/www/html/domain-production
</VirtualHost>

<VirtualHost *:80>
    ServerName staging.domain.tld
    DocumentRoot /var/www/html/domain-staging
</VirtualHost>

<VirtualHost *:80>
    ServerName phpmyadmin.domain.tld
    DocumentRoot /var/www/html/phpMyAdmin
</VirtualHost>

What am I missing? Thanks

Best Answer

Solution: The issue was I had to restart iptables. I have to say that I run iRedMail which wrote most of the firewall rules. So port 80 was accidentally blocked because of I have no idea ... although iptables state an ACCEPT.

Related Topic