Problems hosting 2 domains.

Discussion in 'Installation/Configuration' started by IzaKamakazi, Jan 13, 2010.

  1. IzaKamakazi

    IzaKamakazi New Member

    Hi guys, I mentioned this problem in another post which I have now abandoned due to resolving another issue there.

    My problem is tha I have installed Ubuntu 9.10 with Ispconfig 3 using the perfect server tutorial which was excellent!.

    I have 2 domains that I am trying to get working correctly. www.izabay.co.uk and www.lookylooky.co.uk. I used Ispconfig to set these up and are somewhat visible from the web.

    My problem is that although a default webpage has been installed into var/www/izabay.co.uk/web . when I enter either web address from a slave PC I get to what I believe to be var/www .

    If I enter the web addresses from the server PC, both addresses seem to point to var/www/izabay.co.uk/web as the test webpage is visible.

    Could someone please give me some advice as to where I have gone wrong.

    Many thanks in advance

    Kam.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Can you post the izabay.co.uk vhost configuration? What's the output of
    Code:
    ifconfig
    ?
     
  3. IzaKamakazi

    IzaKamakazi New Member

    Hi Falko, firstly thank you for taking the time to give me advice.

    The output from ifconfig is:

    Code:
    eth0      Link encap:Ethernet  HWaddr 00:1a:92:62:81:b4  
              inet addr:82.13.2.79  Bcast:82.13.2.255  Mask:255.255.255.0
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:28 Base address:0x2000 
    
    eth1      Link encap:Ethernet  HWaddr 00:1a:92:62:84:e7  
              inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: 2002:520d:24f:1234:21a:92ff:fe62:84e7/64 Scope:Global
              inet6 addr: fe80::21a:92ff:fe62:84e7/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:1431 errors:0 dropped:0 overruns:0 frame:0
              TX packets:1174 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:203832 (203.8 KB)  TX bytes:1062746 (1.0 MB)
              Interrupt:29 Base address:0x4000 
    
    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:2213 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2213 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:1135144 (1.1 MB)  TX bytes:1135144 (1.1 MB)

    Im not sure if this is the exact file you require but this is from etc/apache2/sites-enabled/izabay.co.uk.vhost

    Code:
    <Directory /var/www/izabay.co.uk>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    
    <VirtualHost 82.13.2.79:80>
          DocumentRoot /var/www/izabay.co.uk/web
      
        ServerName izabay.co.uk
        ServerAdmin [email protected]
    
        ErrorLog /var/log/ispconfig/httpd/izabay.co.uk/error.log
    
        ErrorDocument 400 /error/400.html
        ErrorDocument 401 /error/401.html
        ErrorDocument 403 /error/403.html
        ErrorDocument 404 /error/404.html
        ErrorDocument 405 /error/405.html
        ErrorDocument 500 /error/500.html
        ErrorDocument 503 /error/503.html
    	
        <Directory /var/www/izabay.co.uk/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
            
            # ssi enabled
            AddType text/html .shtml
            AddOutputFilter INCLUDES .shtml
            Options +Includes
        </Directory>
        <Directory /var/www/clients/client1/web13/web>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
            
            # ssi enabled
            AddType text/html .shtml
            AddOutputFilter INCLUDES .shtml
            Options +Includes
        </Directory>
    
        # cgi enabled
    	<Directory /var/www/clients/client1/web13/cgi-bin>
          Order allow,deny
          Allow from all
        </Directory>
        ScriptAlias  /cgi-bin/ /var/www/clients/client1/web13/cgi-bin/
        AddHandler cgi-script .cgi
        AddHandler cgi-script .pl
        # suexec enabled
        SuexecUserGroup web13 client1
        # php as fast-cgi enabled
        <Directory /var/www/izabay.co.uk/web>
            AddHandler fcgid-script .php .php3 .php4 .php5
            FCGIWrapper /var/www/php-fcgi-scripts/web13/.php-fcgi-starter .php
            Options +ExecCGI
            AllowOverride all
            Order allow,deny
            Allow from all
        </Directory>
    
    
    </VirtualHost>
    
    Hope I have given you the coorect information.

    Thanks again Kam.


    P.S. I noticed these in the var/log/apache2/error log


    [Thu Jan 14 16:50:37 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/clients/
    [Thu Jan 14 16:50:37 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/izabay.co.uk/
    [Thu Jan 14 16:50:37 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/php-fcgi-scripts/
    [Thu Jan 14 16:50:37 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/lookylooky.co.uk/
    [Thu Jan 14 16:50:37 2010] [error] [client 192.168.0.2] File does not exist: /var/www/favicon.ico
    [Thu Jan 14 17:07:29 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/clients/
    [Thu Jan 14 17:07:29 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/izabay.co.uk/
    [Thu Jan 14 17:07:29 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/php-fcgi-scripts/
    [Thu Jan 14 17:07:29 2010] [error] [client 192.168.0.2] client denied by server configuration: /var/www/lookylooky.co.uk/
    [Thu Jan 14 17:07:29 2010] [error] [client 192.168.0.2] File does not exist: /var/www/favicon.ico
    [Thu Jan 14 17:15:39 2010] [error] [client 192.168.0.2] File does not exist: /var/www/favicon.ico
     
    Last edited: Jan 14, 2010
  4. falko

    falko Super Moderator Howtoforge Staff

    Looks ok. What's the output of
    Code:
    ls -la /var/www/izabay.co.uk/web/
    ?
     
  5. IzaKamakazi

    IzaKamakazi New Member

    Hi Falko,

    Here is the output of your code:

    Code:
    kamakazi@server:~$ ls -la /var/www/izabay.co.uk/web/
    total 2404
    drwxr-xr-x 5 web13 client1    4096 2010-01-13 15:08 .
    drwxr-xr-x 6 root  root       4096 2010-01-13 14:39 ..
    drwxr-xr-x 2 web13 client1    4096 2010-01-13 14:39 error
    -rwxr-xr-- 1 web13 client1    1406 2010-01-13 14:39 favicon.ico
    -rw-r--r-- 1 root  root    2413009 2007-03-19 19:31 gamezone.psd
    -rwxr-xr-- 1 web13 client1       0 2010-01-13 14:39 .htaccess
    drwxr-xr-x 2 root  root       4096 2010-01-11 19:04 images
    -rw-r--r-- 1 root  root       5889 2007-03-19 19:24 index.htm
    -rwxr-xr-- 1 web13 client1      34 2010-01-13 14:39 robots.txt
    drwxr-xr-x 2 root  root       4096 2010-01-13 14:39 stats
    -rw-r--r-- 1 root  root       7026 2007-03-19 19:22 style.css
    kamakazi@server:~$
    Many thanks.

    Kam
     
  6. falko

    falko Super Moderator Howtoforge Staff

    What are the outputs of
    Code:
    ls -la /etc/apache2/sites-available
    ls -la /etc/apache2/sites-eenabled
    ?
     
  7. IzaKamakazi

    IzaKamakazi New Member

    Hi Again,

    Here is the code you requested:

    Code:
    kamakazi@server:~$ ls -la /etc/apache2/sites-available
    total 44
    drwxr-xr-x 2 root root 4096 2010-01-13 14:47 .
    drwxr-xr-x 7 root root 4096 2010-01-11 18:30 ..
    -rw-r--r-- 1 root root  948 2009-11-12 22:48 default
    -rw-r--r-- 1 root root 7364 2009-11-12 22:48 default-ssl
    -rw-r--r-- 1 root root 1020 2010-01-13 13:41 ispconfig.conf
    -rw-r--r-- 1 root root 1440 2010-01-13 14:47 ispconfig.vhost
    -rw-r--r-- 1 root root 1465 2010-01-13 14:36 ispconfig.vhost~
    -rw-r--r-- 1 root root 1834 2010-01-13 14:39 izabay.co.uk.vhost
    -rw-r--r-- 1 root root 1862 2010-01-13 14:41 lookylooky.co.uk.vhost
    -rw-r--r-- 1 root root 1857 2010-01-10 20:50 lookylooky.co.uk.vhost~
    kamakazi@server:~$ 
    
    And

    Code:
    kamakazi@server:~$ ls -la /etc/apache2/sites-enabled
    total 16
    drwxr-xr-x 2 root root 4096 2010-01-13 14:39 .
    drwxr-xr-x 7 root root 4096 2010-01-11 18:30 ..
    lrwxrwxrwx 1 root root   26 2010-01-10 17:51 000-default -> ../sites-available/default
    lrwxrwxrwx 1 root root   43 2010-01-10 18:19 000-ispconfig.conf -> /etc/apache2/sites-available/ispconfig.conf
    lrwxrwxrwx 1 root root   44 2010-01-10 18:19 000-ispconfig.vhost -> /etc/apache2/sites-available/ispconfig.vhost
    lrwxrwxrwx 1 root root   48 2010-01-13 14:39 izabay.co.uk.vhost -> /etc/apache2/sites-available//izabay.co.uk.vhost
    -rw-r--r-- 1 root root  114 2010-01-13 14:12 izabay.co.uk.vhost~
    lrwxrwxrwx 1 root root   52 2010-01-13 14:39 lookylooky.co.uk.vhost -> /etc/apache2/sites-available//lookylooky.co.uk.vhost
    -rw-r--r-- 1 root root  118 2010-01-13 14:12 lookylooky.co.uk.vhost~
    kamakazi@server:~$ 
    
    Thanks again Falko.

    Kam
     
  8. maxhdcse

    maxhdcse New Member

    Same problem, vanilla install of 3.0.1.6 on Ubuntu 8.04, on EC2

    I'm having strange behavior, on the first site, one page load it will display the default Welcome page, and on the next load it displays /var/www/. The second site will display the default Welcome page almost always.

    This is on EC2, with an Elastic IP. I configured the hostname to be the ec2-204-xxx-xxx-xxx.compute-1.amazonaws.com of the Elastic IP, which is supposed to utilize both the internal and external IP depending on the source of the request. I also used this value for configuration of ISPConfig.

    If I leave the IP unconfigured in ISPConfig so that a new site will use * by default the results are still mixed and undesirable.

    Hopefully this is limited to my misconfiguration - the values to use for this setup isnt entirely apparent to me using EC2 and this is my umpteenth variation in installing a cp on Ubuntu. :p One day it'll happen, hehe.

    Thanks for any input!
     
  9. IzaKamakazi

    IzaKamakazi New Member

    maxhdcse,

    Please do not hijack my post, if you have the same problem then please be patient and give Falko time to assist me in resolving my issue.

    If/when he does this and the solution does not help you then by all means ask for help.

    Thanks

    Kam
     
  10. falko

    falko Super Moderator Howtoforge Staff

    What happens when you comment out these lines at the beginning of /etc/apache2/sites-enabled/izabay.co.uk.vhost?

    Code:
    <Directory /var/www/izabay.co.uk>
        AllowOverride None
        Order Deny,Allow
        Deny from all
    </Directory>
    Don't forget to restart apache.
     
  11. IzaKamakazi

    IzaKamakazi New Member

    Hi Falko,

    If I comment out the lines as suggested I get an extra directory - izabay.co.uk.

    I can now reach my default page from this addrress:

    http://www.izabay.co.uk/izabay.co.uk/web/

    Hope that helps.

    Thanks
    Kam.
     
  12. falko

    falko Super Moderator Howtoforge Staff

    I can't access your site - I get this error: "The server at www.izabay.co.uk is taking too long to respond."
     
  13. IzaKamakazi

    IzaKamakazi New Member

    Sorry Falko, it was turned off as it is no use until it is working correctly.

    It is up and running now.

    Thanks Kam.
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Can you try this?
    Code:
    a2dissite default
    /etc/init.d/apache2 restart
     
  15. IzaKamakazi

    IzaKamakazi New Member

    Hi Again,

    Here is the results of the code:

    Code:
    kamakazi@server:~$ a2dissite default
    Could not remove /etc/apache2/sites-enabled/000-default: Permission denied
    kamakazi@server:~$ /etc/init.d/apache2 restart
     * Restarting web server apache2                                                Warning: DocumentRoot [/var/www/ispconfig/] does not exist
    Warning: DocumentRoot [/usr/local/ispconfig/interface/web/] does not exist
    [Tue Jan 19 18:52:36 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    Warning: DocumentRoot [/var/www/ispconfig/] does not exist
    Warning: DocumentRoot [/usr/local/ispconfig/interface/web/] does not exist
    [Tue Jan 19 18:52:36 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    (13)Permission denied: make_sock: could not bind to address [::]:80
    (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
                                                                             [fail]
    kamakazi@server:~$ sudo a2dissite default
    [sudo] password for kamakazi: 
    Site default disabled.
    Run '/etc/init.d/apache2 reload' to activate new configuration!
    kamakazi@server:~$ /etc/init.d/apache2 restart
     * Restarting web server apache2                                                Warning: DocumentRoot [/var/www/ispconfig/] does not exist
    Warning: DocumentRoot [/usr/local/ispconfig/interface/web/] does not exist
    [Tue Jan 19 18:53:20 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    [Tue Jan 19 18:53:20 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
    Warning: DocumentRoot [/var/www/ispconfig/] does not exist
    Warning: DocumentRoot [/usr/local/ispconfig/interface/web/] does not exist
    [Tue Jan 19 18:53:20 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    [Tue Jan 19 18:53:20 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
    (13)Permission denied: make_sock: could not bind to address [::]:80
    (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
                                                                             [fail]
    kamakazi@server:~$ 
    
    This is what I now get when trying to access the site:
    Code:
    Access forbidden!
    
    You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
    
    If you think this is a server error, please contact the webmaster.
    Error 403
    www.izabay.co.uk
    Tue Jan 19 19:07:41 2010
    Apache/2.2.12 (Ubuntu) 
    .

    I also tried un commenting the izabay.co.uk.vhost that we modified earlier in the thread but the results were the same.

    Many Thanks Kam.
     
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to run the commands that falko posted as root user.
     
  17. IzaKamakazi

    IzaKamakazi New Member

    Hi Till,

    Thanks for letting me know that it should have been from root, you may I have guessed I'm new to all this.

    Here is the code as root user:
    Code:
    kamakazi@server:~$ su
    Password: 
    root@server:/home/kamakazi# a2dissite default
    Site default already disabled
    root@server:/home/kamakazi# /etc/init.d/apache2 restart
     * Restarting web server apache2                                                [Wed Jan 20 18:01:18 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    [Wed Jan 20 18:01:18 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
     ... waiting .[Wed Jan 20 18:01:20 2010] [warn] NameVirtualHost 82.13.2.79:443 has no VirtualHosts
    [Wed Jan 20 18:01:20 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
                                                                             [ OK ]
    You have mail in /var/mail/root
    root@server:/home/kamakazi# 
    Thanks again guys, sorry this is taking so much of your time.

    Kam.
     
  18. IzaKamakazi

    IzaKamakazi New Member

    Any ideas guys?

    Thanks Kam
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The output above is ok. The default site was already disabled.
     

Share This Page