Cannot access local domain in same server

I have couple of websites setup on CentOS 5.3 in LAMP environment

All my websites working fine outside, but i cannot access any of the website in the same server.

For example, lets say i have a web site www.example1.com

if i go to server and try to download a page on web site using wget its fails, but everything working fine out side

following command timeout on same box
wget http://www.example1.com/file1.jpg


wget -dv http://www.example1.com/file1.jpg
Setting --verbose (verbose) to 1
DEBUG output created by Wget 1.11.4 Red Hat modified on linux-gnu.

--2010-01-08 12:20:13--  http://www.example1.com/file1.jpg
Resolving www.example1.com... 127.0.0.1
Caching www.example1.com => 127.0.0.1
Connecting to www.example1.com|127.0.0.1|:80...

My Apache hosts file look like this


127.0.0.1 localhost
127.0.0.1 example1.com
127.0.0.1 example2.com
127.0.0.1 example3.com

Apache virtual host configuration - httpd.conf


<VirtualHost *:80>
  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.php
  DocumentRoot /home/sdgsgsdfs/domains/www.example1.com/public
  ServerName  www.example1.com
  ErrorLog /home/sdgsgsdfs/domains/www.example1.com/logs/error_log
  CustomLog /home/sdgsgsdfs/domains/www.example1.com/logs/access_log common
</VirtualHost>

I think i am missing a simple configuration step, if any one can point me to right direction to resolve this problem will be great

Thanks

lphy,

It looks okay to me EXCEPT that the .com may cause a problem. I don’t use TLD’s in my localhost VirtualHost server aliases/names.

Regards,

DK

Hi dklynn, Thanks a lot for the prompt reply, sorry i didnt reply sooner. I been playing with the changes, still no luck

I am little confused about the thing you said about not to use .com in localhost and server aliases

I did remove .com and try, then it failed to load the website.

lphy,

I’m surprised at rereading your post that I would have answered that way with mine! I think that the problem is that there is a setting within Apache’s httpd.conf that will enable/disable the wget. I’m not sure what that is at the moment (clearing the sleep from my eyes) but will look for that later.

Regards,

DK