I have a web application installed in '/var' in a folder called 'myapp' in a CentOs 6 vps, and i have a sub-domain that points to the server IP, and i need that sub-domain to point to that '/var/myapp' folder. so I created a .conf file in '/etc/httpd/conf.d' folder with the virtual host declaration

<VirtualHost *:80>
        ServerName app.mydomain.com
        DocumentRoot "/var/myapp/"
        <Directory /var/myapp/>
                AllowOverride all
                Options Indexes FollowSymLinks ExecCGI
                AddHandler cgi-script .cgi .pl
                Order Deny,Allow
                Allow from all

But it still redirects me to the Apache welcome page, which should appear when there is nothing in 'www' folder.

  • Did you reload (or restart) Apache? – sebasth Apr 1 at 11:04
  • @sebasth Yes, i did. – Badr Apr 1 at 11:05
  • Do you have the NameVirtualHost *:80 that is still required in RHEL6's httpd 2.2? – Ulrich Schwarz Apr 1 at 11:23
  • @UlrichSchwarz Yes, it's the first line in my .conf file. – Badr Apr 1 at 11:25
  • Don't known how apache configured on CentOs, but sure you have to find default virtualhost what catches requests before your config. Search for ServerName * or it absence for another virtualhost. – LeonidMew Apr 1 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.