Skip to content

Commit 0a466df

Browse files
committed
Added SSL website support.
1 parent 15d78a3 commit 0a466df

File tree

8 files changed

+375
-15
lines changed

8 files changed

+375
-15
lines changed

install/sql/ispconfig3.sql

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,15 +840,26 @@ CREATE TABLE `web_domain` (
840840
`system_group` varchar(255) default NULL,
841841
`hd_quota` int(11) NOT NULL default '0',
842842
`traffic_quota` int(11) NOT NULL default '0',
843-
`cgi` varchar(255) NOT NULL default 'y',
844-
`ssi` varchar(255) NOT NULL default 'y',
845-
`suexec` varchar(255) NOT NULL default 'y',
843+
`cgi` char(1) NOT NULL default 'y',
844+
`ssi` char(1) NOT NULL default 'y',
845+
`suexec` char(1) NOT NULL default 'y',
846846
`php` varchar(255) NOT NULL default 'y',
847847
`redirect_type` varchar(255) default NULL,
848848
`redirect_path` varchar(255) default NULL,
849+
`ssl` enum('n','y') NOT NULL default 'n',
850+
`ssl_state` varchar(255) NOT NULL,
851+
`ssl_locality` varchar(255) NOT NULL,
852+
`ssl_organisation` varchar(255) NOT NULL,
853+
`ssl_organisation_unit` varchar(255) NOT NULL,
854+
`ssl_country` varchar(255) NOT NULL,
855+
`ssl_request` mediumtext NOT NULL,
856+
`ssl_cert` mediumtext NOT NULL,
857+
`ssl_bundle` mediumtext NOT NULL,
858+
`ssl_action` varchar(10) NOT NULL,
849859
`active` varchar(255) NOT NULL default 'y',
850860
PRIMARY KEY (`domain_id`)
851-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
861+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
862+
852863

853864
--
854865
-- Daten für Tabelle `web_domain`

interface/web/sites/form/web_domain.tform.php

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@
159159
'default' => 'y',
160160
'value' => array(0 => 'n',1 => 'y')
161161
),
162+
'ssl' => array (
163+
'datatype' => 'VARCHAR',
164+
'formtype' => 'CHECKBOX',
165+
'default' => 'y',
166+
'value' => array(0 => 'n',1 => 'y')
167+
),
162168
'php' => array (
163169
'datatype' => 'VARCHAR',
164170
'formtype' => 'SELECT',
@@ -177,6 +183,7 @@
177183
)
178184
);
179185

186+
180187
$form["tabs"]['redirect'] = array (
181188
'title' => "Redirect",
182189
'width' => 100,
@@ -188,7 +195,7 @@
188195
'redirect_type' => array (
189196
'datatype' => 'VARCHAR',
190197
'formtype' => 'SELECT',
191-
'default' => 'y',
198+
'default' => '',
192199
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
193200
),
194201
'redirect_path' => array (
@@ -205,6 +212,90 @@
205212
)
206213
);
207214

215+
$form["tabs"]['ssl'] = array (
216+
'title' => "SSL",
217+
'width' => 100,
218+
'template' => "templates/web_domain_ssl.htm",
219+
'fields' => array (
220+
##################################
221+
# Begin Datatable fields
222+
##################################
223+
'ssl_state' => array (
224+
'datatype' => 'VARCHAR',
225+
'formtype' => 'TEXT',
226+
'default' => '',
227+
'value' => '',
228+
'width' => '30',
229+
'maxlength' => '255'
230+
),
231+
'ssl_locality' => array (
232+
'datatype' => 'VARCHAR',
233+
'formtype' => 'TEXT',
234+
'default' => '',
235+
'value' => '',
236+
'width' => '30',
237+
'maxlength' => '255'
238+
),
239+
'ssl_organisation' => array (
240+
'datatype' => 'VARCHAR',
241+
'formtype' => 'TEXT',
242+
'default' => '',
243+
'value' => '',
244+
'width' => '30',
245+
'maxlength' => '255'
246+
),
247+
'ssl_organisation_unit' => array (
248+
'datatype' => 'VARCHAR',
249+
'formtype' => 'TEXT',
250+
'default' => '',
251+
'value' => '',
252+
'width' => '30',
253+
'maxlength' => '255'
254+
),
255+
'ssl_country' => array (
256+
'datatype' => 'VARCHAR',
257+
'formtype' => 'TEXT',
258+
'default' => '',
259+
'value' => '',
260+
'width' => '30',
261+
'maxlength' => '255'
262+
),
263+
'ssl_request' => array (
264+
'datatype' => 'TEXT',
265+
'formtype' => 'TEXTAREA',
266+
'default' => '',
267+
'value' => '',
268+
'cols' => '30',
269+
'rows' => '10'
270+
),
271+
'ssl_cert' => array (
272+
'datatype' => 'TEXT',
273+
'formtype' => 'TEXTAREA',
274+
'default' => '',
275+
'value' => '',
276+
'cols' => '30',
277+
'rows' => '10'
278+
),
279+
'ssl_bundle' => array (
280+
'datatype' => 'TEXT',
281+
'formtype' => 'TEXTAREA',
282+
'default' => '',
283+
'value' => '',
284+
'cols' => '30',
285+
'rows' => '10'
286+
),
287+
'ssl_action' => array (
288+
'datatype' => 'VARCHAR',
289+
'formtype' => 'SELECT',
290+
'default' => '',
291+
'value' => array('' => 'None', 'save' => 'Save Certificate', 'create' => 'Create Certificate')
292+
),
293+
##################################
294+
# ENDE Datatable fields
295+
##################################
296+
)
297+
);
298+
208299
if($_SESSION["s"]["user"]["typ"] == 'admin') {
209300

210301
$form["tabs"]['advanced'] = array (

interface/web/sites/lib/lang/en_web_domain.lng

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<?php
2+
$wb["ssl_state_txt"] = 'State';
3+
$wb["ssl_locality_txt"] = 'Locality';
4+
$wb["ssl_organisation_txt"] = 'Organisation';
5+
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
6+
$wb["ssl_country_txt"] = 'Country';
7+
$wb["ssl_request_txt"] = 'SSL Request';
8+
$wb["ssl_cert_txt"] = 'SSL Certificate';
9+
$wb["ssl_bundle_txt"] = 'SSL Bundle';
10+
$wb["ssl_action_txt"] = 'SSL Action';
11+
$wb["btn_save_txt"] = 'Save';
12+
$wb["btn_cancel_txt"] = 'Cancel';
213
$wb["server_id_txt"] = 'Server';
314
$wb["domain_txt"] = 'Domain';
415
$wb["type_txt"] = 'Type';
516
$wb["parent_domain_id_txt"] = 'Parent Website';
617
$wb["redirect_type_txt"] = 'Redirect Type';
718
$wb["redirect_path_txt"] = 'Redirect Path';
819
$wb["active_txt"] = 'Active';
9-
$wb["btn_save_txt"] = 'Save';
10-
$wb["btn_cancel_txt"] = 'Cancel';
1120
$wb["document_root_txt"] = 'Documentroot';
1221
$wb["system_user_txt"] = 'Linux User';
1322
$wb["system_group_txt"] = 'Linux Group';
@@ -17,6 +26,7 @@ $wb["hd_quota_txt"] = 'Harddisk Quota';
1726
$wb["traffic_quota_txt"] = 'Traffic Quaota';
1827
$wb["cgi_txt"] = 'CGI';
1928
$wb["ssi_txt"] = 'SSI';
29+
$wb["ssl_txt"] = 'SSL';
2030
$wb["suexec_txt"] = 'SuEXEC';
2131
$wb["php_txt"] = 'PHP';
2232
$wb["client_txt"] = 'Client';

interface/web/sites/templates/web_domain_edit.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
<td class="frmText11">{tmpl_var name='suexec_txt'}:</td>
7676
<td class="frmText11">{tmpl_var name='suexec'}</td>
7777
</tr>
78+
<tr>
79+
<td class="frmText11">{tmpl_var name='ssl_txt'}:</td>
80+
<td class="frmText11">{tmpl_var name='ssl'}</td>
81+
</tr>
7882
<tr>
7983
<td class="frmText11">{tmpl_var name='php_txt'}:</td>
8084
<td class="frmText11">
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<table width="500" border="0" cellspacing="0" cellpadding="2">
2+
<tr>
3+
<td class="frmText11">{tmpl_var name='ssl_state_txt'}:</td>
4+
<td class="frmText11"><input name="ssl_state" type="text" class="text" value="{tmpl_var name='ssl_state'}" size="30" maxlength="255"></td>
5+
</tr>
6+
<tr>
7+
<td class="frmText11">{tmpl_var name='ssl_locality_txt'}:</td>
8+
<td class="frmText11"><input name="ssl_locality" type="text" class="text" value="{tmpl_var name='ssl_locality'}" size="30" maxlength="255"></td>
9+
</tr>
10+
<tr>
11+
<td class="frmText11">{tmpl_var name='ssl_organisation_txt'}:</td>
12+
<td class="frmText11"><input name="ssl_organisation" type="text" class="text" value="{tmpl_var name='ssl_organisation'}" size="30" maxlength="255"></td>
13+
</tr>
14+
<tr>
15+
<td class="frmText11">{tmpl_var name='ssl_organisation_unit_txt'}:</td>
16+
<td class="frmText11"><input name="ssl_organisation_unit" type="text" class="text" value="{tmpl_var name='ssl_organisation_unit'}" size="30" maxlength="255"></td>
17+
</tr>
18+
<tr>
19+
<td class="frmText11">{tmpl_var name='ssl_country_txt'}:</td>
20+
<td class="frmText11"><input name="ssl_country" type="text" class="text" value="{tmpl_var name='ssl_country'}" size="30" maxlength="255"></td>
21+
</tr>
22+
<tr>
23+
<td class="frmText11">{tmpl_var name='ssl_request_txt'}:</td>
24+
<td class="frmText11"><textarea name='ssl_request' cols='30' rows='10'>{tmpl_var name='ssl_request'}</textarea></td>
25+
</tr>
26+
<tr>
27+
<td class="frmText11">{tmpl_var name='ssl_cert_txt'}:</td>
28+
<td class="frmText11"><textarea name='ssl_cert' cols='30' rows='10'>{tmpl_var name='ssl_cert'}</textarea></td>
29+
</tr>
30+
<tr>
31+
<td class="frmText11">{tmpl_var name='ssl_bundle_txt'}:</td>
32+
<td class="frmText11"><textarea name='ssl_bundle' cols='30' rows='10'>{tmpl_var name='ssl_bundle'}</textarea></td>
33+
</tr>
34+
<tr>
35+
<td class="frmText11">{tmpl_var name='ssl_action_txt'}:</td>
36+
<td class="frmText11">
37+
<select name="ssl_action" class="text">
38+
{tmpl_var name='ssl_action'}
39+
</select>
40+
</td>
41+
</tr> <tr>
42+
<td class="frmText11">&nbsp;</td>
43+
<td class="frmText11">&nbsp;</td>
44+
</tr>
45+
<tr>
46+
<td>&nbsp;</td>
47+
<td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><div class="buttonEnding"></div>&nbsp;
48+
<input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><div class="buttonEnding"></div>
49+
</td>
50+
</tr>
51+
</table>
52+
<input type="hidden" name="id" value="{tmpl_var name='id'}">

server/conf/apache.conf.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11

22
NameVirtualHost *:80
3+
NameVirtualHost *:443

server/conf/vhost.conf.master

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# NameVirtualHost *:80
21

32
<VirtualHost <tmpl_var name='ip_address'>:80>
43
DocumentRoot <tmpl_var name='web_document_root'>
@@ -56,4 +55,71 @@
5655
</tmpl_loop>
5756
</tmpl_if>
5857

59-
</VirtualHost>
58+
</VirtualHost>
59+
60+
61+
62+
<tmpl_if name='ssl' op='==' value='y'>
63+
###########################################################
64+
# SSL Vhost
65+
###########################################################
66+
67+
<VirtualHost <tmpl_var name='ip_address'>:443>
68+
DocumentRoot <tmpl_var name='web_document_root'>
69+
ServerName <tmpl_var name='domain'>
70+
ServerAdmin webmaster@<tmpl_var name='domain'>
71+
ErrorLog <tmpl_var name='document_root'>/log/error.log
72+
73+
ErrorDocument 400 /error/invalidSyntax.html
74+
ErrorDocument 401 /error/authorizationRequired.html
75+
ErrorDocument 403 /error/forbidden.html
76+
ErrorDocument 404 /error/fileNotFound.html
77+
ErrorDocument 405 /error/methodNotAllowed.html
78+
ErrorDocument 500 /error/internalServerError.html
79+
ErrorDocument 503 /error/overloaded.html
80+
81+
<tmpl_if name='alias'>
82+
ServerAlias <tmpl_var name='alias'>
83+
</tmpl_if>
84+
<tmpl_if name='cgi'>
85+
# cgi enabled
86+
ScriptAlias /cgi-bin/ <tmpl_var name='document_root'>/cgi-bin/
87+
AddHandler cgi-script .cgi
88+
AddHandler cgi-script .pl
89+
</tmpl_if>
90+
<tmpl_if name='ssi'>
91+
# ssi enabled
92+
AddType text/html .shtml
93+
AddOutputFilter INCLUDES .shtml
94+
</tmpl_if>
95+
<tmpl_if name='suexec'>
96+
# suexec enabled
97+
SuexecUserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
98+
</tmpl_if>
99+
<tmpl_if name='php' op='==' value='mod'>
100+
# mod_php enabled
101+
AddType application/x-httpd-php .php .php3 .php4 .php5
102+
</tmpl_if>
103+
<tmpl_if name='php' op='==' value='suphp'>
104+
# suphp enabled
105+
suPHP_Engine on
106+
suPHP_UserGroup <tmpl_var name='system_user'> <tmpl_var name='system_group'>
107+
AddHandler x-httpd-php .php .php3 .php4 .php5
108+
suPHP_AddHandler x-httpd-php
109+
</tmpl_if>
110+
<tmpl_if name='php' op='==' value='cgi'>
111+
# php as cgi enabled
112+
AddType application/x-httpd-php .php .php3 .php4 .php5
113+
</tmpl_if>
114+
115+
<tmpl_if name="rewrite_enabled">
116+
RewriteEngine on
117+
<tmpl_loop name="redirects">
118+
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
119+
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
120+
</tmpl_loop>
121+
</tmpl_if>
122+
123+
</VirtualHost>
124+
125+
</tmpl_if>

0 commit comments

Comments
 (0)