Koozali.org: home of the SME Server

Creating ~user webspace - mini How To

Jon Blakely

Creating ~user webspace - mini How To
« on: July 25, 2002, 06:49:27 PM »
Mini How to for creating user web space (should work on all versions)

You want to allow your users to have public web space accessable by
http://www.your_domain/~user_name

Download http://khunjarnet.com/downloads/user-web-space/e-smith-user-webspace-0.1-3.noarch.rpm

This rpm by Damien Curtain will install the custom templates required (Damien if you read this can you supply your src and I will update the rpm and create a panel)

# rpm -ivh e-smith-user-webspace-0.1-3.noarch.rpm

answer yes to the question

# mkdir /etc/e-smith/skel/user/home/public_html

# pico /etc/e-smith/events/actions/user-create-unix

find the line that says

chmod 0700, "/home/e-smith/files/users/$userName";

and change to

chmod 0755, "/home/e-smith/files/users/$userName";

^x to exit and save

you can put a default index.html in /etc/e-smith/skel/user/home/public_html
that will appear in the users webspace when the user is created

Note: this will only create user webspace for new users. Existing users
will need to be created by hand.

If at any stage you want to disable user webspace

# /sbin/e-smith/config set UserPublicWeb off
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
# service httpd restart

or to re-enable

# /sbin/e-smith/config set UserPublicWeb on
# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
# service httpd restart


Usual disclaimer: You are responsible for any changes you make to your server.

Jon

Bill Talcott

Re: Creating ~user webspace - mini How To
« Reply #1 on: July 25, 2002, 08:26:32 PM »
Jon Blakely wrote:
>
> Note: this will only create user webspace for new users.
> Existing users
> will need to be created by hand.

What exactly has to be done for this, for us Linux newbies? Just make the public_html dir?

Jon Blakely

Re: Creating ~user webspace - mini How To
« Reply #2 on: July 26, 2002, 03:37:27 AM »
Bill,

# mkdir /home/e-smith/files/users/$user/home/public_html

# chmod 755 /home/e-smith/files/users/$user

Jon

Abe Loveless

Re: Creating ~user webspace - mini How To
« Reply #3 on: August 16, 2002, 01:57:23 AM »
I keep getting an error when installing on v5.1.2

After answering "y" when installing the rpm, I get:
Useage:httpd {start|stop|restart|condrestart|status|fullstatus|graceful|configtest}
error: execution of %post scriptlet from e-smith-user-webspace-0.1-3 failed, exit status 1

After continuing with the instructions, and setting up a user I get an Access Forbidden.  I'm guessing it isn't making the changes to htttp.conf, because the directory permissions did get changed to public_html directory is set to 644.  (The user's directory is 755.)

Any ideas?

Thanks,
Abe

Abe Loveless

Re: Creating ~user webspace - mini How To
« Reply #4 on: August 16, 2002, 08:16:43 PM »
I got my permissions figured out.  User error.  However, I believe the rpm error was still important.  After adding each user, the httpd.conf template fails to expand and httpd needs restarted... otherwise, the files are not found.

I manually added the following lines to the bottom (right above the "exit(0);")of the /etc/e-smith/events/actions/user-create-unix file:

#Expand httpd.conf template for user webspace
system("/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf");
system("/etc/init.d/httpd restart");

Everything seems to be working for me, now.