PDA

View Full Version : Problem with Vhosts (I think)


Scouser
27th November 2005, 20:40
Ok I have successfully installed ISPconfig & have a website (www.site1.com) running. I only have 1 IP address and use ZoneEdit (http://www.zoneedit.com) for my DNS. This is all fine but when I try to add another site (www.site2.com) to ISPconfig it just points to the first site in the vhosts_ispconfig.conf (www.site1.com). Any advice would be welcome as I don't seem to be able to find anything on these forums addressing this problem so I am assuming it's just me.

till
27th November 2005, 21:01
Have you added www.site2.com as new site or as Co-Domain? What do you mean with "just points to the first site in the vhosts_ispconfig.conf"? Please post the content of vhosts_ispconfig.conf here.

Scouser
28th November 2005, 20:59
Have you added www.site2.com as new site or as Co-Domain?
I have added www.site2.com as a new site.

What do you mean with "just points to the first site in the vhosts_ispconfig.conf"?
If I try to access www.site2.com through a browser the home page for www.site1.co.uk is displayed.

I have inserted both URLs into my hosts file on my windows machine and can access both that way but from another machine (outside my lan) all I can access is www.site1.co.uk

Please post the content of vhosts_ispconfig.conf here.
Done
###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.2.100:80
NameVirtualHost 192.168.2.102:80
#
#
######################################
# Vhost: www.site1.co.uk:80
######################################
#
#
<VirtualHost 192.168.2.100:80>
SuexecUserGroup web13_webmaster web13
ServerName www.site1.co.uk:80
ServerAdmin webmaster@site1.co.uk
DocumentRoot /var/www/web13/web
ServerAlias site1.co.uk
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
ScriptAlias /cgi-bin/ /var/www/web13/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web13/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/web13/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/web13/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web13/user/$1/web/$3
</VirtualHost>
#
#
#
######################################
# Vhost: www.site2.com:80
######################################
#
#
<VirtualHost 192.168.2.102:80>
SuexecUserGroup web12_webmaster web12
ServerName www.site2.com:80
ServerAdmin webmaster@site2.com
DocumentRoot /var/www/web12/web
ServerAlias site2.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
ScriptAlias /cgi-bin/ /var/www/web12/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web12/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/web12/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/web12/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web12/user/$1/web/$3
</VirtualHost>
#
#
#

till
28th November 2005, 21:51
Do you have a router with 2 external IP addresses where the ports are forwarded to your 2 internal IP addresses (192.168.2.100 + 192.168.2.102)?

Scouser
28th November 2005, 23:04
No, I only have one IP external address. 192.168.2.102 is an extra IP address mapped to eth0:0.

till
29th November 2005, 11:16
But the server has 2 IP addresses:

NameVirtualHost 192.168.2.100:80
NameVirtualHost 192.168.2.102:80

And the website on the IP: 192.168.2.100 works. So you must have two IP addresses on your server.

You posted above that you have problems with exeternal access. So you dont have an router and an external IP on that router?

falko
29th November 2005, 20:06
I think the problem is that you forward port 80 from your router to 192.168.2.100, but www.mysite2.com is on 192.168.2.102. That's why you always see your first site. It would be different if www.mysite2.com also ran on 192.168.0.100.

Scouser
29th November 2005, 21:14
I think the problem is that you forward port 80 from your router to 192.168.2.100, but www.mysite2.com is on 192.168.2.102. That's why you always see your first site. It would be different if www.mysite2.com also ran on 192.168.0.100.
Yes you are correct. The second IP address (102) was put in to try and alleviate the original problem. I have now changed it back to 192.168.2.100 and again www.site1.co.uk works but www.site2.com now displays:-
Index of /

Icon Name Last modified Size Description
[DIR] apache2-default/ 04-Oct-2005 07:40 -
[DIR] web12/ 29-Nov-2005 18:48 -
[DIR] web13/ 24-Nov-2005 18:44 -
[DIR] webalizer/ 04-Nov-2005 07:35 -
[DIR] www.site2.com/ 29-Nov-2005 18:48 -
[DIR] www.site1.co.uk/ 24-Nov-2005 18:44 -

Apache/2.0.54 (Ubuntu) PHP/4.4.0-3 mod_ssl/2.0.54 OpenSSL/0.9.7g Server at www.site2.com Port 80
Now I am back to square one & don't know where to go next.:confused:

falko
30th November 2005, 01:27
Do you maybe have www.site2.com somewhere in your main httpd.conf or in sites-enabled?