HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Virtual Hosting Not Working (http://www.howtoforge.com/forums/showthread.php?t=13393)

stirfry 13th June 2007 17:33

Virtual Hosting Not Working
 
I have created a site in ISPConfig but the site resolves to the web root rather than the document root specified in the "Vhosts_ispconfig.conf" file as shown here:

Code:

NameVirtualHost 000.00.000.0:80
<VirtualHost 000.00.000.0:80>
  ServerName localhost
  ServerAdmin root@localhost
  DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: www.mysite.com:80
######################################
#
#
<VirtualHost 000.00.000.0:80>
ServerName www.mysite.com:80
ServerAdmin webmaster@mysite.com
DocumentRoot /var/www/web6/web
ServerAlias mysite.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
##### [shortened to save space]##########
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
</VirtualHost>

So, basically, I can see the directory ISPConfig created for my site when I got to http://www.mysite.com. What am I doing wrong? Any help is appreciated!

till 13th June 2007 18:24

You must select the correct IP address for the website. If your server is behind a router, you must use the internal IP address.

stirfry 13th June 2007 18:46

I actually had specified the IP, but just used zeros for the IP and "mysite.com" to make it generic for my forum post. Probably a bad idea. Here's my actual vHost Config File:

Code:

###################################
#
# ISPConfig vHost Configuration File
#        Version 1.0
#
###################################
#
NameVirtualHost 209.40.194.6:80
<VirtualHost 209.40.194.6:80>
  ServerName localhost
  ServerAdmin root@localhost
  DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: www.aylingreen.com:80
######################################
#
#
<VirtualHost 209.40.194.6:80>
ServerName www.aylingreen.com:80
ServerAdmin webmaster@aylingreen.com
DocumentRoot /var/www/web6/web
ServerAlias aylingreen.com work.aylingreen.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/web6/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web6/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/web6/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web6/phptmp/
php_admin_value session.save_path /var/www/web6/phptmp/
Alias /error/ "/var/www/web6/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/web6/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web6/user/$1/web/$3
</VirtualHost>


till 13th June 2007 18:58

And this server is not behind a router?

stirfry 13th June 2007 20:05

That's the public IP I was given by my Virtual Private Server hosting service. I'm not sure how they have their network set up.

stirfry 14th June 2007 02:17

So, yes, I imagine it is behind a router. Is there a way to know for sure without having to ask my hosting service?

till 14th June 2007 10:24

Please run the command: ifconfig

Is the IP address listed in the ifconfig output "209.40.194.6"?

stirfry 14th June 2007 13:59

Yes.

Code:

venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:209.40.194.6  P-t-P:209.40.194.6  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1


falko 14th June 2007 21:46

Is Vhosts_ispconfig.conf included at the end of your main Apache configuration (e.g. /etc/apache2/apache2.conf)?

stirfry 14th June 2007 22:07

Yes, it is.

Code:

Include /etc/apache2/vhosts/Vhosts_ispconfig.conf


All times are GMT +2. The time now is 11:22.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.