PDA

View Full Version : I cannot resolve www.example.com on the local machine


braakiss
9th January 2007, 10:13
Hi everyone,
Mi problem is that I cannot resolve www.example.com in my local machine where I have installed ispconfig ( It is a vmware virtual machine )

I have a domain and a subdomain:

www.example.com
sub1.example.com

When I put in firefox ( in the virtual machine where I have ispconfig ) either www.example.com or sub1.example.com it shows "Test for the Apache web server" instead of "welcome to www.example.com" or "welcome to sub1.example.com". If I do that in another machine it works properly, it shows "welcome to..."

What is the problem?

Thanks in advance

Fernando M.

till
9th January 2007, 11:23
Please check with e.g. ping that the domain resolves to the same IP on both machines.

braakiss
9th January 2007, 12:18
Hi Till,
If I do "ping www.example.com" on both machines it resolves 192.168.3.85, the same IP.

any idea?

falko
10th January 2007, 17:40
What's in /etc/hosts? What's the output of ifconfig? What's in Vhosts_ispconfig.conf?

braakiss
11th January 2007, 10:03
hi Falko,

/etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost
192.168.3.85 sub1.example.com sub1
192.168.3.85 sub2.example.com sub2
192.168.3.86 mail.example.com mail
192.168.3.85 www.example.com www
::1 sub1.example.com sub1 www.example.com www localhost.localdomain localhost

ifconfig output:

eth0 Link encap:Ethernet HWaddr 00:0C:29:DB:4C:6F
inet addr:192.168.3.85 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fedb:4c6f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:384 errors:0 dropped:0 overruns:0 frame:0
TX packets:235 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:352864 (344.5 KiB) TX bytes:20724 (20.2 KiB)
Base address:0x10d0 Memory:ec820000-ec840000

eth0:0 Link encap:Ethernet HWaddr 00:0C:29:DB:4C:6F
inet addr:192.168.3.86 Bcast:192.168.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x10d0 Memory:ec820000-ec840000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:660 (660.0 b) TX bytes:660 (660.0 b)

Vhosts_ispconfig.conf

###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.3.85:80
<VirtualHost 192.168.3.85:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: www.example.com:80
######################################
#
#
<VirtualHost 192.168.3.85:80>
ServerName www.example.com:80
ServerAdmin webmaster@example.com
DocumentRoot /var/www/web2/web
ServerAlias example.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ErrorLog /var/www/web2/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode Off
Alias /error/ "/var/www/web2/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^/(.*)$ http://www.example.com/subdominio/$1 [R]
</VirtualHost>
#
#
#
######################################
# Vhost: sub1.example.com:80
######################################
#
#
<VirtualHost 192.168.3.85:80>
ServerName sub1.example.com:80
ServerAdmin webmaster@example.com
DocumentRoot /var/www/web3/web
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ErrorLog /var/www/web3/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode Off
Alias /error/ "/var/www/web3/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web3/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web3/user/$1/web/$3
</VirtualHost>
#
#
#
######################################
# Vhost: sub2.example.com:80
######################################
#
#
<VirtualHost 192.168.3.85:80>
ServerName sub2.example.com:80
ServerAdmin webmaster@example.com
DocumentRoot /var/www/web5/web
ServerAlias sub2.example.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ErrorLog /var/www/web5/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web5/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web5/phptmp/
php_admin_value session.save_path /var/www/web5/phptmp/
Alias /error/ "/var/www/web5/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web5/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web5/user/$1/web/$3
</VirtualHost>
#
#
#


thanks again

falko
12th January 2007, 16:58
Can you change

::1 sub1.example.com sub1 www.example.com www localhost.localdomain localhost

to
::1 localhost.localdomain localhost
in /etc/hosts?