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 [email protected] 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!
You must select the correct IP address for the website. If your server is behind a router, you must use the internal IP address.
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 [email protected] 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>
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.
So, yes, I imagine it is behind a router. Is there a way to know for sure without having to ask my hosting service?
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
Is Vhosts_ispconfig.conf included at the end of your main Apache configuration (e.g. /etc/apache2/apache2.conf)?
Here's http -V: Code: Server version: Apache/2.0.55 Server built: Sep 27 2006 16:52:14 Server's Module Magic Number: 20020903:11 Architecture: 32-bit Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="" -D SUEXEC_BIN="/usr/lib/apache2/suexec2" -D DEFAULT_PIDLOG="/var/run/apache2.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="/var/run/apache2/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types" -D SERVER_CONFIG_FILE="/etc/apache2/apache2.conf" Here's the output of netstat -tap: Code: Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 209.40.195.6:domain *:* LISTEN 23789/named tcp 0 0 server1.sdellis.:domain *:* LISTEN 23789/named tcp 0 0 209.40.196.6:domain *:* LISTEN 23789/named tcp 0 0 highhearts.com:domain *:* LISTEN 23789/named tcp 0 0 highhearts.com:953 *:* LISTEN 23789/named tcp 0 0 *:smtp *:* LISTEN 27914/master tcp 0 0 *:mysql *:* LISTEN 27810/mysqld tcp 0 0 *:81 *:* LISTEN 27717/ispconfig_htt tcp6 0 0 *:ftp *:* LISTEN 5581/proftpd: (acce tcp6 0 0 *:ssh *:* LISTEN 19538/sshd tcp6 0 0 ip6-localhost:953 *:* LISTEN 23789/named tcp6 0 0 *:smtp *:* LISTEN 27914/master tcp6 0 0 *:https *:* LISTEN 27825/apache2 tcp6 0 0 *:imaps *:* LISTEN 5428/couriertcpd tcp6 0 0 *:pop3s *:* LISTEN 5339/couriertcpd tcp6 0 0 *:pop3 *:* LISTEN 5279/couriertcpd tcp6 0 0 *:imap2 *:* LISTEN 5376/couriertcpd tcp6 0 0 *:www *:* LISTEN 27825/apache2 tcp6 0 1392 server1.sdellis.com:ssh nat02-asb-ext.Rutg:6705 ESTABLISHED27862/sshd: foomanchu [ 209.40.195.6 and 209.40.196.6 were two other IPs I was given. Should I also expect to see 209.40.194.6 somewhere in the netstat output? Also, I just want to take a moment to thank you and "till" for helping me figure this out. You guys are awesome!
Here's /etc/hosts : Code: 127.0.0.1 highhearts.com highhearts localhost localhost.localdomain 209.40.194.6 server1.sdellis.com server1 # The following lines are desirable for IPv6 capable hosts # (added automatically by netbase upgrade) ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts Here's /etc/network/interfaces : Code: # This configuration file is auto-generated. # WARNING: Do not edit this file, otherwise your changes will be lost. # Please edit template /etc/network/interfaces.template instead. # Auto generated venet0 interfaces auto venet0 lo iface venet0 inet static address 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 up route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0 up route add default gw 191.255.255.1 iface lo inet loopback auto venet0:0 iface venet0:0 inet static address 209.40.196.6 netmask 255.255.255.255 broadcast 0.0.0.0 auto venet0:1 iface venet0:1 inet static address 209.40.194.6 netmask 255.255.255.255 broadcast 0.0.0.0 auto venet0:2 iface venet0:2 inet static address 209.40.195.6 netmask 255.255.255.255 broadcast 0.0.0.0
Please comment out these lines in /etc/hosts: Code: ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts and restart Apache. Does it work then? You might have to reboot the whole system.
But now I have another problem. I just tried to create two sites with different IP addresses from that used for virtual hosting. One of them (sdellis.com) is a test to ensure I can easily migrate the other site (modelhaus.com). The new sites require their own SSL certificate, so each will be the only site on their respective IPs. However, when I browse to sdellis.com, I get the "Shared IP" page. Here's my new Vhosts_ispconfig.conf 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> NameVirtualHost 209.40.195.6:80 <VirtualHost 209.40.195.6:80> ServerName localhost ServerAdmin root@localhost DocumentRoot /var/www/sharedip </VirtualHost> NameVirtualHost 209.40.196.6:80 <VirtualHost 209.40.196.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 [email protected] 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> # # # ###################################### # Vhost: www.modelhaus.com:80 ###################################### # # <VirtualHost 209.40.196.6:80> ServerName www.modelhaus.com:80 ServerAdmin [email protected] DocumentRoot /var/www/web11/web ServerAlias modelhaus.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/web11/cgi-bin/ AddHandler cgi-script .cgi AddHandler cgi-script .pl ErrorLog /var/www/web11/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/web11/ php_admin_value file_uploads 1 php_admin_value upload_tmp_dir /var/www/web11/phptmp/ php_admin_value session.save_path /var/www/web11/phptmp/ AddType text/html .shtml AddOutputFilter INCLUDES .shtml Alias /error/ "/var/www/web11/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/web11/user/$1/web/$3 AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web11/user/$1/web/$3 </VirtualHost> # <IfModule mod_ssl.c> <VirtualHost 209.40.196.6:443> ServerName www.modelhaus.com:443 ServerAdmin [email protected] DocumentRoot /var/www/web11/web ServerAlias modelhaus.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/web11/cgi-bin/ AddHandler cgi-script .cgi AddHandler cgi-script .pl ErrorLog /var/www/web11/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/web11/ php_admin_value file_uploads 1 php_admin_value upload_tmp_dir /var/www/web11/phptmp/ php_admin_value session.save_path /var/www/web11/phptmp/ AddType text/html .shtml AddOutputFilter INCLUDES .shtml SSLEngine on SSLCertificateFile /var/www/web11/ssl/www.modelhaus.com.crt SSLCertificateKeyFile /var/www/web11/ssl/www.modelhaus.com.key Alias /error/ "/var/www/web11/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/web11/user/$1/web/$3 AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web11/user/$1/web/$3 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 </VirtualHost> </IfModule> # # ###################################### # Vhost: www.sdellis.com:80 ###################################### # # <VirtualHost 209.40.195.6:80> ServerName www.sdellis.com:80 ServerAdmin [email protected] DocumentRoot /var/www/web10/web ServerAlias sdellis.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/web10/cgi-bin/ AddHandler cgi-script .cgi AddHandler cgi-script .pl ErrorLog /var/www/web10/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/web10/ php_admin_value file_uploads 1 php_admin_value upload_tmp_dir /var/www/web10/phptmp/ php_admin_value session.save_path /var/www/web10/phptmp/ AddType text/html .shtml AddOutputFilter INCLUDES .shtml Alias /error/ "/var/www/web10/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/web10/user/$1/web/$3 AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3 </VirtualHost> # <IfModule mod_ssl.c> <VirtualHost 209.40.195.6:443> ServerName www.sdellis.com:443 ServerAdmin [email protected] DocumentRoot /var/www/web10/web ServerAlias sdellis.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/web10/cgi-bin/ AddHandler cgi-script .cgi AddHandler cgi-script .pl ErrorLog /var/www/web10/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/web10/ php_admin_value file_uploads 1 php_admin_value upload_tmp_dir /var/www/web10/phptmp/ php_admin_value session.save_path /var/www/web10/phptmp/ AddType text/html .shtml AddOutputFilter INCLUDES .shtml SSLEngine on SSLCertificateFile /var/www/web10/ssl/www.sdellis.com.crt SSLCertificateKeyFile /var/www/web10/ssl/www.sdellis.com.key Alias /error/ "/var/www/web10/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/web10/user/$1/web/$3 AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web10/user/$1/web/$3 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 </VirtualHost> </IfModule> #
Have you created a SSL certificate for sdellis.com? Does sdellis.com has DNS A-Record pointing to the same IP address that you selected for the sdellis.com website?
I created the SSL certificate through ISPConfig, which generated a certificate and key here: /var/www/web10/ssl/www.sdellis.com.key /var/www/web10/ssl/www.sdellis.com.crt This would be a self-signed cert for testing purposes. Is there anything special I need to do outside of ISPConfig? As for the DNS A record... I'm not using ISPConfig to manage DNS at this point. I'm using my ISP's DNS service, and I did create an A record there with the same IP address I selected for sdellis.com in ISPConfig. One thing I should mention is that I'm using sdellis.com for my ISPConfig web interface also (through port 81). I know ISPConfig generates a SSL cert during install. Could there be a conflict there? Perhaps I should register another domain for this test?
The domain www.sdellis.com does not point to the shared IP page, it points to the document root of all sites (I guess /var/www). This happens normally whne the Vhost_ispconfig.conf file is not included in your apache configuration. Or is your server hsoted behind a router and 209.40.195.6 is the external IP address of the router?