tbrehm
2012-01-04 9de29945a10cf205c1907c29aa38b395f6c3c6b5
- Improved http monitor function.
- Added ispconfigend user and group when user to webid connection is activated.
2 files modified
15 ■■■■■ changed files
server/lib/classes/monitor_tools.inc.php 6 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 9 ●●●●● patch | view | raw | blame | history
server/lib/classes/monitor_tools.inc.php
@@ -1719,7 +1719,11 @@
                 * So we can do a deepter test and try to get data over this connection.
                 * (if apache hangs, we get a connection but a timeout by trying to GET the data!)
                 */
                fwrite($fp, "GET / HTTP/1.0\r\n\r\n");
                // fwrite($fp, "GET / HTTP/1.0\r\n\r\n");
                $out = "GET / HTTP/1.1\r\n";
                $out .= "Host: localhost\r\n";
                $out .= "Connection: Close\r\n\r\n";
                fwrite($fp, $out);
                stream_set_timeout($fp, 5); // Timeout after 5 seconds
                $res = fread($fp, 10);  // try to get 10 bytes (enough to test!)
                $info = stream_get_meta_data($fp);
server/plugins-available/apache2_plugin.inc.php
@@ -293,10 +293,19 @@
        $app->uses('system');
        
        if($web_config['connect_userid_to_webid'] == 'y') {
            //* Calculate the uid and gid
            $connect_userid_to_webid_start = ($web_config['connect_userid_to_webid_start'] < 1000)?1000:intval($web_config['connect_userid_to_webid_start']);
            $fixed_uid_gid = intval($connect_userid_to_webid_start + $data['new']['domain_id']);
            $fixed_uid_param = '--uid '.$fixed_uid_gid;
            $fixed_gid_param = '--gid '.$fixed_uid_gid;
            //* Check if a ispconfigend user and group exists and create them
            if(!$app->system->is_group('ispconfigend')) {
                exec('groupadd --gid '.($connect_userid_to_webid_start + 10000).' ispconfigend');
            }
            if(!$app->system->is_user('ispconfigend')) {
                exec('useradd -g ispconfigend -d /usr/local/ispconfig --uid '.($connect_userid_to_webid_start + 10000).' ispconfigend');
            }
        } else {
            $fixed_uid_param = '';
            $fixed_gid_param = '';