Commit fb3749fb authored by tbrehm's avatar tbrehm

Added website_basedir setting in server config.

parent e588bdaf
......@@ -130,6 +130,18 @@ yast2 -i webalizer perl-DateManip
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
......
......@@ -82,6 +82,11 @@ $conf['apache']['vhost_conf_dir'] = '/etc/httpd/conf/sites-available';
$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/';
......
......@@ -82,6 +82,11 @@ $conf['apache']['vhost_conf_dir'] = '/etc/apache2/sites-available';
$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/';
......
......@@ -82,6 +82,11 @@ $conf['apache']['vhost_conf_dir'] = '/etc/httpd/conf/sites-available';
$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/';
......
......@@ -82,6 +82,11 @@ $conf['apache']['vhost_conf_dir'] = '/etc/apache2/sites-available';
$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/';
......
......@@ -206,6 +206,9 @@ class installer_base {
$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);
......
......@@ -29,6 +29,7 @@ message_size_limit=0
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
......
......@@ -284,6 +284,17 @@ $form["tabs"]['web'] = array (
##################################
# 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',
......
<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>
......@@ -446,7 +446,7 @@ class apache2_plugin {
$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 @@ class apache2_plugin {
{
//$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 @@ class apache2_plugin {
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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment