Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Can't connect to domain properly |
|
Author |
|
bovcan
Joined: 15 Dec 2009 Posts: 19 Location: Slovenia
|
Posted: Tue 02 Feb '10 19:25 Post subject: Can't connect to domain properly |
|
|
Hi!
I setup server on CentOS 5.4 and Webmin at lan address 192.168.0.100(router).
I made to virtual host, one is localhost and other for domain.
Conf looks like that:
Code: | <VirtualHost www.domain:80>
DocumentRoot "/home/mydomain"
ServerName www.mydomian.info
<Directory "/home/mydomain">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost localhost:80>
DocumentRoot "/var/www/html"
ServerName localhost
<Directory "/var/www/html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
|
And, if I access localhost from CentOS it appears page of apache and if i go to my domain my page load up. Fine.
But If I try on other PC(192.168.0.101) and I go to URL of my domain I get page of Apache instead page of domain.
I use Zoneedit.com and I point that domain to my ext IP.
And I edit file /etc/hosts
Code: | # Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 www.mydomain.info
127.0.0.1 mydomain.info
127.0.0.1 localhost
|
Does anyone know what could be wrong? |
|
Back to top |
|
bovcan
Joined: 15 Dec 2009 Posts: 19 Location: Slovenia
|
Posted: Wed 03 Feb '10 12:56 Post subject: |
|
|
No idea? |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7407 Location: EU, Germany, Next to Hamburg
|
Posted: Wed 03 Feb '10 17:32 Post subject: |
|
|
Did you edit the hosts file on the second PC also?
if you make a ping on the second PC does it point to your external IP?
Your vhost setup should be a bit different
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/home/mydomain"
ServerName www.mydomian.info
<Directory "/home/mydomain">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName localhost
<Directory "/var/www/html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
|
|
|
Back to top |
|
bovcan
Joined: 15 Dec 2009 Posts: 19 Location: Slovenia
|
Posted: Wed 03 Feb '10 19:58 Post subject: |
|
|
He, I use your vhost setup and I remove
127.0.0.1 www.mydomain.info
127.0.0.1 mydomain.info
127.0.0.1 localhost
from hosts file on server, also on other PC is nothing there just that by default.
And it is working. My domain is accessible from other PC and from server PC, sure. |
|
Back to top |
|
|
|
|
|
|