Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Zvonimir
ISPConfig 3
Commits
0ea264c1
Commit
0ea264c1
authored
Feb 14, 2009
by
tbrehm
Browse files
ISPConfig writes namevirtualhost directives.
parent
0bd37151
Changes
3
Hide whitespace changes
Inline
Side-by-side
server/conf/apache.conf.master
deleted
100644 → 0
View file @
0bd37151
NameVirtualHost *:80
NameVirtualHost *:443
server/conf/apache_ispconfig.conf.master
0 → 100644
View file @
0ea264c1
################################################
# ISPConfig Logfile configuration for vlogger
################################################
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
<tmpl_loop name="ip_adresses">
NameVirtualHost {tmpl_var name="ip_address"}:80
NameVirtualHost {tmpl_var name="ip_address"}:443
</tmpl_loop>
server/plugins-available/apache2_plugin.inc.php
View file @
0ea264c1
...
...
@@ -721,9 +721,24 @@ class apache2_plugin {
function
server_ip
(
$event_name
,
$data
)
{
global
$app
,
$conf
;
// Here we write the name virtualhost directives
// NameVirtualHost IP:80
// NameVirtualHost IP:443
// load the server configuration options
$app
->
uses
(
"getconf"
);
$web_config
=
$app
->
getconf
->
get_server_config
(
$conf
[
"server_id"
],
'web'
);
$app
->
load
(
'tpl'
);
$tpl
=
new
tpl
();
$tpl
->
newTemplate
(
"apache_ispconfig.conf.master"
);
$records
=
$app
->
db
->
queryAllRecords
(
"SELECT * FROM server_ip WHERE server_id = "
.
$conf
[
"server_id"
]
.
" AND virtualhost = 'y'"
);
if
(
count
(
$records
)
>
0
)
{
$tpl
->
setLoop
(
'ip_adresses'
,
$records
);
}
$vhost_file
=
escapeshellcmd
(
$web_config
[
"vhost_conf_dir"
]
.
'/ispconfig.conf'
);
file_put_contents
(
$vhost_file
,
$tpl
->
grab
());
$app
->
log
(
"Writing the conf file: ispconfig.conf"
,
LOGLEVEL_DEBUG
);
unset
(
$tpl
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment