I click on verification and get this:

Warning: include_once(./sites/aegir.example.com/settings.php) [function.include-once]: failed to open stream: Permission denied in /private/var/aegir/hostmaster-HEAD/includes/bootstrap.inc on line 322

It is set to 440
user: aegir
owner: aegir
group: _www (on a mac)

Comments

socialnicheguru’s picture

I am using hostmaster-HEAD btw.

socialnicheguru’s picture

I changed the permissions to 444

I see that /var/aegir/config/vhost.d/aegir.example.com_80 is there and the variables are set but when I open up the page I see this:

Notice: Undefined index: db_type in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 12

Notice: Undefined index: db_name in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 13

Notice: Undefined index: db_user in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 14

Notice: Undefined index: db_passwd in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 15

Notice: Undefined index: db_host in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 16

Notice: Undefined index: db_type in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 18

Notice: Undefined index: db_user in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 18

Notice: Undefined index: db_passwd in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 18

Notice: Undefined index: db_host in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 18

Notice: Undefined index: db_name in /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /private/var/aegir/hostmaster-HEAD/sites/aegir.example.com/settings.php:12) in /private/var/aegir/hostmaster-HEAD/includes/common.inc on line 148

adrian’s picture

that file should _not_ be readable by apache , because it means every site on the server can look at your db credentials (when they have php access).

did you try to restart apache ?

how it works is that the credentials are stored in the apache virtual host, so that those credentials will only appear in the $_SERVER variable when that specific site's virtualhost is being used.

So apache needs to be 'sudo apachectl graceful'd to pick up changes in the configuration file.

socialnicheguru’s picture

I used this install script:
http://git.aegirproject.org/?p=provision.git;a=blob_plain;f=install.sh.t...

I am able to run: sudo apachectl graceful as aegir

I changed permissions chmod 440 hostmaster-HEAD/sites/aegir.example.com/settings.php

The settings.php cannot be read if I do that.

if I change to 444 just for testing, I still get the output in #2

socialnicheguru’s picture

Title: WSOD on verification page: Cant access settings.php file for verification » Site is offline when cron runs site import. database settings are not read in settings.php
Issue tags: +aegir, +provision, +hostmaster

Update-

using hostmaster-HEAD

so settings.php doesn't seem to be an issue anymore.
I erased everything and started from scratch
I looked and settings.php is set to 440

But the variables in the settings.php file still are not read as in #2.

