Page 1 of 2

Virtual hosts redirect to /admin

Posted: 16 Dec 2011, 01:02
by jamerson
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

Re: Virtual hosts redirect to /admin

Posted: 17 Dec 2011, 16:21
by Gordon
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.

Re: Virtual hosts redirect to /admin

Posted: 17 Dec 2011, 16:37
by jamerson
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.

Re: Virtual hosts redirect to /admin

Posted: 17 Dec 2011, 17:19
by Gordon
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?

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 03:41
by jamerson
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>

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 08:01
by Gordon
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

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 12:36
by Ubi
should that not be >> instead of >

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 13:33
by jamerson
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?

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 13:55
by Gordon
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.

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 13:58
by Ubi
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?

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 14:15
by Gordon
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:

Re: Virtual hosts redirect to /admin

Posted: 18 Dec 2011, 14:20
by Gordon
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.

Re: Virtual hosts redirect to /admin

Posted: 29 Dec 2013, 11:29
by mintz
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>


Re: Virtual hosts redirect to /admin

Posted: 29 Dec 2013, 12:14
by Gordon

Re: Virtual hosts redirect to /admin

Posted: 29 Dec 2013, 16:01
by mintz
I followed the guide but it didn't work for me. Is there any simpler way to just disable the redirection?