title: VirtualHost is not working under Apache 2.4.6 on CentOS 7
body: <p>I'm trying to setup some VH in Apache 2.4.6 on CentOS 7 but without success since it's not working. This is what I've tried til now:</p>
  
  <ul>
  <li><p>Since in <code>/etc/httpd/conf/httpd.conf</code> is this line <code>Include conf.modules.d/*.conf</code> then I create a file under <code>/etc/httpd/conf.d/vhost.conf</code> and place this inside it:</p>
  
  <pre><code>NameVirtualHost *:80
  
  &lt;VirtualHost *:80&gt;
       ServerName webserver
       ServerAlias localhost devserver development
       DocumentRoot /var/www/html
  &lt;/VirtualHost&gt;
  </code></pre></li>
  <li><p>Reload/Restart Apache service (tried both): </p>
  
  <pre><code>service httpd reload|restart
  </code></pre></li>
  <li><p>At Windows side edit the file <code>C:\Windows\system32\drivers\etc\hosts</code> and add this line:</p>
  
  <pre><code>192.168.3.131  webserver localhost devserver development # this is the IP of Apache Server
  </code></pre></li>
  <li><p>Open the browser and tried: <code>http://webserver</code>, <code>http://devserver</code> and both goes to default Apache page so VH is not working.</p></li>
  <li><p>Place a file under <code>/var/www/html/index.php</code> with this lines <code>&lt;?php phpinfo(); ?&gt;</code> just to know which modules is Apache loading, this is the result:</p>
  
  <pre><code>core mod_so http_core mod_access_compat mod_actions mod_alias mod_allowmethods mod_auth_basic mod_auth_digest 
  mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authz_core 
  mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex 
  mod_cache mod_cache_disk mod_data mod_dbd mod_deflate mod_dir mod_dumpio mod_echo mod_env mod_expires mod_ext_filter 
  mod_filter mod_headers mod_include mod_info mod_log_config mod_logio mod_mime_magic mod_mime mod_negotiation 
  mod_remoteip mod_reqtimeout mod_rewrite mod_setenvif mod_slotmem_plain mod_slotmem_shm mod_socache_dbm 
  mod_socache_memcache mod_socache_shmcb mod_status mod_substitute mod_suexec mod_unique_id mod_unixd mod_userdir 
  mod_version mod_vhost_alias mod_dav mod_dav_fs mod_dav_lock mod_lua prefork mod_proxy mod_lbmethod_bybusyness 
  mod_lbmethod_byrequests mod_lbmethod_bytraffic mod_lbmethod_heartbeat mod_proxy_ajp mod_proxy_balancer mod_proxy_connect 
  mod_proxy_express mod_proxy_fcgi mod_proxy_fdpass mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_systemd mod_cgi mod_php5 
  </code></pre></li>
  </ul>
  
  <p>And apparently mod_vhost is loaded but is not working, did I miss something? Any help or advice around this? Maybe I forgot something but I read Apache docs and doesn't found something helpful</p>
  
  <p><strong>Update: test1</strong></p>
  
  <p>I made some changes to VH definition and now this is what I have:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot /var/www/html
      ServerName webserver
      #ServerAlias localhost devserver development
  
      &lt;Directory "/var/www/html"&gt;
          Options FollowSymLinks Includes ExecCGI
          AllowOverride All
          Allow from all
  
          #Require local
          #Require 192.168.3.0/16
          #Require 192.168.1.0/16
      &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>But I'm getting a <strong>403 Forbidden</strong></p>
  
  <blockquote>
    <p>Forbidden</p>
    
    <p>You don't have permission to access /index.php on this server. </p>
  </blockquote>
  
  <p>What is failing here?</p>