Under Debian, I cleaned out MySQL and deleted directories in /var/aegir and the apache configurations - then ran the install as described in alpha12 and everything seemed to run flawlessly. At the end of the install I tried to sign in and I get "You don't have permission to access / on this server." but the access to other stuff on the server works.
The install script left all the user:group ownerships to just aegir:aegir on everything that was installed - and did not produce any warnings that it failed to change the group ownerships. I proved that was the culprit by changing the group ownerships of the hostmaster directory to aegir:www-data as well as (a lot of) directories and files under that to www-data and things started to work.
I tagged this as a bug because I did not need to do this when I did a fresh install under alpha10 - but frankly I am very willing to accept that I did some thing different and just can't figure out much that could possibly be wrong. I am thinking that it is possible that I did the alpha10 install as root with an su to aegir and this time I just logged in as the aegir user and installed alpha12 that way - doing an su to root when I needed root access rather than the other way around.
That is the only thing I can come up with that I might have done differently - but other than a possible shell difference I can not think of what difference that may have made.
I think the install should be making the group ownership changes and reporting if it is not successful so I decided to mark this as a bug.
Comments
Comment #1
Anonymous (not verified) commentedIt's highly possible that this is not a POSIX permissions problem but an Apache virtualhost overlap issue, causing the URL you try to reach the Aegir frontend on, being snatched up and served from some other location on your server.
Try an apache2ctl -S and see if your Aegir URL is being referenced by some other vhost. Check the Aegir vhost in /var/aegir/config/server_master/apache/vhost.d/ and ensure the DocumentRoot is correct, etc.
Comment #2
JeffBrower commentedI've never run that command before! Nice! Here is what I get (I changed the IP addresses and passwords, etc since this is a public post but they were all correct and match each other):
Which looks OK to me. An interesting observation when chasing down the config is that I DO have it set up where there is a symbolic link to a symbolic link to a conf file:
Interesting, but I think it works. So then a peek at /var/aegir/config/server_master/apache.conf looks right to me:
So that leaves the /var/aegir/config/server_master/apache/vhost.d/ directory you mentioned which only has the one config file for aegir:
It looks to me that everything is OK with all this and that the the DocumentRoot is correct, but I would love you to take a peek which is why I post it all - in any case this seems like a great practice to chase it all down and this was a great suggestion.
In the meantime, unless you see something I don't, I still don't know where to go next. I am unsure what should get what permissions and ownerships and I don't want to open it up without making sure it is secure.
Suggestions?
Comment #3
Anonymous (not verified) commentedWhat happens when you change all references to 99.99.99.99:80 with *:80 (and then restart apache?)
Comment #4
JeffBrower commentedI get the same result in the browser. I have the "Access denied" on the browser screen, but none of the formatting is there - I assume because the guesses I made for group ownership don't include the css for the administration theme.
When Drupal starts, I get:
which I kind of expect since the only site that exists after the install is the main aegir site.
Perhaps I should do a fresh, fresh install (crank up a fresh guest under the vm) and see if the presence of a pre-configured apache forces the install script to make assumptions that are not correct? If I get proper user:group ownerships being set with that, then we have a "re-install issue" and not an install issue. (grin)
Comment #5
JeffBrower commentedBefore creating a completely new guest, I cleaned everything out of the /var/aegir directory and did an "apt-get install --reinstall apache2", deleted the aegir_root user and databases from mysql, changed both my root and aegir user's umask back to the system default of 022 in .bashrc and then rebooted the guest to start clean.
Then I made a small change in the install script - I changed the hashbang line to /bin/sh from /bin/bash:
I logged in as root rather than aegir (since the installs all use that example) and all of that pretty well encompassed everything I could think of that could be the source of the problem. I really, really don't think that some of this made any difference at all, but I did it anyway.
Then I ran the install script above as root with the basic format of the command in the INSTALL.TXT:
And when I looked at the user:group ownership and permissions, EVERYTHING was still aegir:aegir so I expected another epic fail - but I got the welcome email and when I clicked on the link, the site came up PERFECTLY and it works quite well, thank you very much.
So, something in the mix above made all the difference.
The first time I logged in as the aegir user (which has a bash shell with umask 027) and ran the install script with the hashbang set to /bin/bash - mysql was cleaned out identically both times but the apache config shortcuts and directory structures were in place the first time (even though the config files in them were deleted) and the second time I had deleted everything and started with an apache reinstall.
Anybody want me to try anything in particular to see which change made the difference?
I personally think the umask during the install made the difference. I use a 027 umask so that others can not see or execute anything for any user unless that user specifically gives them permission through a group reference. I suspect that aegir is allowing apache to execute using the permissions for other rather than explicit permissions as group www-data.
If it turns out that this is true, should I convert this to a critical bug, report it as a security issue or ignore it and call myself overly paranoid? It would not be the first time I have been considered overly paranoid.
Comment #6
JeffBrower commentedOK - there is more information now.
It appears that when I had my hardening umask on (007) the install completes and reports success, but I can not get into aegir because the group www-data is not set on any files or directories - apache is allowed access to the drupal and aegir files not as user or group, but only as other - and other is denied permission. Immediately I considered this a bug as I expected apache to only access the files that it was given specific permission to access using group membership.
To prove it I wiped the system and installed again with the umask set to 022. Now it installed and reported success and still it looked like everything was set to aegir:aegir again and nothing to aegir:www-data so I expected the same result, but everything worked.
I have now had an opportunity to dig more deeply.
It appears that this access via other is by design. On files that need to be excluded, group and more fine grained access controls do indeed exist. For instance, now my settings.php file has -r--r----- permissions and aegir:www-data ownership limiting access to this file to aegir and apache2 only and then read-only in both cases.
I am not certain, but I think these actions happened during the verify that kicks off - which did not appear to have run in the first attempt.
I do not know if this is a bug, a security issue or just me being overly paranoid and using a umask that is too limiting. I will let you guys decide and mark this thread accordingly.
For those that skip to the end, if this happens to you, check your umask and make sure that it is 022 and then install again - it should work now.
Comment #7
Anonymous (not verified) commentedI think we can call this by design - reviewing the output of your last install, everything looks exactly as it should there. I don't think there's any security issue (in fact in various places in the Aegir code, we manipulate the umask to be *more* secure than the system would otherwise be).
Yep - if www-data group is not set as the group, or www-data not the owner, 'other' simply means 'everyone else' in Unix-compliant permissions. Unless the writable flag is set for 'other', I generally don't consider a gaping security hole in this situation (for example, if /usr/bin was not set to be 'executable' for the 'other' group, you wouldn't be able to run typical commands on a server as a regular user)
Installing using the default umask should result in success as you've mentioned. I'll close this, feel free to reopen if there's a glaring issue we haven't acknowledged.
Comment #8
sapre73 commentedHi,
I have the same problem installing aegir on Linux CentOS distribution. After setting environment and launching install.sh of PROVISION component, a welcome email containing a link is sent to my email address. If I click on this one, I get "You don't have permission to access / on this server." I followed the installation instruction of AEGIR official site.
I launched the following script as root user:
su -s /bin/sh aegir -c "sh /var/aegir/bin/install_aegir"
the umask of both "root" and "aegir" users is 022.
Please, could we help me? I lost any hope to operate with aegir :-(
I could post all the environment configuration, if necessary.
Comment #9
anarcat commentedPlease do not comment on old issues unless you reopen them.. Opening a new issue is usually better.
Please include:
* output from apache2ctl -S
* lines from apache's error.log