Second Website

Discussion in 'Installation/Configuration' started by yahooadam, Jun 12, 2006.

Thread Status:
Not open for further replies.
  1. yahooadam

    yahooadam New Member

    Hey guys, ive been restleing with my website all night, and tbh im giving up on the lone wolf approach, so i could do with some help :)

    Heres le problem, I have 1 website ( http://yahooadam.yi.org ) set up on my webserver (Fedora core 5, isp config, according to the "perfect setup)
    I wanted to add a second site, but of course it doest work

    The settings of the 2 sites are almost indentical (change in name, domain name)

    however, http://n0clan.yi.org will not work, i was getting "this is a shared ip message" (im doing exactly the same as with http://yahooadam.yi.org here) and now, its resolving to http://www.n0clan.yi.org

    And finally, before the above 2 problems, even though i had uploaded the files into /var/www/web10/web i couldnt access them from the internet, it seemed to be looking somewhere else, and the FTP user was looking somewhere else too

    Any help on how to fix all the problems, id love you :)

    To sum up
    Problem 1:-
    http://n0clan.yi.org is being resolved as http://www.n0clan.yi.org

    Problem 2:-
    http://n0clan.yi.org is being seen as a "shared ip"

    Problem 3:-
    http://n0clan.yi.org is not looking in the correct folder (/var/www/web10/web)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ou used the wrong IP address for n0clan.yi.org.

    Are you in a NAT enviroment behind a router?

    Then the website n0clan.yi.org must have internal IP where you forwarded port 80 from your router to.
     
  3. erk

    erk New Member HowtoForge Supporter

    Problem 1:-

    When trying to access http://n0clan.yi.org you get a 301 Moved Pemanently.

    Code:
      
    HTTP/1.1 301 Moved Permanently
    Date: Mon, 12 Jun 2006 07:29:45 GMT
    Server: Apache/2.2.0 (Fedora)
    Location: [url]http://www.n0clan.yi.org/[/url]
    Content-Length: 311
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>301 Moved Permanently</title>
    </head><body>
    <h1>Moved Permanently</h1>
    <p>The document has moved <a href="http://www.n0clan.yi.org/">here</a>.</p>
    <hr>
    <address>Apache/2.2.0 (Fedora) Server at n0clan.yi.org Port 80</address>
    </body></html>
    

    www.n0clan.yi.org is not a registered address so this is of course not a good thing. Check your config. In the basic settings for the site the hostname should be n0clan and the domain yi.org.


    Problem 2:-
    http://n0clan.yi.org is being seen as a "shared ip"

    This is because n0clan.yi.org is not a virtual host in /etc/apache2/vhosts/Vhosts_ispconfig.conf. You will probably find www.n0clan.yi.org as a virtual host if you check Vhosts_ispconfig.conf.

    Problem 3:-
    http://n0clan.yi.org is not looking in the correct folder (/var/www/web10/web)

    Well, this is just the consequence of the missing virtual host.

    //Erk
     
  4. yahooadam

    yahooadam New Member

    i cant see the problem in vhosts, it all looks good to me, its identical to the yahooadam.yi.org one
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 172.161.1.6:80
    <VirtualHost 172.161.1.6:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    NameVirtualHost 172.161.1.6:80
    <VirtualHost 172.161.1.6:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.n0clan.yi.org:80
    ######################################
    #
    #
    <VirtualHost 172.161.1.6:80>
    ServerName www.n0clan.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web10/web
    ServerAlias n0clan.yi.org
    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>
    #
    #
    #
    ######################################
    # Vhost: www.yahooadam.yi.org:80
    ######################################
    #
    #
    <VirtualHost 172.161.1.6:80>
    ServerName www.yahooadam.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web4/web
    ServerAlias yahooadam.yi.org
    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/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web4/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/web4/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /var/www/web4/phptmp/
    php_admin_value session.save_path /var/www/web4/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/var/www/web4/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/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web4/user/$1/web/$3
    </VirtualHost>
    Edit
    Oh yeh, im running apache not apache2 it seems ....
     
    Last edited: Jun 12, 2006
  5. falko

    falko Super Moderator ISPConfig Developer

    Do you have Apache 1 and 2 installed at the same time?
     
  6. yahooadam

    yahooadam New Member

    i dont think so, i cant find apache 2 in /etc
     
  7. falko

    falko Super Moderator ISPConfig Developer

    Is Vhosts_ispconfig.conf included in your Apache configuration?
     
  8. erk

    erk New Member HowtoForge Supporter

    You are running Apache 2.2.0 as far as I can determine from the response from the server:
    Code:
    HTTP/1.1 301 Moved Permanently
    Date: Tue, 13 Jun 2006 09:10:47 GMT
    Server: Apache/2.2.0 (Fedora)
    Location: http://www.n0clan.yi.org/
    Content-Length: 311
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    
    On RedHat (and I guess the same applies to Fedora) you should look for configuration files in /etc/httpd/ and not in /etc/apache2/.

    Have you removed all co-domains and changed the basic settings for the site to
    Host: n0clan
    Domain: yi.org
    ?

    "301 Moved Permanently" is not a response you will normally get if you have not set it up with a rewrite rule or in a .htaccess file.
    If I connect with a terminal to n0clan.yi.org and enter the following:

    Code:
    GET /index.html HTTP/1.1
    Host: www.n0clan.yi.org
    
    
    I get the standard index.html from a newly created site in ISPConfig.
    If I enter
    Code:
    GET /index.html HTTP/1.1
    Host: n0clan.yi.org
    
    
    I get a "301 moved permanently".

    What I do not understand is where the 301 code comes from. ISPConfig issues 302 codes for all redirects as far as I can see on my own sites.

    Till: Does ISPC ever issue a 301 response code?

    //Erk
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig uses only these two rewriting rules:

    RewriteRule ^/(.*) http://www.yourdomain.com/targetdir/$1 [L,R]
    RewriteRule ^/(.*) http://www.yourdomain.com/targetdir/$1 [R]
     
  10. yahooadam

    yahooadam New Member

    ok then its apache 2 ;)
    the config files are located in /etc/httpd/conf
    the vhost files in /etc/httpd/conf/vhosts

    At the bottom of httpd.conf (in /etc/httpd/conf) it says "Include /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf"

    i deleted all co-domains, the only one in there now is yi.org (created automatically by the sites)

    however n0clan.yi.org is still being changed to www.n0clan.yi.org
    yahooadam.yi.org still works ok though ...

    Edit, some pics
    [​IMG]
    [​IMG]

    Edit 2
    If i try and start named, i get this
    [​IMG]
     
    Last edited: Jun 13, 2006
  11. falko

    falko Super Moderator ISPConfig Developer

    What's in Vhosts_ispconfig.conf now?

    What's in /etc/named.conf?
     
  12. yahooadam

    yahooadam New Member

    ive edited named conf - to make named now start, in the hopes ispconfig would update it ... i dont know if it has or not (updated, its now running)

    Vhosts_ispconfig.conf
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 172.161.1.6:80
    <VirtualHost 172.161.1.6:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    NameVirtualHost 172.161.1.6:80
    <VirtualHost 172.161.1.6:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: n0clan.yi.org:80
    ######################################
    #
    #
    <VirtualHost 172.161.1.6:80>
    ServerName n0clan.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web10/web
    ServerAlias n0clan.yi.org
    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>
    #
    #
    #
    ######################################
    # Vhost: yahooadam.yi.org:80
    ######################################
    #
    #
    <VirtualHost 172.161.1.6:80>
    ServerName yahooadam.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web4/web
    ServerAlias yahooadam.yi.org
    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/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web4/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/web4/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /var/www/web4/phptmp/
    php_admin_value session.save_path /var/www/web4/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/var/www/web4/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/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web4/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    named.conf
    Code:
    options {
            pid-file "/var/named/chroot/var/run/named/named.pid";
            directory "/var/named/chroot/var/named";
            auth-nxdomain no;
            /*
             * If there is a firewall between you and nameservers you want
             * to talk to, you might need to uncomment the query-source
             * directive below.  Previous versions of BIND always asked
             * questions using port 53, but BIND 8.1 uses an unprivileged
             * port by default.
             */
            // query-source address * port 53;
    };
    
    //
    // a caching only nameserver config
    //
    zone "." {
            type hint;
            file "named.ca";
    };
    
    zone "0.0.127.in-addr.arpa" {
            type master;
            file "named.local";
    };
    
    //// MAKE MANUAL ENTRIES BELOW THIS LINE! ////
     
  13. falko

    falko Super Moderator ISPConfig Developer

    Why do you have

    Code:
    NameVirtualHost 172.161.1.6:80
    <VirtualHost 172.161.1.6:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    twice in Vhosts_ispconfig.conf?
     
  14. yahooadam

    yahooadam New Member

    i have no idea tbh, thats just what it put in it

    However, today i changed my modem and router, so alot of my network has changed, anyway long story short, if you look at the website now http://yahooadam.yi.org and http://n0clan.yi.org both give the same apache page
    Why isnt ispconfig sorting the 2 out ?

    Edit
    Vhosts_ispconfig.conf
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.1.10:80
    <VirtualHost 192.168.1.10:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    NameVirtualHost 192.168.1.10:80
    <VirtualHost 192.168.1.10:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: n0clan.yi.org:80
    ######################################
    #
    #
    <VirtualHost 192.168.1.10:80>
    ServerName n0clan.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web10/web
    ServerAlias n0clan.yi.org
    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>
    #
    #
    #
    ######################################
    # Vhost: yahooadam.yi.org:80
    ######################################
    #
    #
    <VirtualHost 192.168.1.10:80>
    ServerName yahooadam.yi.org:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web4/web
    ServerAlias yahooadam.yi.org
    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/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /var/www/web4/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/web4/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /var/www/web4/phptmp/
    php_admin_value session.save_path /var/www/web4/phptmp/
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/var/www/web4/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/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web4/user/$1/web/$3
    </VirtualHost>
    #
    #
    Im not sure if named is working properly - is there a way to rebuild its configuration files ?
     
    Last edited: Jun 15, 2006
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    The configuration is correct. What page do you get, the page from http://yahooadam.yi.org or http://n0clan.yi.org ?

    This has nothing to do with your named, as the named is not authoritive for yi.org.
     
  16. yahooadam

    yahooadam New Member

    i dont know where the page is comming from - it doesnt make sense to me, both folders (web4 and web10) have custom index.php files, and no index.html file
    So how would i find out where those pages are coming from on the server ?
     
  17. falko

    falko Super Moderator ISPConfig Developer

  18. yahooadam

    yahooadam New Member

    Yeh thats what i originally did ... i dont know whats happened since

    Edit
    Oh btw there is nothing in the folder /var/www/html ....
     
  19. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    ls -la /var/www/html
    ?
     
  20. yahooadam

    yahooadam New Member

    Code:
    [root@localhost ~]# ls -la /var/www/html
    total 16
    drwxr-xr-x  2 root root 4096 Feb 11 23:12 .
    drwxr-xr-x 22 root root 4096 Jun 15 00:30 ..
    
     
Thread Status:
Not open for further replies.

Share This Page