Current time: 04-19-2024, 01:02 PM Hello There, Guest! (LoginRegister)


Post Reply 
Fix permisisions of /var/www/virtual/domain
Author Message
TimeRider Offline


Posts: 1
Joined: Apr 2007
Reputation: 0
Post: #1
Fix permisisions of /var/www/virtual/domain
Hi, have ran vhcs for many years, now testing this on second server, with a view to moving domains over to this.

Problem is, I have created the domains in ispcp, copied over the contents of the /var/www/virtual to the new server, is there a way to automatically fix the permissions/ownership (ownership being the issue) for many domains?

I think in vhcs set-gui-permissions covered this, but it seems in ispcp this is not the case?

Is there s script in the setup dir that will help here?

Thanks

Steve!
04-26-2009 02:12 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #2
RE: Fix permisisions of /var/www/virtual/domain
Please use search. I do remember that such scripts were posted before (I did it at least once). There is one in a topic where Nicolas improved a script that I posted (also related to VHCS migration).
Later://
Found it: http://www.isp-control.net/forum/thread-4092.html
(This post was last modified: 04-26-2009 02:55 AM by sci2tech.)
04-26-2009 02:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Lucan Offline
Member
*
Beta Team

Posts: 982
Joined: Jul 2008
Reputation: 12
Post: #3
RE: Fix permisisions of /var/www/virtual/domain
This Script was once posted:

Code:
#!/bin/bash

# Man sollte im htdocs Verzeichnis sein
# und dieses sollte dem richtigen vuXXX-User gehören
username=$(ls -ld . | cut -d" " -f3)
echo "Setze auf Benutzer: $username"
echo "Abbrechen -> Ctrl-C, sonst weiter mit Enter..."

read

# Owner setzen vu:vu
cmd="find ./ -type d -exec chown $username:$username {} ;"
#echo $cmd
($cmd)

cmd="find ./ -type f -exec chown $username:$username {} ;"
#echo $cmd
($cmd)

# Permissions setzen
cmd="find ./ -type d -exec chmod 0755 {} ;"
#echo $cmd
($cmd)

cmd="find ./ -type f -exec chmod 0644 {} ;"
#echo $cmd
($cmd)

# aber PHP Dateien etwas weniger...
cmd="find ./ -type f -regex .*\.php$ -exec chmod 0640 {} ;"
#echo $cmd
($cmd)

echo "fertig..."
echo ""

It sets the file permission and the chmod of the files.

But it have to be performed for every customer at the htdocs folder I think.

Maybe that helps you
04-26-2009 02:55 AM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #4
RE: Fix permisisions of /var/www/virtual/domain
Much better is http://www.isp-control.net/forum/thread-...#pid34811. And will fix all folders at once Wink
(This post was last modified: 04-26-2009 02:57 AM by sci2tech.)
04-26-2009 02:57 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)