I put this line in /Applications/MAMP/conf/apache/httpd.conf:
Include /var/aegir/config/vhost.d/*

I see that a sym link is created by the system.

/etc/apache2/vhost.d links to /var/aegir/config/vhost.d

lrwxr-xr-x 1 root wheel 25 Mar 13 08:03 vhost.d -> /var/aegir/config/vhost.d

socialnicheguru’s picture

A few things stand out when I run /var/aegir/drush/drush --debug provision-verify:

Undefined index: base_url provision_apache.drush.inc:50 [0.15 sec, 3.47 MB] [notice]
Undefined index: db_url provision_mysql.drush.inc:16 [0.15 sec, 3.47 MB] [notice]
Undefined variable: file provision_apache.drush.inc:219 [0.16 sec, 3.52 MB] [notice]
Drupal sites directory is not writable by the provisioning script [0.25 sec, 3.53 MB][error]
An error occurred at function : drush_provision_drupal_provision_verify [0.42 sec, [error]
3.79 MB]

Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.1 sec, 2.79 MB] [bootstrap]
Loading drushrc "/private/var/aegir/hostmaster-HEAD/drushrc.php" into "drupal" scope.[bootstrap]
[0.1 sec, 2.79 MB]
Initialized Drupal 6.16 root directory at /var/aegir/hostmaster-HEAD [0.12 sec, 3.41 [notice]
MB]
Found command: provision-verify (commandfile=provision) [0.13 sec, 3.46 MB] [bootstrap]
Initializing drush commandfile: drush_make [0.14 sec, 3.47 MB] [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.14 sec, 3.47 MB] [bootstrap]
Initializing drush commandfile: provision [0.15 sec, 3.47 MB] [bootstrap]
Initializing drush commandfile: provision_apache [0.15 sec, 3.47 MB] [bootstrap]
Undefined index: base_url provision_apache.drush.inc:50 [0.15 sec, 3.47 MB] [notice]
Initializing drush commandfile: provision_drupal [0.15 sec, 3.47 MB] [bootstrap]
Initializing drush commandfile: provision_mysql [0.15 sec, 3.47 MB] [bootstrap]
Undefined index: db_url provision_mysql.drush.inc:16 [0.15 sec, 3.47 MB] [notice]
Including /var/aegir/.drush/provision/web_server/verify.provision.inc [0.15 sec, 3.47[bootstrap]
MB]
Including /var/aegir/.drush/provision/platform/backupmigrate/verify.provision.inc [bootstrap]
[0.15 sec, 3.48 MB]
Including /var/aegir/.drush/provision/platform/verify.provision.inc [0.15 sec, 3.48 [bootstrap]
MB]
Including /var/aegir/.drush/provision/db_server/verify.provision.inc [0.15 sec, 3.5 [bootstrap]
MB]
Including /var/aegir/.drush/provision/ssl/verify.provision.inc [0.16 sec, 3.5 MB] [bootstrap]
Virtual host configuration path exists. [0.16 sec, 3.52 MB] [message]
Virtual host configuration ownership of path has been changed to aegir. [0.16 sec, [message]
3.52 MB]
Virtual host configuration permissions of path have been changed to 0700. [0.16 sec, [message]
3.52 MB]
Virtual host configuration path is writable. [0.16 sec, 3.52 MB] [message]
Platforms configuration path exists. [0.16 sec, 3.52 MB] [message]
Platforms configuration ownership of path has been changed to aegir. [0.16 sec, 3.52 [message]
MB]
Platforms configuration permissions of path have been changed to 0700. [0.16 sec, [message]
3.52 MB]
Platforms configuration path is writable. [0.16 sec, 3.52 MB] [message]
Undefined variable: file provision_apache.drush.inc:219 [0.16 sec, 3.52 MB] [notice]
Generating apache server configuration file . [0.16 sec, 3.52 MB] [notice]
Executing: sudo /usr/sbin/apachectl graceful [0.17 sec, 3.52 MB] [notice]
Apache has been restarted [0.24 sec, 3.52 MB] [notice]
Provision configuration path exists. [0.24 sec, 3.52 MB] [message]
Provision configuration ownership of path has been changed to aegir. [0.24 sec, 3.52 [message]
MB]
Provision configuration permissions of path have been changed to 0711. [0.24 sec, [message]
3.52 MB]
Provision configuration path is writable. [0.24 sec, 3.52 MB] [message]
Provision PHP configuration path exists. [0.24 sec, 3.52 MB] [message]
Provision PHP configuration ownership of path has been changed to aegir. [0.24 sec, [message]
3.52 MB]
Provision PHP configuration permissions of path have been changed to 0711. [0.24 sec, [message]
3.52 MB]
Provision PHP configuration path is writable. [0.24 sec, 3.52 MB] [message]
Global configuration file exists [0.24 sec, 3.52 MB] [message]
Backup path exists. [0.24 sec, 3.52 MB] [message]
Backup ownership of path has been changed to aegir. [0.24 sec, 3.53 MB] [message]
Backup permissions of path have been changed to 0700. [0.24 sec, 3.53 MB] [message]
Backup path is writable. [0.24 sec, 3.53 MB] [message]
Drupal sites directory is not writable by the provisioning script [0.25 sec, 3.53 MB][error]
This platform is running drupal 6.16 [0.25 sec, 3.53 MB] [notice]
Including non-version specific file : [notice]
/var/aegir/.drush/provision/platform/drupal/packages.inc [0.25 sec, 3.53 MB]
Found 33 modules in base [0.33 sec, 3.62 MB] [notice]
Found 6 themes in base [0.34 sec, 3.63 MB] [notice]
Found install profile default [0.35 sec, 3.76 MB] [notice]
Found install profile hostmaster [0.35 sec, 3.82 MB] [notice]
Found 20 modules in profiles/hostmaster [0.41 sec, 3.87 MB] [notice]
Found 1 themes in profiles/hostmaster [0.41 sec, 3.87 MB] [notice]
Changed permissions of sites/all to 0755 [0.42 sec, 3.79 MB] [message]
Changed permissions of sites/all/themes to 2775 [0.42 sec, 3.79 MB] [message]
Changed permissions of sites/all/modules to 2775 [0.42 sec, 3.79 MB] [message]
Changed permissions of sites/all/libraries to 2775 [0.42 sec, 3.79 MB] [message]
Changed permissions of sites/all/private to 0755 [0.42 sec, 3.79 MB] [message]
Changed permissions of sites/all/private/files to 2770 [0.42 sec, 3.79 [message]
MB]
Changed permissions of sites/all/private/temp to 2770 [0.42 sec, 3.79 [message]
MB]
An error occurred at function : drush_provision_drupal_provision_verify [0.42 sec, [error]
3.79 MB]
Command dispatch complete [0.42 sec, 3.78 MB] [notice]
Peak memory usage was 4.06 MB [0.42 sec, 3.78 MB] [memory]

socialnicheguru’s picture

Status: Active » Closed (fixed)

I was installing on MAMP.

I switched to Ubuntu 8.04

seismicmike’s picture

I'm having a similar issue to this. I have hostmaster running on an ubuntu server, and I'm trying to deploy sites to a remote server which is running CentOS 5. I have aegir running successfully on the ubuntu server and have set up and verified the server and platform on the CentOS server, but when I try to create a new site, the install operation runs successfully in Aegir's queue, but I can't load the site. When I click the "log in to test1.example.com" link, it takes me to the install.php file and shows the following errors:

Warning: include_once(/var/aegir/platforms/drupal-7.22/sites/test1.example.com/settings.php) [function.include-once]: failed to open stream: Permission denied in drupal_settings_initialize() (line 712 of /var/aegir/platforms/drupal-7.22/includes/bootstrap.inc).

Warning: include_once() [function.include]: Failed opening '/var/aegir/platforms/drupal-7.22/sites/test1.example.com/settings.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in drupal_settings_initialize() (line 712 of /var/aegir/platforms/drupal-7.22/includes/bootstrap.inc).

I checked the settings.php file:

aegir@server:~$ ls -ldd /var/aegir/platforms/drupal-7.22/sites/test1.example.com/settings.php
-r--r----- 1 aegir aegir 4980 Apr 24 15:11 /var/aegir/platforms/drupal-7.22/sites/test1.example.com/settings.php

When I chmod settings.php to 644 or even 444 the site loads properly. I'd leave it at that except that whenever Aegir does some operation on the remote site (reset password for example... even cron I think), it chmod's the settings.php file back to 440 and the site stops working until I manually go in and chmod settings.php again.

What can I do to either keep settings.php from being chmoded or to allow it to be readable when being served by apache while chmodded to 440?

I think this is irrelevant, but just to make sure, I have in my /etc/sudoers file:

Defaults:aegir !requiretty
aegir ALL=NOPASSWD: /usr/sbin/apachectl

(NOTE: This is CentOS, so the command is apachectl, not apache2ctl. I have successfully tested running this command as the aegir user and have verified that aegir can run it remotely.)

In CentOS, apache runs as user "apache" and Group "apache". From /etc/httpd/conf/httpd.conf:

User apache
Group apache

I have aegir as a member of the apache group and apache as a member of the aegir group:

aegir@server:~$ groups aegir
aegir: aegir apache
aegir@server:~$ groups apache
apache: apache aegir

But I'm still having the same problem. What can I do differently?

seismicmike’s picture

I just answered my own question. And unlike so many others, I'm going to share the answer! :P

I examined the hostmaster set up on the ubuntu server and noticed that the group ownership of the files was set to www-data - at least for the important files like the settings.php and the files directory. So I did a chgrp to the settings.php file to assign the apache group and now it works when settings.php is 440.

I just need to figure out how to set this so that it's the default when creating a new site and I don't have to go in manually now.