PDA

View Full Version : [debian] apache2-default redirect


Mountainman
18th May 2006, 16:55
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

falko
18th May 2006, 20:08
Is your old database back in place? Can you see the sites, users. etc. in ISPConfig?

Mountainman
18th May 2006, 20:50
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

falko
18th May 2006, 21:28
But you replaced your new ISPConfig database with your old one? Then you should see your sites etc. in ISPConfig.

Mountainman
19th May 2006, 13:28
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,

falko
19th May 2006, 15:37
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.

Mountainman
19th May 2006, 20:47
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

till
20th May 2006, 12:37
If your sites wont show up in the ISPConfig interface, you must replace your existing DB with your backup copy like falko suggested.

Mountainman
22nd May 2006, 23:43
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

falko
23rd May 2006, 00:56
You must create at least one web site in ISPConfig before the shared IP page is created.

Mountainman
23rd May 2006, 13:11
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:


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)

falko
23rd May 2006, 20:06
What's in /etc/bind/named.conf?
What's in your Vhosts_ispconfig.conf now?

Mountainman
23rd May 2006, 20:19
named.conf
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:

###################################
#
# 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 webmaster@opje.nl
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>
#
#
#

falko
24th May 2006, 14:11
Ok, the problem is that you specified 127.0.0.1 as IP address during ISPConfig installation instead of your other one...

Mountainman
24th May 2006, 17:48
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?

falko
24th May 2006, 18:59
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:
/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.

ubuntuman
25th May 2006, 23:39
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.

falko
26th May 2006, 02:37
What's in your Vhosts_ispconfig.conf?

ubuntuman
26th May 2006, 03:17
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 webmaster@iguanita2k.com.ar
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

ubuntuman
26th May 2006, 03:31
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

ubuntuman
26th May 2006, 08:55
Hi, I found the solution for my problem, when somebody used dinamic ip address, the installation of ispconfig with lan ip address like perfect setup, is ok, but, in the ispconfig ControlPanel I change the lan ip addres for * and I deleted the extern ip address, and in the apache2.conf I found a line that says include /etc/apache2/sites-enabled and comment with #, now, the ispconfig go OK for me, if I make a mistake please tell me, but is the way that I found...

Thanks from argentina
Ubuntuman

falko
26th May 2006, 17:13
If it's working then it's ok. :)

Mountainman
29th May 2006, 13:05
Superb!

I did the things you said Falko and it works now :D !

tnx for all your help and greetz from Holland!

Mountainman

falko
29th May 2006, 16:45
tnx for all your help and greetz from Holland!

Mountainman
Mountainman is a nice name for someone from Holland... ;)

Mountainman
5th June 2006, 14:40
LoL

k tnx,

:D