From f11aa9a1c4a804d4b68c3c4f6443e31d7ce7cfe4 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 6 Dec 2010 08:56:39 +0000 Subject: [PATCH] - forgot to save lighttpd_fcgid-class with own-vhost settings for php-fpm --- .../cron_tasks.inc.http.25.lighttpd_fcgid.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/scripts/jobs/cron_tasks.inc.http.25.lighttpd_fcgid.php b/scripts/jobs/cron_tasks.inc.http.25.lighttpd_fcgid.php index a2921049..7c0f7016 100644 --- a/scripts/jobs/cron_tasks.inc.http.25.lighttpd_fcgid.php +++ b/scripts/jobs/cron_tasks.inc.http.25.lighttpd_fcgid.php @@ -116,4 +116,47 @@ class lighttpd_fcgid extends lighttpd return $php_options_text; } + + public function createOwnVhostStarter() + { + if ($this->settings['phpfpm']['enabled'] == '1' + && $this->settings['phpfpm']['enabled_ownvhost'] == '1' + ) { + $mypath = makeCorrectDir(dirname(dirname(dirname(__FILE__)))); // /var/www/froxlor, needed for chown + + $user = $this->settings['phpfpm']['vhost_httpuser']; + $group = $this->settings['phpfpm']['vhost_httpgroup']; + + $domain = array( + 'id' => 'none', + 'domain' => $this->settings['system']['hostname'], + 'adminid' => 1, /* first admin-user (superadmin) */ + 'mod_fcgid_starter' => -1, + 'mod_fcgid_maxrequests' => -1, + 'guid' => $user, + 'openbasedir' => 0, + 'safemode' => '0', + 'email' => $this->settings['panel']['adminmail'], + 'loginname' => 'froxlor.panel', + 'documentroot' => $mypath + ); + + // all the files and folders have to belong to the local user + // now because we also use fcgid for our own vhost + safe_exec('chown -R ' . $user . ':' . $group . ' ' . escapeshellarg($mypath)); + + // get php.ini for our own vhost + $php = new phpinterface($this->getDB(), $this->settings, $domain); + + // @FIXME don't use fcgid settings, but we don't have anything else atm + $phpconfig = $php->getPhpConfig($this->settings['system']['mod_fcgid_defaultini_ownvhost']); + + // create starter-file | config-file + $php->getInterface()->createConfig($phpconfig); + + // create php.ini + // @TODO make php-fpm support this + $php->getInterface()->createIniFile($phpconfig); + } + } }