Koozali.org: home of the SME Server

User web pages

raymondh

User web pages
« on: December 29, 2002, 08:20:22 PM »
I have installed and followed the mini howto for http://khunjarnet.com/downloads/user-web-space/e-smith-user-webspace-0.1-3.noarch.rpm

User's can save a htm document to their public_html but the file has the wrong permissions (-rw-re----).  Also, it won't let users upload images.

Does anyone know what the problem could be?

raymondh

Re: User web pages
« Reply #1 on: December 30, 2002, 06:20:33 AM »
As an alternative, is there a way to automatically create an i-bay for each user like it does for email?

Abe Loveless

Re: User web pages
« Reply #2 on: December 30, 2002, 08:35:15 PM »
I ran into this same problem.  I ended up writing a Perl script to reset all the permissions on the web directories.  It runs every 5 minutes... so a user can edit their files, and in 5 min it'll be viewable on the web.

This probably isn't the best way to solve the problem (In fact, I'm sure it isn't).... but it's working for me.

http://www.tech-geeks.org/contrib/loveless/chmod-webdirs/

One thing to note, is that currently the admin mailbox will get flooded with notices every 5 minutes about the chmod-webdir script running.  But setting up your email client's filters should alleviate that headache.

Hope this helps,
Abe

Kirk Ferguson

Re: User web pages
« Reply #3 on: January 14, 2003, 10:13:09 PM »
I had this problem also.  The protections on the users' public_html dir have to allow apache access, and when the user saves files they have to inherit the directory permissions.  I wanted to allow user web pages only on a case by case basis, so I wrote this script to accept a username and set up the web space.  The index.html I copy in is empty.

Hope this helps.  I'm new at this, so no guarantees about the security aspects.


#!/bin/bash
echo
echo "Creating home/public_html directory for user "$1"..."
mkdir /home/e-smith/files/users/$1/home/public_html
echo "Setting permissions..."
chmod 755 /home/e-smith/files/users/$1
chown $1 /home/e-smith/files/users/$1/home/public_html
chgrp www /home/e-smith/files/users/$1/home/public_html
chmod g+rws /home/e-smith/files/users/$1/home/public_html
cp index.html /home/e-smith/files/users/$1/home/public_html
chown $1 /home/e-smith/files/users/$1/home/public_html/index.html
chmod 660 /home/e-smith/files/users/$1/home/public_html/index.html
echo "Done, thanks for playing..."
echo