Apache not reading virtualhost directory

Discussion in 'Apache' started by Anturaju93, Jan 29, 2012.

  1. #1
    Hello.
    I have a big problem with Apache
    This is my VirtualHost config
    <VirtualHost 46.214.131.224:80>
    DocumentRoot "/home/files/"
    ServerName files.abcdownload.ro
    <Directory "/home/files/">
    allow from all
    Options +Indexes
    </Directory>
    ScriptAlias /cgi-bin "/home/files/cgi-bin"
    </VirtualHost>
    
    Code (markup):
    But when i acces files.abcdownload.ro apache reads /var/www/html/ directory instead of /home/files
    Apache gives my 404 errors on existing files on server because of that.
    HEre are the error logs:
    
    [Sun Jan 29 13:43:47 2012] [error] [client 46.214.131.224] File does not exist: /var/www/html/public_html[Sun Jan 29 13:43:51 2012] [error] [client 46.214.131.224] Directory index forbidden by Options directive: /var/www/html/[Sun Jan 29 13:44:24 2012] [error] [client 46.214.131.224] File does not exist: /var/www/html/roedu-forum.png
    Code (markup):
    What to do next?
     
    Anturaju93, Jan 29, 2012 IP
  2. ideamine

    ideamine Member

    Messages:
    83
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    28
    #2
    Check your httpd.conf file if it has a line which starts with "Include" and if there is any file mentioned there .. then please make your entries there :)
     
    ideamine, Jan 30, 2012 IP
  3. Anturaju93

    Anturaju93 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don`t understand ... what include does to do with this? My VirtualHosts are correctly configured in httpd.conf
     
    Anturaju93, Jan 30, 2012 IP
  4. Smeey

    Smeey Well-Known Member

    Messages:
    377
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Please visit this link for more info about Virtual Hosts. Your directory should be "/home/username/files" but not "/home/files" and you should give permissions to the folder.
     
    Smeey, Jan 31, 2012 IP
  5. ideamine

    ideamine Member

    Messages:
    83
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    28
    #5
    ^ ^ DocumentRoot is the place where the webfiles are present. Its is not mandatory that directory should be "/home/username/files" if the web files are present in "/home/files" it will work from there as well.
     
    ideamine, Jan 31, 2012 IP
    Anturaju93 likes this.
  6. Anturaju93

    Anturaju93 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    A friend that knows linux very well solved my problem.
    The problem was NAT from my rooter, I was setting the external IP address in VirtualHosts with was confusing to apache, but when i set my network ip 192.168.1.120 in apache virtualhost (or just use all addresses *:80) its working fine in /home/user
    DMZ has the same problem, only works if internal IP is set to apache`s VirtualHost.
     
    Anturaju93, Feb 5, 2012 IP