Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISPConfig
ISPConfig 3
Commits
c6a89c8b
Commit
c6a89c8b
authored
Sep 08, 2011
by
tbrehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: FS#1653 - Subdomains and wildcard main domain
parent
5ef60a7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
10 deletions
+34
-10
server/plugins-available/apache2_plugin.inc.php
server/plugins-available/apache2_plugin.inc.php
+34
-10
No files found.
server/plugins-available/apache2_plugin.inc.php
View file @
c6a89c8b
...
...
@@ -897,24 +897,48 @@ class apache2_plugin {
*/
$this
->
_patchVhostWebdav
(
$vhost_file
,
$data
[
'new'
][
'document_root'
]
.
'/webdav'
);
// Set the symlink to enable the vhost
//* Set the symlink to enable the vhost
//* First we check if there is a old type of symlink and remove it
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/'
.
$data
[
'new'
][
'domain'
]
.
'.vhost'
);
if
(
is_link
(
$vhost_symlink
))
unlink
(
$vhost_symlink
);
//* Remove old or changed symlinks
if
(
$data
[
'new'
][
'subdomain'
]
!=
$data
[
'old'
][
'subdomain'
]
or
$data
[
'new'
][
'active'
]
==
'n'
)
{
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/900-'
.
$data
[
'new'
][
'domain'
]
.
'.vhost'
);
if
(
is_link
(
$vhost_symlink
))
{
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/100-'
.
$data
[
'new'
][
'domain'
]
.
'.vhost'
);
if
(
is_link
(
$vhost_symlink
))
{
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
}
//* New symlink
if
(
$data
[
'new'
][
'subdomain'
]
==
'*'
)
{
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/900-'
.
$data
[
'new'
][
'domain'
]
.
'.vhost'
);
}
else
{
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/100-'
.
$data
[
'new'
][
'domain'
]
.
'.vhost'
);
}
if
(
$data
[
'new'
][
'active'
]
==
'y'
&&
!
is_link
(
$vhost_symlink
))
{
symlink
(
$vhost_file
,
$vhost_symlink
);
$app
->
log
(
'Creating symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
// Remove the symlink, if site is inactive
if
(
$data
[
'new'
][
'active'
]
==
'n'
&&
is_link
(
$vhost_symlink
))
{
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
// remove old symlink and vhost file, if domain name of the site has changed
if
(
$this
->
action
==
'update'
&&
$data
[
'old'
][
'domain'
]
!=
''
&&
$data
[
'new'
][
'domain'
]
!=
$data
[
'old'
][
'domain'
])
{
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/'
.
$data
[
'old'
][
'domain'
]
.
'.vhost'
);
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/900-'
.
$data
[
'old'
][
'domain'
]
.
'.vhost'
);
if
(
is_link
(
$vhost_symlink
))
{
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
$vhost_symlink
=
escapeshellcmd
(
$web_config
[
'vhost_conf_enabled_dir'
]
.
'/100-'
.
$data
[
'old'
][
'domain'
]
.
'.vhost'
);
if
(
is_link
(
$vhost_symlink
))
{
unlink
(
$vhost_symlink
);
$app
->
log
(
'Removing symlink: '
.
$vhost_symlink
.
'->'
.
$vhost_file
,
LOGLEVEL_DEBUG
);
}
$vhost_file
=
escapeshellcmd
(
$web_config
[
'vhost_conf_dir'
]
.
'/'
.
$data
[
'old'
][
'domain'
]
.
'.vhost'
);
unlink
(
$vhost_file
);
$app
->
log
(
'Removing file: '
.
$vhost_file
,
LOGLEVEL_DEBUG
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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