tbrehm
2009-03-05 fb3749fbf5d9173c0ef0b390baea37ddede978af
Added website_basedir setting in server config.
10 files modified
123 ■■■■ changed files
docs/INSTALL_OPENSUSE_11_1.txt 12 ●●●●● patch | view | raw | blame | history
install/dist/conf/centos52.conf.php 5 ●●●●● patch | view | raw | blame | history
install/dist/conf/debian40.conf.php 5 ●●●●● patch | view | raw | blame | history
install/dist/conf/fedora9.conf.php 5 ●●●●● patch | view | raw | blame | history
install/dist/conf/opensuse110.conf.php 5 ●●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php 3 ●●●●● patch | view | raw | blame | history
install/tpl/server.ini.master 1 ●●●● patch | view | raw | blame | history
interface/web/admin/form/server_config.tform.php 11 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_config_web_edit.htm 70 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 6 ●●●● patch | view | raw | blame | history
docs/INSTALL_OPENSUSE_11_1.txt
@@ -130,6 +130,18 @@
rm -f /tmp/*.rpm
6.2 Install jailkit
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
tar xvfz jailkit-2.5.tar.gz
cd jailkit-2.5
./configure
make
make install
cd ..
rm -rf jailkit-2.5*
7) Install ISPConfig 3
install/dist/conf/centos52.conf.php
@@ -82,6 +82,11 @@
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/httpd/conf/sites-enabled';
$conf['apache']['vhost_port'] = '8080';
//* Website base settings
$conf['web']['website_basedir'] = '/var/www';
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
//* Fastcgi
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/';
install/dist/conf/debian40.conf.php
@@ -82,6 +82,11 @@
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
$conf['apache']['vhost_port'] = '8080';
//* Website base settings
$conf['web']['website_basedir'] = '/var/www';
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
//* Fastcgi
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
install/dist/conf/fedora9.conf.php
@@ -82,6 +82,11 @@
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/httpd/conf/sites-enabled';
$conf['apache']['vhost_port'] = '8080';
//* Website base settings
$conf['web']['website_basedir'] = '/var/www';
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
//* Fastcgi
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/';
install/dist/conf/opensuse110.conf.php
@@ -82,6 +82,11 @@
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
$conf['apache']['vhost_port'] = '8080';
//* Website base settings
$conf['web']['website_basedir'] = '/srv/www';
$conf['web']['website_path'] = '/srv/www/clients/client[client_id]/web[website_id]';
$conf['web']['website_symlinks'] = '/srv/www/[website_domain]/:/srv/www/clients/client[client_id]/[website_domain]/';
//* Fastcgi
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
install/lib/installer_base.lib.php
@@ -206,6 +206,9 @@
        $tpl_ini_array['fastcgi']['fastcgi_phpini_path'] = $conf['fastcgi']['fastcgi_phpini_path'];
        $tpl_ini_array['server']['hostname'] = $conf['hostname'];
        $tpl_ini_array['server']['ip_address'] = @gethostbyname($conf['hostname']);
        $tpl_ini_array['web']['website_basedir'] = $conf['web']['website_basedir'];
        $tpl_ini_array['web']['website_path'] = $conf['web']['website_path'];
        $tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks'];
        
        $server_ini_content = array_to_ini($tpl_ini_array);
        $server_ini_content = mysql_real_escape_string($server_ini_content);
install/tpl/server.ini.master
@@ -29,6 +29,7 @@
getmail_config_dir=/etc/getmail
[web]
website_basedir=/var/www
website_path=/var/www/clients/client[client_id]/web[website_id]
website_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/
vhost_conf_dir=/etc/apache2/sites-available
interface/web/admin/form/server_config.tform.php
@@ -284,6 +284,17 @@
    ##################################
    # Begin Datatable fields
    ##################################
        'website_basedir' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'website_basedir_error_empty'),
                                    ),
            'value'        => '',
            'width'        => '40',
            'maxlength'    => '255'
        ),
        'website_path' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
interface/web/admin/templates/server_config_web_edit.htm
@@ -1,33 +1,37 @@
<h2><tmpl_var name="list_head_txt"></h2>
<div class="panel panel_server_config">
  <div class="pnl_formsarea">
    <fieldset id="wf_area_server_config"><legend>Web</legend>
      <span class="wf_oneField">
        <label for="website_path" class="wf_preField">{tmpl_var name='website_path_txt'}</label>
        <input type="text" id="website_path" name="website_path" value="{tmpl_var name='website_path'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="website_symlinks" class="wf_preField">{tmpl_var name='website_symlinks_txt'}</label>
        <input type="text" id="website_symlinks" name="website_symlinks" value="{tmpl_var name='website_symlinks'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="vhost_conf_dir" class="wf_preField">{tmpl_var name='vhost_conf_dir_txt'}</label>
        <input type="text" id="vhost_conf_dir" name="vhost_conf_dir" value="{tmpl_var name='vhost_conf_dir'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="vhost_conf_enabled_dir" class="wf_preField">{tmpl_var name='vhost_conf_enabled_dir_txt'}</label>
        <input type="text" id="vhost_conf_enabled_dir" name="vhost_conf_enabled_dir" value="{tmpl_var name='vhost_conf_enabled_dir'}" size="40" maxlength="255">
      </span>
    </fieldset>
    <input type="hidden" name="id" value="{tmpl_var name='id'}">
    <div class="wf_actions buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_config_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
</div>
<h2><tmpl_var name="list_head_txt"></h2>
<div class="panel panel_server_config">
  <div class="pnl_formsarea">
    <fieldset id="wf_area_server_config"><legend>Web</legend>
      <span class="wf_oneField">
        <label for="website_basedir" class="wf_preField">{tmpl_var name='website_basedir_txt'}</label>
        <input type="text" id="website_basedir" name="website_basedir" value="{tmpl_var name='website_basedir'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="website_path" class="wf_preField">{tmpl_var name='website_path_txt'}</label>
        <input type="text" id="website_path" name="website_path" value="{tmpl_var name='website_path'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="website_symlinks" class="wf_preField">{tmpl_var name='website_symlinks_txt'}</label>
        <input type="text" id="website_symlinks" name="website_symlinks" value="{tmpl_var name='website_symlinks'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="vhost_conf_dir" class="wf_preField">{tmpl_var name='vhost_conf_dir_txt'}</label>
        <input type="text" id="vhost_conf_dir" name="vhost_conf_dir" value="{tmpl_var name='vhost_conf_dir'}" size="40" maxlength="255">
      </span>
      <span class="wf_oneField">
        <label for="vhost_conf_enabled_dir" class="wf_preField">{tmpl_var name='vhost_conf_enabled_dir_txt'}</label>
        <input type="text" id="vhost_conf_enabled_dir" name="vhost_conf_enabled_dir" value="{tmpl_var name='vhost_conf_enabled_dir'}" size="40" maxlength="255">
      </span>
    </fieldset>
    <input type="hidden" name="id" value="{tmpl_var name='id'}">
    <div class="wf_actions buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/server_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_config_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
</div>
server/plugins-available/apache2_plugin.inc.php
@@ -446,7 +446,7 @@
        
        $vhost_data = $data["new"];
        $vhost_data["web_document_root"] = $data["new"]["document_root"]."/web";
        $vhost_data["web_document_root_www"] = "/var/www/".$data["new"]["domain"]."/web";
        $vhost_data["web_document_root_www"] = $web_config["website_basedir"]."/".$data["new"]["domain"]."/web";
        
        // Check if a SSL cert exists
        $ssl_dir = $data["new"]["document_root"]."/ssl";
@@ -602,7 +602,7 @@
        {
            //$cgi_config = $app->getconf->get_server_config($conf["server_id"], 'cgi');
            $cgi_config["cgi_starter_path"] = "/var/www/php-cgi-scripts/[system_user]/";
            $cgi_config["cgi_starter_path"] = $web_config["website_basedir"]."/php-cgi-scripts/[system_user]/";
            $cgi_config["cgi_starter_script"] = "php-cgi-starter";
            $cgi_config["cgi_bin"] = "/usr/bin/php-cgi";
@@ -721,7 +721,7 @@
            if ($data["old"]["php"] == "cgi")
            {
                // TODO: fetch the date from the server-settings
                $web_config["cgi_starter_path"] = "/var/www/php-cgi-scripts/[system_user]/";
                $web_config["cgi_starter_path"] = $web_config["website_basedir"]."/php-cgi-scripts/[system_user]/";
                $cgi_starter_path = str_replace("[system_user]",$data["old"]["system_user"],$web_config["cgi_starter_path"]);
                if (is_dir($cgi_starter_path))