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
Helmo
ISPConfig 3
Commits
ab256189
Verified
Commit
ab256189
authored
Feb 15, 2021
by
JanThiel
Browse files
Fixes
ispconfig/ispconfig3#6052
Skip possible IO extensive operations for vhostalias creation on "web" document root
parent
d0d54151
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/plugins-available/nginx_plugin.inc.php
View file @
ab256189
...
...
@@ -819,7 +819,11 @@ class nginx_plugin {
}
}
}
$app
->
system
->
exec_safe
(
'chmod -R a+r ?'
,
$data
[
'new'
][
'document_root'
]
.
'/'
.
$web_folder
.
'/'
);
// Set the a+r mod to the web_folder.
// Skip this for vhostalias if the web_folder is "web". In this case, everything is setup already from the vhost setup
if
(
$data
[
'new'
][
'type'
]
!=
'vhostalias'
||
$web_folder
!=
"web"
)
{
$app
->
system
->
exec_safe
(
'chmod -R a+r ?'
,
$data
[
'new'
][
'document_root'
]
.
'/'
.
$web_folder
.
'/'
);
}
//** Copy the error documents on update when the error document checkbox has been activated and was deactivated before
}
elseif
(
$this
->
action
==
'update'
&&
(
$data
[
'new'
][
'type'
]
==
'vhost'
||
$data
[
'new'
][
'type'
]
==
'vhostsubdomain'
||
$data
[
'new'
][
'type'
]
==
'vhostalias'
)
&&
$data
[
'old'
][
'errordocs'
]
==
0
&&
$data
[
'new'
][
'errordocs'
]
==
1
)
{
...
...
@@ -874,7 +878,10 @@ class nginx_plugin {
if
(
$this
->
action
==
'insert'
||
$data
[
"new"
][
"system_user"
]
!=
$data
[
"old"
][
"system_user"
])
{
// Chown and chmod the directories below the document root
$app
->
system
->
exec_safe
(
'chown -R ?:? ?'
,
$username
,
$groupname
,
$data
[
'new'
][
'document_root'
]
.
'/'
.
$web_folder
);
// Skip this for vhostalias if the web_folder is "web". In this case, everything is setup already from the vhost setup
if
(
$data
[
'new'
][
'type'
]
!=
'vhostalias'
||
$web_folder
!=
"web"
)
{
$app
->
system
->
exec_safe
(
'chown -R ?:? ?'
,
$username
,
$groupname
,
$data
[
'new'
][
'document_root'
]
.
'/'
.
$web_folder
);
}
// The document root itself has to be owned by root in normal level and by the web owner in security level 20
if
(
$web_config
[
'security_level'
]
==
20
)
{
$app
->
system
->
exec_safe
(
'chown ?:? ?'
,
$username
,
$groupname
,
$data
[
'new'
][
'document_root'
]
.
'/'
.
$web_folder
);
...
...
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