Skip to content

Commit fb3749f

Browse files
committed
Added website_basedir setting in server config.
1 parent e588bda commit fb3749f

File tree

10 files changed

+87
-36
lines changed

10 files changed

+87
-36
lines changed

docs/INSTALL_OPENSUSE_11_1.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ yast2 -i webalizer perl-DateManip
130130

131131
rm -f /tmp/*.rpm
132132

133+
6.2 Install jailkit
134+
135+
cd /tmp
136+
wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz
137+
tar xvfz jailkit-2.5.tar.gz
138+
cd jailkit-2.5
139+
./configure
140+
make
141+
make install
142+
cd ..
143+
rm -rf jailkit-2.5*
144+
133145

134146
7) Install ISPConfig 3
135147

install/dist/conf/centos52.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/httpd/conf/sites-enabled';
8383
$conf['apache']['vhost_port'] = '8080';
8484

85+
//* Website base settings
86+
$conf['web']['website_basedir'] = '/var/www';
87+
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
88+
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
89+
8590
//* Fastcgi
8691
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/';
8792

install/dist/conf/debian40.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
8383
$conf['apache']['vhost_port'] = '8080';
8484

85+
//* Website base settings
86+
$conf['web']['website_basedir'] = '/var/www';
87+
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
88+
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
89+
8590
//* Fastcgi
8691
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
8792

install/dist/conf/fedora9.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/httpd/conf/sites-enabled';
8383
$conf['apache']['vhost_port'] = '8080';
8484

85+
//* Website base settings
86+
$conf['web']['website_basedir'] = '/var/www';
87+
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
88+
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
89+
8590
//* Fastcgi
8691
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/';
8792

install/dist/conf/opensuse110.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
8383
$conf['apache']['vhost_port'] = '8080';
8484

85+
//* Website base settings
86+
$conf['web']['website_basedir'] = '/srv/www';
87+
$conf['web']['website_path'] = '/srv/www/clients/client[client_id]/web[website_id]';
88+
$conf['web']['website_symlinks'] = '/srv/www/[website_domain]/:/srv/www/clients/client[client_id]/[website_domain]/';
89+
8590
//* Fastcgi
8691
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php5/cgi/';
8792

install/lib/installer_base.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ public function add_database_server_record() {
206206
$tpl_ini_array['fastcgi']['fastcgi_phpini_path'] = $conf['fastcgi']['fastcgi_phpini_path'];
207207
$tpl_ini_array['server']['hostname'] = $conf['hostname'];
208208
$tpl_ini_array['server']['ip_address'] = @gethostbyname($conf['hostname']);
209+
$tpl_ini_array['web']['website_basedir'] = $conf['web']['website_basedir'];
210+
$tpl_ini_array['web']['website_path'] = $conf['web']['website_path'];
211+
$tpl_ini_array['web']['website_symlinks'] = $conf['web']['website_symlinks'];
209212

210213
$server_ini_content = array_to_ini($tpl_ini_array);
211214
$server_ini_content = mysql_real_escape_string($server_ini_content);

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ message_size_limit=0
2929
getmail_config_dir=/etc/getmail
3030

3131
[web]
32+
website_basedir=/var/www
3233
website_path=/var/www/clients/client[client_id]/web[website_id]
3334
website_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/
3435
vhost_conf_dir=/etc/apache2/sites-available

interface/web/admin/form/server_config.tform.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,17 @@
284284
##################################
285285
# Begin Datatable fields
286286
##################################
287+
'website_basedir' => array (
288+
'datatype' => 'VARCHAR',
289+
'formtype' => 'TEXT',
290+
'default' => '',
291+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
292+
'errmsg'=> 'website_basedir_error_empty'),
293+
),
294+
'value' => '',
295+
'width' => '40',
296+
'maxlength' => '255'
297+
),
287298
'website_path' => array (
288299
'datatype' => 'VARCHAR',
289300
'formtype' => 'TEXT',
Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
1-
<h2><tmpl_var name="list_head_txt"></h2>
2-
3-
<div class="panel panel_server_config">
4-
5-
<div class="pnl_formsarea">
6-
<fieldset id="wf_area_server_config"><legend>Web</legend>
7-
<span class="wf_oneField">
8-
<label for="website_path" class="wf_preField">{tmpl_var name='website_path_txt'}</label>
9-
<input type="text" id="website_path" name="website_path" value="{tmpl_var name='website_path'}" size="40" maxlength="255">
10-
</span>
11-
<span class="wf_oneField">
12-
<label for="website_symlinks" class="wf_preField">{tmpl_var name='website_symlinks_txt'}</label>
13-
<input type="text" id="website_symlinks" name="website_symlinks" value="{tmpl_var name='website_symlinks'}" size="40" maxlength="255">
14-
</span>
15-
<span class="wf_oneField">
16-
<label for="vhost_conf_dir" class="wf_preField">{tmpl_var name='vhost_conf_dir_txt'}</label>
17-
<input type="text" id="vhost_conf_dir" name="vhost_conf_dir" value="{tmpl_var name='vhost_conf_dir'}" size="40" maxlength="255">
18-
</span>
19-
<span class="wf_oneField">
20-
<label for="vhost_conf_enabled_dir" class="wf_preField">{tmpl_var name='vhost_conf_enabled_dir_txt'}</label>
21-
<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">
22-
</span>
23-
</fieldset>
24-
25-
<input type="hidden" name="id" value="{tmpl_var name='id'}">
26-
27-
<div class="wf_actions buttons">
28-
<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>
29-
<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>
30-
</div>
31-
</div>
32-
33-
</div>
1+
<h2><tmpl_var name="list_head_txt"></h2>
2+
3+
<div class="panel panel_server_config">
4+
5+
<div class="pnl_formsarea">
6+
<fieldset id="wf_area_server_config"><legend>Web</legend>
7+
<span class="wf_oneField">
8+
<label for="website_basedir" class="wf_preField">{tmpl_var name='website_basedir_txt'}</label>
9+
<input type="text" id="website_basedir" name="website_basedir" value="{tmpl_var name='website_basedir'}" size="40" maxlength="255">
10+
</span>
11+
<span class="wf_oneField">
12+
<label for="website_path" class="wf_preField">{tmpl_var name='website_path_txt'}</label>
13+
<input type="text" id="website_path" name="website_path" value="{tmpl_var name='website_path'}" size="40" maxlength="255">
14+
</span>
15+
<span class="wf_oneField">
16+
<label for="website_symlinks" class="wf_preField">{tmpl_var name='website_symlinks_txt'}</label>
17+
<input type="text" id="website_symlinks" name="website_symlinks" value="{tmpl_var name='website_symlinks'}" size="40" maxlength="255">
18+
</span>
19+
<span class="wf_oneField">
20+
<label for="vhost_conf_dir" class="wf_preField">{tmpl_var name='vhost_conf_dir_txt'}</label>
21+
<input type="text" id="vhost_conf_dir" name="vhost_conf_dir" value="{tmpl_var name='vhost_conf_dir'}" size="40" maxlength="255">
22+
</span>
23+
<span class="wf_oneField">
24+
<label for="vhost_conf_enabled_dir" class="wf_preField">{tmpl_var name='vhost_conf_enabled_dir_txt'}</label>
25+
<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">
26+
</span>
27+
</fieldset>
28+
29+
<input type="hidden" name="id" value="{tmpl_var name='id'}">
30+
31+
<div class="wf_actions buttons">
32+
<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>
33+
<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>
34+
</div>
35+
</div>
36+
37+
</div>

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ function update($event_name,$data) {
446446

447447
$vhost_data = $data["new"];
448448
$vhost_data["web_document_root"] = $data["new"]["document_root"]."/web";
449-
$vhost_data["web_document_root_www"] = "/var/www/".$data["new"]["domain"]."/web";
449+
$vhost_data["web_document_root_www"] = $web_config["website_basedir"]."/".$data["new"]["domain"]."/web";
450450

451451
// Check if a SSL cert exists
452452
$ssl_dir = $data["new"]["document_root"]."/ssl";
@@ -602,7 +602,7 @@ function update($event_name,$data) {
602602
{
603603
//$cgi_config = $app->getconf->get_server_config($conf["server_id"], 'cgi');
604604

605-
$cgi_config["cgi_starter_path"] = "/var/www/php-cgi-scripts/[system_user]/";
605+
$cgi_config["cgi_starter_path"] = $web_config["website_basedir"]."/php-cgi-scripts/[system_user]/";
606606
$cgi_config["cgi_starter_script"] = "php-cgi-starter";
607607
$cgi_config["cgi_bin"] = "/usr/bin/php-cgi";
608608

@@ -721,7 +721,7 @@ function delete($event_name,$data) {
721721
if ($data["old"]["php"] == "cgi")
722722
{
723723
// TODO: fetch the date from the server-settings
724-
$web_config["cgi_starter_path"] = "/var/www/php-cgi-scripts/[system_user]/";
724+
$web_config["cgi_starter_path"] = $web_config["website_basedir"]."/php-cgi-scripts/[system_user]/";
725725

726726
$cgi_starter_path = str_replace("[system_user]",$data["old"]["system_user"],$web_config["cgi_starter_path"]);
727727
if (is_dir($cgi_starter_path))

0 commit comments

Comments
 (0)