1.1 --- a/tools/Apache/config.py Tue Sep 06 23:02:21 2005 +0000
1.2 +++ b/tools/Apache/config.py Fri Sep 09 20:47:25 2005 +0000
1.3 @@ -146,27 +146,28 @@
1.4
1.5 # Find the user who should own the sessions directory.
1.6
1.7 - try:
1.8 - import pwd
1.9 - username = apache_server.get_user_from_config()
1.10 - if username is None:
1.11 - print "Not able to determine the Web server user."
1.12 - else:
1.13 - print "Found", username, "as the Web server user."
1.14 - try:
1.15 - t = pwd.getpwnam(username)
1.16 - uid, gid = t[2:4]
1.17 - answer = raw_input("Set %s, %s as user, group on the sessions directory? (Y|N) " % (uid, gid))
1.18 - if answer.upper() == "Y":
1.19 - os.chown(sessions_dir, uid, gid)
1.20 + if os.path.exists(sessions_dir):
1.21 + try:
1.22 + import pwd
1.23 + username = apache_server.get_user_from_config()
1.24 + if username is None:
1.25 + print "Not able to determine the Web server user."
1.26 + else:
1.27 + print "Found", username, "as the Web server user."
1.28 + try:
1.29 + t = pwd.getpwnam(username)
1.30 + uid, gid = t[2:4]
1.31 + answer = raw_input("Set %s, %s as user, group on the sessions directory? (Y|N) " % (uid, gid))
1.32 + if answer.upper() == "Y":
1.33 + os.chown(sessions_dir, uid, gid)
1.34
1.35 - except KeyError:
1.36 - print "User not found in the password database."
1.37 - except OSError:
1.38 - print "Not able to change the ownership. Check your user privileges."
1.39 + except KeyError:
1.40 + print "User not found in the password database."
1.41 + except OSError:
1.42 + print "Not able to change the ownership. Check your user privileges."
1.43
1.44 - except ImportError:
1.45 - print "Not configuring the sessions directory ownership."
1.46 + except ImportError:
1.47 + print "Not configuring the sessions directory ownership."
1.48
1.49 # Check the permissions on the application.
1.50