Closed (works as designed)
Project:
Provision
Version:
6.x-2.0-rc4
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2013 at 19:37 UTC
Updated:
5 Feb 2014 at 15:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
anarcat commentedthis may be the same problem as #2084963: SSL vhost does not respect Alias redirects.
Comment #2
socialnicheguru commentedi do not have ssl enabled
Comment #3
m.stenta@SocialNicheGuru: can you please post the chunk of your site's virtual host that begins with
<IfModule mod_rewrite.c>and ends with</IfModule>.It should contain a series of
RewriteCondandRewriteRulestatements. It will help a lot to see what you are ending up with.The virtual host file is in /var/aegir/config/server_master/apache/vhost.d/
Comment #4
m.stentaSome of the code in vhost.tpl.php looks funky to me. I don't know if it's related to this issue, but I thought I would point it out here as a start.
Attached is a patch.
The main things I changed:
Also, I removed the setting of
$data['redirect_url']in both SSL and non-SSL vhosts, because it is not being used anywhere (I grepped the entire Provision directory, and didn't see it anywhere else). My guess is this was used in the past, but the code was refactored and it was orphaned. I might be wrong about that. Perhaps one of the core maintainers knows for sure.I tested the following scenarios and they all work:
Comment #5
m.stentaAgain, it doesn't look like this patch will fix the issue described by SocialNicheGuru, so we'll need to wait to get a response from him with the content of his vhost before we can fix that. But combined with #2084963: SSL vhost does not respect Alias redirects, this patch should help to clean up some of the redirect logic a bit.
Comment #6
socialnicheguru commentedI was experimenting.
I have setup aegir within virtualbox ubuntu 12.04 guest
I was trying to get my host to be able to view the websites through a browser
config/server_master/apache/vhost.d/mytestservermaster.com
I added an alias
ServerAlias 192.168.1.15
ServerAlias mytestservermaster.com
ServerAlias 1mytestservermaster.com
Comment #7
m.stentaDid you add the aliases via the Aegir interface (this is the right way)? Or by editing the virtual host file manually?
You listed three aliases, but the middle one (mytestservermaster.com) is the same as the site's actual URI, isn't it? If so, that should not be an alias. It should be the ServerName (in the vhost).
You also said "I was trying to get my host to be able to view the websites through a browser" ... was it ever working? Did setting up the alias redirect break it? I'm confused.
Just want to make sure I understand how you got to where you are, and that everything is set up right.
Comment #8
anarcat commentedplease try to keep whitespace changes separate, from what i can tell, there is no actual change here...
Comment #9
anarcat commentedif this is not a dupe, then it's a critical.
Comment #10
chertzogi cant reproduce.
Here was what i did:
After everything verifies, visiting test1. test2. or test3. all redirect to test2.aegir.local welcome page.
Comment #11
anarcat commentedok then we need more info here...
1. verify the site, and provide a log of the verify task
2. provide the complete virtual host config file (censoring out the passwords, of course)
3. provide details of the site configuration in the frontend (a screenshot or proper copy/paste of the "view" tab of the site should be good enough)
4. provide details of the DNS configuration of the server
5. provide the output of apache2ctl -S
we messed around quite a lot to make sure redirections work properly since we added code to change the target of redirections, I was surprised it was actually broken...
Comment #12
socialnicheguru commented#7.
Did you add the aliases via the Aegir interface (this is the right way)? Or by editing the virtual host file manually?
- I added aliases through the interface
You listed three aliases, but the middle one (mytestservermaster.com) is the same as the site's actual URI, isn't it? If so, that should not be an alias. It should be the ServerName (in the vhost).
- my typo. remove "ServerAlias mytestservermaster.com"
You also said "I was trying to get my host to be able to view the websites through a browser" ... was it ever working? Did setting up the alias redirect break it? I'm confused.
I never got it working.
I tried bind first but could not get it to work. There is an issue filed.
Then I tried dnsmasq
Just want to make sure I understand how you got to where you are, and that everything is set up right.
I did try to do a redirect of the hostmaster site.
Comment #13
anarcat commentedthe issue i was refering to is #1681904: Ability to configure a url to redirect to in site configuration..
Comment #14
m.stenta@SocialNicheGuru: Are we talking about two different issues here?? On the one hand, this issue is about alias redirection not working... right? But on the other hand you're saying that you can't even visit your sites?? I'm confused. Are we talking about two separate issues in two separate Aegir installations? If so, let's keep them separate in this issue to avoid confusion.
The easiest way to access your sites in a Virtual Machine is to edit your /etc/hosts file (on Mac/Linux) and point the domain to your local IP address. Have you tried this?
Is that the issue? Please clarify. If you can't get to any of your sites at all, then this isn't an alias redirection issue...
Comment #15
socialnicheguru commentedNo. The issue for me was that I enabled redirect on alias.
The alias function worked fine:
mytestsite.com is the original site
1mystestsite.com is the alias
I could goto either just fine.
Then I tried redirection.
If I went to mytestsite.com or 1mytestsite.com i would be directed to: 1mytestsite.com/install.php
In my case specificayly mytestsite was my hostmaster site.
Please note:
I added the info on dns because that was what I was doing prior to enabling the redirect. I do not know if it has any bearing. I think it doesn't but I added simply for completeness. I am sorry for muddying the waters. I hope my explanation helps a little bit.
Comment #16
m.stentaOk, thanks, that does clarify.
So it sounds like this might be an issue with adding alias redirection to the Hostmaster site itself, specifically.
Have you tried adding alias redirection to any other sites in the system (not the Hostmaster site)? That would help to isolate the issue to Hostmaster if those work.
Comment #17
socialnicheguru commentedI am no longer getting this issue when I upgraded to aegir 2.0
Comment #18
socialnicheguru commentedI am no longer getting this issue when I upgraded to aegir 2.0