Skip to content

Commit

Permalink
update some permissions structure;
Browse files Browse the repository at this point in the history
"
  • Loading branch information
usmannasir committed Feb 20, 2020
1 parent 07d0304 commit 9c3c2aa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plogical/vhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def createDirectories(path, virtualHostUser, pathHTML, pathLogs, confPath, compl
try:
os.makedirs(pathHTML)

command = "chown " + virtualHostUser + ":" + virtualHostUser + " " + pathHTML
command = "chown " + virtualHostUser + ":nobody " + pathHTML
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

command = "chmod 750 %s" % (pathHTML)
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

Expand Down Expand Up @@ -771,9 +775,14 @@ def createDirectoryForDomain(masterDomain, domain, phpVersion, path, administrat

try:
os.makedirs(path)
command = "chown " + virtualHostUser + ":" + virtualHostUser + " " + path
command = "chown " + virtualHostUser + ":nobody " + path
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

command = "chmod 755 %s" % (path)
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)

except OSError as msg:
logging.CyberCPLogFileWriter.writeToFile(
str(msg) + "329 [Not able to create directories for virtual host [createDirectoryForDomain]]")
Expand Down

0 comments on commit 9c3c2aa

Please sign in to comment.