title: Apache Virtual Host not working on Ubuntu 14.04 LTS
body: <p>I've been using <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts" rel="nofollow">this tutorial</a> to set up an Apache virtual host on my Ubuntu pc. I've created a <code>no-ip domain</code> which I will be using as the hostname of my virtual host. I've followed every step of the tutorial but it doesn't work. Here's the virtual host file and it's named <code>crm2plus.ddns.net.conf</code>:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
          # The ServerName directive sets the request scheme, hostname and port that
          # the server uses to identify itself. This is used when creating
          # redirection URLs. In the context of virtual hosts, the ServerName
          # specifies what hostname must appear in the request's Host: header to
          # match this virtual host. For the default virtual host (this file) this
          # value is not decisive as it is used as a last resort host regardless.
          # However, you must set it for any further virtual host explicitly.
          #ServerName www.example.com
  
          ServerAdmin webmaster@crm2plus.ddns.net
          ServerName  crm2plus.ddns.net
          ServerAlias crm2plus.ddns.net
          DocumentRoot /var/www/crm2plus.ddns.net/public_html
  
          # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
          # error, crit, alert, emerg.
          # It is also possible to configure the loglevel for particular
          # modules, e.g.
          #LogLevel info ssl:warn
  
          ErrorLog ${APACHE_LOG_DIR}/error.log
          CustomLog ${APACHE_LOG_DIR}/access.log combined
  
          # For most configuration files from conf-available/, which are
          # enabled or disabled at a global level, it is possible to
          # include a line for only one particular virtual host. For example the
          # following line enables the CGI configuration for this host only
          # after it has been globally disabled with "a2disconf".
          #Include conf-available/serve-cgi-bin.conf
  &lt;/VirtualHost&gt;
  &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
  &lt;/Directory&gt;
  &lt;Directory /var/www&gt;
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order Allow,Deny
      Allow from all
  &lt;/Directory&gt;
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  </code></pre>
  
  <p>I've also added the ip and domain name pair to my local hosts file and here's how it looks:</p>
  
  <pre><code>23.253.21.201   shhasan.ddns.net
  127.0.1.1       Ubuntu-Dev
  127.0.0.1       localhost
  99.250.71.177   crm2plus.ddns.net
  
  # The following lines are desirable for IPv6 capable hosts
  ::1     ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  </code></pre>
  
  <p>When I navigate to <code>crm2plus.ddns.net</code> through chrome I get the <code>web page not available page</code>. <code>shhasan.ddns.net</code> is working fine. When I type <code>ssh-keygen -H -F crm2plus.ddns.net</code> into the terminal nothing shows up but when I type <code>ssh-keygen -H -F shhasan.ddns.net</code> this is what shows up: </p>
  
  <pre><code># Host shhasan.ddns.net found: line 14 type RSA
  </code></pre>
  
  <p>followed by the RSA key.</p>
  
  <p>I've also looked at the Apache error and access logs. The error logs have a lot of repetition of such line of code: </p>
  
  <pre><code>[Fri Nov 14 17:44:50.304782 2014] [mpm_prefork:notice] [pid 21927] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
  [Fri Nov 14 17:44:50.304801 2014] [core:notice] [pid 21927] AH00094: Command line: '/usr/sbin/apache2'
  [Fri Nov 14 17:44:54.979832 2014] [mpm_prefork:notice] [pid 21927] AH00169: caught SIGTERM, shutting down
  </code></pre>
  
  <p>I searched for <code>caught SIGTERM, shutting down</code> and I found that this was part of normal operation. I have no idea of where I'm going wrong. It had worked previously for <code>shhasan.ddns.net</code> but it doesn't work for <code>crm2plus.ddns.net</code>. </p>
  
  <p>All help and suggestions are greatly appreciated.</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p><code>developer@Ubuntu-Dev:/etc/apache2$ ls
  apache2.conf   apache2.conf.dpkg-dist  conf-enabled  httpd.conf   magic           mods-enabled  ports.conf~      sites-enabled
  apache2.conf~  conf-available          envvars       httpd.conf~  mods-available  ports.conf    sites-available</code></p>
  
  <p><code>developer@Ubuntu-Dev:/etc/apache2/sites-available$ ls
  000-default.conf  000-default.conf~  000-default.conf.dpkg-dist  crm2plus.ddns.net.conf  crm2plus.ddns.net.conf~  default.save  default-ssl.conf  shhasan.ddns.net.conf</code></p>
  
  <p><code>developer@Ubuntu-Dev:/etc/apache2/sites-enabled$ ls
  crm2plus.ddns.net.conf  shhasan.ddns.net.conf</code></p>
  
  <p><code>apache2.conf</code> shortened version:</p>
  
  <pre><code>Include /etc/phpmyadmin/apache.conf
  ServerName localhost
  
  Mutex file:${APACHE_LOCK_DIR} default
  
  PidFile ${APACHE_PID_FILE}
  
  Timeout 300
  
  KeepAlive On
  
  MaxKeepAliveRequests 100
  
  KeepAliveTimeout 5
  
  User ${APACHE_RUN_USER}
  Group ${APACHE_RUN_GROUP}
  
  HostnameLookups Off
  
  ErrorLog ${APACHE_LOG_DIR}/error.log
  
  LogLevel warn
  
  IncludeOptional mods-enabled/*.load
  IncludeOptional mods-enabled/*.conf
  
  Include ports.conf
  
  &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
  #    Order deny,allow
  #    Deny from all
  &lt;/Directory&gt;
  
  &lt;Directory /usr/share&gt;
      AllowOverride None
      Require all granted
  &lt;/Directory&gt;
  
  &lt;Directory /var/www/&gt;
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
  &lt;/Directory&gt;
  
  #&lt;Directory /srv/&gt;
  #   Options Indexes FollowSymLinks
  #   AllowOverride None
  #   Require all granted
  #&lt;/Directory&gt;
  
  AccessFileName .htaccess
  
  &lt;FilesMatch "^\.ht"&gt;
      Require all denied
  &lt;/FilesMatch&gt;
  
  
  LogFormat "%v:%p %h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
  LogFormat "%h %l %u %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
  LogFormat "%h %l %u %t \"%r\" %&gt;s %O" common
  LogFormat "%{Referer}i -&gt; %U" referer
  LogFormat "%{User-agent}i" agent
  
  IncludeOptional conf-enabled/*.conf
  
  IncludeOptional sites-enabled/*.conf
  </code></pre>