Virtual hosts redirect to /admin

Got problems with your B2 or B3? Share and get helped!
jamerson
Posts: 80
Joined: 01 Feb 2007, 15:15
Contact:

Virtual hosts redirect to /admin

Post by jamerson » 16 Dec 2011, 01:02

I have searched and found the question in different places, but no solution. For me, at least.
I have added a virtual host and enabled it.
I have edited out the meta tag in the index.html file in /home/web. But still i get redirected to the bubba admin page when I try to reach my virtual host.

Any ideas?

/pelle

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 17 Dec 2011, 16:21

I'm not sure if it makes much sense to create another vhost and then point it to the same webroot as the default site.

That you're still being redirected may be a browser issue - try emptying your cache.

jamerson
Posts: 80
Joined: 01 Feb 2007, 15:15
Contact:

Re: Virtual hosts redirect to /admin

Post by jamerson » 17 Dec 2011, 16:37

I don't have the same webroot.
In the /home/web folder I have a subfolder called harmonyhill. This should be the root of my site, which the vhost should send me to.
But however I try I end up getting to the index.html in /home/web.

As if there is something overriding my vhost setting.

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 17 Dec 2011, 17:19

I hate to state the obvious, but based on what you're telling the vhost is actually not working and you're falling back to the default host.

Are you attempting to create an IP based virtual host (i.e. distinguish between LAN and WAN) or a named virtual host? You're doing http and not https I hope?

jamerson
Posts: 80
Joined: 01 Feb 2007, 15:15
Contact:

Re: Virtual hosts redirect to /admin

Post by jamerson » 18 Dec 2011, 03:41

I agree! And it's obvious.
The vhost does not seem to work.
It's http and name-based.

Here's what it looks like. Hopefully I missed something obvious.

<VirtualHost *:80>
ServerName harmonyhill.se
ServerAdmin pelle@harmonyhill.se
ServerAlias www.harmonyhill.se
DocumentRoot /home/web/harmonyhill.se
ErrorLog /var/log/apache2/harmonyhill-error.log
LogLevel warn
CustomLog /var/log/apache2/harmonyhill-access.log combined
ServerSignature On
</VirtualHost>

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 18 Dec 2011, 08:01

Looks fine ...

:idea: Did you also specify the "NameVirtualHost" directive? Try this:

Code: Select all

# su
# echo "NameVirtualHost *:80">/etc/apache2/conf.d/name-vhosts.conf
#/etc/init.d/apache2 restart

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Re: Virtual hosts redirect to /admin

Post by Ubi » 18 Dec 2011, 12:36

should that not be >> instead of >

jamerson
Posts: 80
Joined: 01 Feb 2007, 15:15
Contact:

Re: Virtual hosts redirect to /admin

Post by jamerson » 18 Dec 2011, 13:33

OK. Did that.
Now everything is truly strange, probably not because this last change.
But: I have several domains pointing to my IP.
The only one that I want to go somewhere else than the default is:
harmonyhill.se
That's the one that keeps redirecting.
smiffel.se for example shows only the content of the default webroot.

What is happening?

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 18 Dec 2011, 13:55

Ubi wrote:should that not be >> instead of >
Same thing - it's a file that does not exist in the default setup and the only thing it should do is make sure that the directive is added before the first vhost definition. Since I "invented" the file I'm not expecting anything else to be in there that should not be overwritten.

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Re: Virtual hosts redirect to /admin

Post by Ubi » 18 Dec 2011, 13:58

ah yes.
This issue just keeps on popping up, there must be a dozen threads with this exact question, and the real issue is that the Bubba interface in not in a virtualhost. Should be an easy fix yes?

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 18 Dec 2011, 14:15

jamerson wrote:OK. Did that.
Now everything is truly strange, probably not because this last change.
What do you mean with "everything is truly strange"? Is the "harmonyhill" page now using the right webroot but everything else gone quirky?

If you have DNS names pointing to your IP that do not require any different setup than the default, just don't define them. Vice versa: if you have anything that should only be visible to a particular DNS name (or interface) then make this a vhost. Be aware that default means everything you did not define, i.e. if someone edits his hosts file and defines your IP as foo.bar.com he'll get to your default webpage.

Like Ubi always says: keep it simple :wink:

Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 18 Dec 2011, 14:20

Ubi wrote:ah yes.
This issue just keeps on popping up, there must be a dozen threads with this exact question, and the real issue is that the Bubba interface in not in a virtualhost. Should be an easy fix yes?
Actually the Bubba interface is a a virtualhost, or are you referring to the /admin page?

The quick fix is to comment out the line in /etc/apache2/conf.d/admin.conf that says:

Code: Select all

Alias /admin /usr/share/web-admin/admin
Then add this line to the vhost definitions that you actually do want the /admin page to be enabled in.

mintz
Posts: 25
Joined: 31 Dec 2012, 08:03

Re: Virtual hosts redirect to /admin

Post by mintz » 29 Dec 2013, 11:29

I'm also sitting on this "problem" and really appreciate if anyone can provide me with a solution.
How to I completely disable the auto-redirect to /admin page? I have setup a "catch-all" virtualhost but it still get redirected.

Here's the virtualhost

Code: Select all

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/storage/www/web/
        DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/storage/www/web/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>


Gordon
Posts: 1373
Joined: 10 Aug 2011, 03:18

Re: Virtual hosts redirect to /admin

Post by Gordon » 29 Dec 2013, 12:14


mintz
Posts: 25
Joined: 31 Dec 2012, 08:03

Re: Virtual hosts redirect to /admin

Post by mintz » 29 Dec 2013, 16:01

I followed the guide but it didn't work for me. Is there any simpler way to just disable the redirection?

Post Reply