[debian] apache2-default redirect

Discussion in 'Installation/Configuration' started by Mountainman, May 18, 2006.

  1. Mountainman

    Mountainman New Member

    Hello everybody @ ISPConfig! :)

    First I would like to complement you for creating ISPConfig and giving such great support! Keep it going there! :D

    Now off to my problem, I first installed ISPConfig (2.2.1) following the Perfect Debian Setup written by Falko... Everything went well and worked fine!

    After a couple of weeks running the server smoothly, and upgrading to 2.2.2, I suddenly decided to remove the /root/ispconfig directory :eek: which I shouldn't have done offcourse... The server continued to run like nothing happened, but the ISPConfig web interface wasn't reachable. I decided to run the installer again and reinstall ISPConfig 'over' the old install.

    When I finished the install, all my sites weren't reachable anymore, logically while they weren't created in ISPConfig. Next I made a backup of my DB's and websites, uninstalled apache/bind/proftpd/spamassasin/mysql/quota/ISPConfig, and reinstalled everything according to the Perfect Debian Setup again. Now the ISPConfig is reachable through its normal adress, but every other site leads to the apache2-default page... Not what I want offcourse, and not what happened when I installed it the first time.

    I have seen that several users had the same problem but none of the topics led to a solution on my system. Could you help me getting my system back up again?

    Grtz and lots of thanks for your effort,

    Mountainman
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Is your old database back in place? Can you see the sites, users. etc. in ISPConfig?
     
  3. Mountainman

    Mountainman New Member

    Thanks for your reply Falko!

    No I can't see my old sites/clients/resellers...

    Before i installed ISPConfig the last time i deleted/removed every mysql/apache/proftpd/postfix file i could remove...

    grtz
     
  4. falko

    falko Super Moderator Howtoforge Staff

    But you replaced your new ISPConfig database with your old one? Then you should see your sites etc. in ISPConfig.
     
  5. Mountainman

    Mountainman New Member

    No but that's not the problem atm. Currently I want a fresh ISPConfig install, which after I installed ISPConfig, doesn't redirect me to the apache2-default page, but let's me see (like the old ISPConfig install) the shared ip page generated by ISPConfig.

    The problem is thus that every page redirects me to the apache2-default page and doesn't lead me to the page what i wanted to see.

    grz,
     
  6. falko

    falko Super Moderator Howtoforge Staff

    I'd replace your new ISPConfig database with your backup, then go into the ISPConfig interface. You should now see all your web sites there. Go into them and change a settings for them so that ISPConfig knows it has to rewrite the configurations. That should recreate your sites.
     
  7. Mountainman

    Mountainman New Member

    I hope we are talking about the same thing here Falko because I don't understand replacing my existing *clean* db with the old one will fix the problem i have on being redirected to the apache2-default page :confused:. I just want to have a clean ISPConfig install functioning like it did the first time I installed it...

    Problem:
    I am being redirected to the apache2-default page, visiting any site/non-existing site

    For example:
    I am the owner of domain.com, when i created sub.domain.com and I go visit this site in firefox, the apache2-default page pops up and not the standard index.html ISPConfig creates. When I visit a non-existing subdomain like dude.domain.com it also shows me the apache2-default page where I normally would see the shared-ip page ISPConfig has created.

    I hope my problem is clear to you now...

    best regards,

    Mountainman
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    If your sites wont show up in the ISPConfig interface, you must replace your existing DB with your backup copy like falko suggested.
     
  9. Mountainman

    Mountainman New Member

    Dear Falko and till,

    I completely reinstalled the system, formatted the hard-drive and did a fresh debian install following the 'Perfect Debian Setup' again. After the reinstall still every existing or non-existing url leads to the apache2-default page which you can see at: http://www.opje.nl, or for example a non-existing url like http://ispconfig.opje.nl. Offcourse this isn't normal and the according urls should lead you to the shared-ip page created by ISPConfig. How can I solve this problem?

    grz,

    Mountainman
     
  10. falko

    falko Super Moderator Howtoforge Staff

    You must create at least one web site in ISPConfig before the shared IP page is created.
     
  11. Mountainman

    Mountainman New Member

    Thanks again for your reply Falko!

    I created a site now but it still won't work, but! I have been looking in the ispconfig management pages and found out that bind wasn't running. It also wouldn't start after a restart command.

    In /var/log/syslog it says:

    Code:
    May 23 12:00:18 highmountain named[1497]: shutting down: flushing changes
    May 23 12:00:18 highmountain named[1497]: stopping command channel on 127.0.0.1#953
    May 23 12:00:18 highmountain named[1497]: stopping command channel on ::1#953
    May 23 12:00:18 highmountain named[1497]: no longer listening on 127.0.0.1#53
    May 23 12:00:18 highmountain named[1497]: no longer listening on 192.168.1.103#53
    May 23 12:00:18 highmountain named[1497]: exiting
    May 23 12:00:20 highmountain named[15931]: starting BIND 9.2.4 -u bind -t /var/lib/named
    May 23 12:00:20 highmountain named[15931]: using 1 CPU
    May 23 12:00:20 highmountain named[15931]: loading configuration from '/etc/bind/named.conf'
    May 23 12:00:20 highmountain named[15931]: /etc/bind/named.conf:28: zone '0.0.127.in-addr.arpa': already exists
    May 23 12:00:20 highmountain named[15931]: loading configuration: failure
    May 23 12:00:20 highmountain named[15931]: exiting (due to fatal error)
    
     
  12. falko

    falko Super Moderator Howtoforge Staff

    What's in /etc/bind/named.conf?
    What's in your Vhosts_ispconfig.conf now?
     
  13. Mountainman

    Mountainman New Member

    named.conf
    Code:
    options {
            pid-file "/var/run/bind/run/named.pid";
            directory "/etc/bind";
            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 "db.root";
    };
    
    zone "0.0.127.in-addr.arpa" {
            type master;
            file "db.local";
    };
    
    zone "0.0.127.in-addr.arpa" {
            type master;
            file "pri.0.0.127.in-addr.arpa";
    };
    
    
    zone "opje.nl" {
            type master;
            file "pri.opje.nl";
    };
    
    
    
    //// MAKE MANUAL ENTRIES BELOW THIS LINE! ////
    
    and /etc/apache2/vhosts/Vhosts_ispconfig.conf:
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 127.0.0.1:80
    <VirtualHost 127.0.0.1:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: chris.opje.nl:80
    ######################################
    #
    #
    <VirtualHost 127.0.0.1:80>
    SuexecUserGroup nobody web1
    ServerName chris.opje.nl:80
    ServerAdmin [email protected]
    DocumentRoot /var/www/web1/web
    ServerAlias opje.nl
    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
    ErrorLog /var/www/web1/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/web1/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/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Ok, the problem is that you specified 127.0.0.1 as IP address during ISPConfig installation instead of your other one...
     
  15. Mountainman

    Mountainman New Member

    Okay,

    then how can I fix this? And should I change this to my ip-adress given in my local network ( 192.168.x.x ) or my external ip-adress?
     
  16. falko

    falko Super Moderator Howtoforge Staff

    Use your 192.168.x.x address. Replace 127.0.0.1 in /root/ispconfig/httpd/conf/httpd.conf, /home/admispconfig/ispconfig/lib/config.inc.php and also in the ISPConfig database. Then restart ISPConfig:
    Code:
    /etc/init.d/ispconfig_server restart
    Afterwards you must change something in the ISP Manager and the DNS Manager so that ISPConfig knows it has to rewrite the configuration.
     
  17. ubuntuman

    ubuntuman New Member

    problems with apache2 web root directory

    Hi, sorry for my english, I have installed ubuntu breezy and ispconfig with perfect install ubuntu breezy, but when I try to navigate on some domain that I was created, all domains are redirected to apache2 web root directory, and not to the ispconfig webroot directory, I use the lan ip address 192.168.1.x for virtualhost and ispconfig installation and I have cable modem with dinamic ip address and use zoneedit with a script in cron to update my ipaddress.
    Help and Thankz

    Ubuntuman from Argentina.
     
  18. falko

    falko Super Moderator Howtoforge Staff

    What's in your Vhosts_ispconfig.conf?
     
  19. ubuntuman

    ubuntuman New Member

    hi falko, my Vhosts_ispconfig.conf

    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.1.2:80
    <VirtualHost 192.168.1.2:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.iguanita2k.com.ar:80
    ######################################
    #
    #
    <VirtualHost 192.168.1.2:80>
    ServerName www.iguanita2k.com.ar:80
    ServerAdmin [email protected]
    DocumentRoot /home/www/web3/web
    ServerAlias www.iguanita2k.com.ar ftp.iguanita2k.com.ar iguanita2k.com.ar
    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/ /home/www/web3/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web3/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/ "/home/www/web3/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 ^/~([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web3/user/$1/web/$3
    </VirtualHost>
    #
    #

    thanks
    ubuntuman
     
  20. ubuntuman

    ubuntuman New Member

    hi, I find an error with apache 2.0* when NamedVirtualHost 192.168.1.x:80
    the vhosts_ispconfig.conf redirected to apache2 DocumentRoot
    but, if NamedVirtualHost *:80 and <VirtualHost *:80> redirect to my web document root, I think that the problem is in the ip address that I configure
    in the installation and ispconfig configuration in control panel
    for now its go perfectly :D:D:D and sorry for my english..
    my solution was change Vhosts_ispconfig.conf
    NamedVirtualHost *:80
    <VirtualHost *:80>
    ........
    .........
    </VirtualHost>

    thanks from argentina
    Ubuntuman
     

Share This Page