Virtual Hosts

Discussion in 'Server Operation' started by destinedjagold, Sep 18, 2012.

  1. destinedjagold

    destinedjagold New Member

    Good day everyone.

    I am trying to connect to CentOS Server from my Windows 7 PC.
    Both PCs are connected on the same LAN router.

    I can access the server both through its static IP and hostname.

    Here's my problem...
    The instant I type either the IP address or the hostname of the server, I want the server to throw me to a specific php page file.
    Initially, when I go to the server, it shows me Apache's homepage.

    I added a virtual host in the configuration file, pointing to the document root of the page I want to display, but it shows me a 404 Not Found page.

    Here's my Virtual Host.
    Code:
    <VirtualHost example.com>
      ServerName example.com
      ErrorLog /var/log/httpd/example-error.log
      CustomLog /var/log/httpd/example.log combined
      DocumentRoot /var/www/html/loc1/loc2/loc3/loc4
      <Directory "/var/www/html/loc1/loc2/loc3/loc4/login.php">
        Order allow,deny
        Allow from all
      </Directory>
    </VirtualHost>
    Here's the error log.
    Code:
    [Tue Sep 18 12:18:08 2012] [error] [client x.x.x.x] File does not exist: /var/www/html/loc1/loc2/loc3/loc4/loc1/loc2/loc3/loc4
    [Tue Sep 18 12:18:09 2012] [error] [client x.x.x.x] File does not exist: /var/www/html/loc1/loc2/loc3/loc4/favicon.ico
    I don't understand the first one, as to why it repeated locations 1 to 4...
    Also, what is favicon.ico's purpose?
    And oh, I didn't change anything in the httpd.conf file in /etc/httpd/conf directory, and my virtual host file is located in /etc/httpd/conf.d directory.

    Thankies~


    edit:

    I have reinstalled apache, and now I am having this problem.

    Code:
    PHP Warning:  Smarty error: unable to read resource: "/var/www/html/loc1/loc2/loc3/tmpl/templates/.tpl" in /var/www/html/loc1/loc2/loc3/module/Smarty/Smarty.class.php on line 1095
    I have no idea how to fix that one...
     
    Last edited: Sep 18, 2012
  2. topdog

    topdog Active Member

    Please check that that path exists and it is accessible to the webserver user.
     

Share This Page