Apache is loading the wrong dir?

  • MISC/A++
  • Expert
  • Expert
  • User avatar
  • Posts: 508
  • Loc: UnderGround

Post 3+ Months Ago

I had some people install a firewall on my server two days ago and they managed to mess up my server, everything was fixed except one!, every time i try to load any of my websites i get this:

index of /

awstats/

thats it!

I did check my /var/www/html and i found nothing, i found all the files in /var/www/vhosts

is the path is the problem? in my httpd.conf i have Directory set to /var/www/html, any one knows how to fix this problem?


Thanks in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I'm guessing the firewall needs to be instructed what to do with all the virtual hosts found in the sites-enabled directory, & that right now it's just routing everything to a default address for port 80 requests. :scratchhead:
  • MISC/A++
  • Expert
  • Expert
  • User avatar
  • Posts: 508
  • Loc: UnderGround

Post 3+ Months Ago

joebert wrote:
I'm guessing the firewall needs to be instructed what to do with all the virtual hosts found in the sites-enabled directory, & that right now it's just routing everything to a default address for port 80 requests. :scratchhead:


I am not sure how to fix that, can you guide me joebert?

Thanks.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I'm really not the one you want trying to guide you though this, I'm just shouting things out thinking maybe it will make somthing click for you.
  • MISC/A++
  • Expert
  • Expert
  • User avatar
  • Posts: 508
  • Loc: UnderGround

Post 3+ Months Ago

thanks joebert.

anyone else could help, let me explain a bit more.

i have on vhosts:

cysalsa.com
votasoft.com

if i change vhosts to html and refresh my browser i get the sites above listed as directories.

does this sound as an firewall problem or apache?
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

did something get messed up / replaced in your vhost.conf file?
my first inclination was something was modified with a config file, but i've never run vhosts >.<
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

You need to change your virtual hosts DocumentRoot directives to point to the proper directories.

If you're running virtual hosts, your global Directory directive doesn't affect those (or it shouldn't unless you have something misconfigured). At the end of your httpd.conf, you should have a VirtualHost directive for each virtual host that contains all of the settings required for that host. If you don't have this, you should have an include statement there that calls files that hold those configurations.

Here's an example VirtualHost directive (with awstats included) to help you sort things out:
Code: [ Select ]
<VirtualHost *:80>
    Alias /awstatsclasses "/path/to/my/awstats/wwwroot/classes/"
    Alias /awstatscss "/path/to/my/awstats/wwwroot/css/"
    Alias /awstatsicons "/path/to/my/awstats/wwwroot/icon/"
    ScriptAlias /awstats/ "/path/to/my/awstats/wwwroot/cgi-bin/"

    <Directory "/path/to/my/awstats/wwwroot">
        AuthUserFile /path/to/my/passes/.htstats
        AuthName "Awstats"
        AuthType Basic
        require valid-user
        Options ExecCGI
    </Directory>

    DocumentRoot "/path/to/my/www/html"
    ServerName www.mydomain.com

    ScriptAlias /cgi-bin/ /path/to/my/www/cgi-bin
    <Directory "/path/to/my/www/cgi-bin">
      Options ExecCGI +Includes
      Allow from all
    </Directory>
 
    <Directory "/path/to/my/www/html">
        DirectoryIndex index.php index.shtml index.html index.htm index.html.var
    Options MultiViews +Includes
    Allow from all
    </Directory>

    ErrorLog /path/to/my/www/logs/error.log
    CustomLog /path/to/my/www/logs/access.log combined

</VirtualHost>

<VirtualHost *:80>
 ServerName mydomain.com
 Redirect / http://www.mydomain.com/
</VirtualHost>
  1. <VirtualHost *:80>
  2.     Alias /awstatsclasses "/path/to/my/awstats/wwwroot/classes/"
  3.     Alias /awstatscss "/path/to/my/awstats/wwwroot/css/"
  4.     Alias /awstatsicons "/path/to/my/awstats/wwwroot/icon/"
  5.     ScriptAlias /awstats/ "/path/to/my/awstats/wwwroot/cgi-bin/"
  6.     <Directory "/path/to/my/awstats/wwwroot">
  7.         AuthUserFile /path/to/my/passes/.htstats
  8.         AuthName "Awstats"
  9.         AuthType Basic
  10.         require valid-user
  11.         Options ExecCGI
  12.     </Directory>
  13.     DocumentRoot "/path/to/my/www/html"
  14.     ServerName www.mydomain.com
  15.     ScriptAlias /cgi-bin/ /path/to/my/www/cgi-bin
  16.     <Directory "/path/to/my/www/cgi-bin">
  17.       Options ExecCGI +Includes
  18.       Allow from all
  19.     </Directory>
  20.  
  21.     <Directory "/path/to/my/www/html">
  22.         DirectoryIndex index.php index.shtml index.html index.htm index.html.var
  23.     Options MultiViews +Includes
  24.     Allow from all
  25.     </Directory>
  26.     ErrorLog /path/to/my/www/logs/error.log
  27.     CustomLog /path/to/my/www/logs/access.log combined
  28. </VirtualHost>
  29. <VirtualHost *:80>
  30.  ServerName mydomain.com
  31.  Redirect / http://www.mydomain.com/
  32. </VirtualHost>

Just change the values to match your domain, repeat for each domain, and you should be up and running after restarting apache.

Note that the second VirtualHost directive here is just a redirect that takes http://mydomain.com and redirects it to http://www.mydomain.com - you don't need this for subdomains (like subdomain.mydomain.com)
  • MISC/A++
  • Expert
  • Expert
  • User avatar
  • Posts: 508
  • Loc: UnderGround

Post 3+ Months Ago

Thanks guys i got it fixed :)

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 26 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.