Koozali.org: home of the SME Server

Web Pages for Users

Dacky

Web Pages for Users
« on: September 07, 2006, 11:19:00 AM »
I am trying to figure out how to get the ibays to be web pages for individual users of our sme 7 server.  I see hints and examples on the web site, but no clear directions.  I cannot download one script mentioned because it is not available (userwebpage or something like that).  I figured out how to have a main web site for the whole domain.  This is what I want to do:

Allow users to ftp to a file folder for storing files
Allow users to create their own web pages

We are a school and have one domain.  It would be nice to give this option to our students for educational purposes.  What are the clear steps to allow this to happen?

How to exactly set up an ibay to do these two things.

Thanks.

fern

Re: Web Pages for Users
« Reply #1 on: September 07, 2006, 12:32:28 PM »
Dacky

> Allow users to ftp to a file folder for storing files

That feature already exists, user home folders
Enable ftp access in server manager then
ftp://username@ftp.yourdomain.com

see also chapter on ibays

You can use that feature in conjunction with this contrib to direct users to a certain folder or ibay
http://mirror.contribs.org/smeserver//contribs/dungog/packages/smeserver/7.0/i386/RPMS.dungog/smeserver-remoteuseraccess-1.2-6.noarch.rpm


> Allow users to create their own web pages

The userwebpage contrib is the way to do this.
I don't know if the contrib that is available works on sme7 yet.


> How to exactly set up an ibay to do these two things.

Setting up ibay to have independant folders for different students could be done but it would be a lot of extra work & maintenance, which is already done with the sme server user controls.


The webshare contrib may also be of interest

http://mirror.contribs.org/smeserver//contribs/dmay/smeserver/7.x/

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Web Pages for Users
« Reply #2 on: September 07, 2006, 01:36:45 PM »
Dacky

This might be what you want, quoting from wherever I got it from.


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.

# 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.

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

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


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.
...

Offline JonB

  • *
  • 351
  • +0/-0
Web Pages for Users
« Reply #3 on: September 07, 2006, 02:24:25 PM »
That RPM no longer exists on my website and hasn't for a couple of years. I don't even have a copy of it.

Jon
...

Offline raem

  • *
  • 3,972
  • +4/-0
Web Pages for Users
« Reply #4 on: September 07, 2006, 02:33:04 PM »
JonB

> That RPM no longer exists on my website...

OK, I found it on pagefault .org, but it won't download from there either.

I have it in my archives, if you want it Dacky, I'll post it somewhere or email it to you, let me know.
...

Offline JonB

  • *
  • 351
  • +0/-0
Web Pages for Users
« Reply #5 on: September 07, 2006, 02:56:05 PM »
Ray,

You got me thinking and I found it in a very old backup. I have put it up on my website

http://khunjarnet.com/downloads/user-web-space/

WARNING: This has been not tested on SME7. In fact I have not used it since E-Smith V5. Use at your own risk.

Jon
...

Offline byte

  • *
  • 2,183
  • +2/-0
Web Pages for Users
« Reply #6 on: September 07, 2006, 02:56:08 PM »
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Dacky

Is this OK?
« Reply #7 on: September 07, 2006, 03:35:08 PM »
Thanks, this is what I think we need.
I followed the ancient directions and the following was generated.  Is this OK?  And did it work?  It appears to me that there might be a problem with httpd.  If this script could be updated, it would be helpful to schools who want to use SME and allow students to develop skills in web page creation.

The response (sorry for including this, but it might mean something):

You now have the option to enable user web directories.

Would you like to enable User Directories? (y/N): y
WARNING in /etc/e-smith/templates//etc/httpd/conf/httpd.conf/90e-smithAccess50userdir: *WARNING* esmith::config(/home/e-smith/accounts) called with old database path. The following package needs to be updated:  at /usr/lib/perl5/site_perl/esmith/config.pm line 374
        esmith::config::TIEHASH('esmith::config', '/home/e-smith/accounts') called at /etc/e-smith/templates//etc/httpd/conf/httpd.conf/90e-smithAccess50userdir line 6
        eval 'package esmith::__TEMPLATE__::1; ;
#line 1 /etc/e-smith/templates//etc/httpd/conf/httpd.conf/90e-smithAccess50userdir

    my %conf;
    tie %conf, \'esmith::config\';

    my %accounts;
    tie %accounts, \'esmith::config\', \'/home/e-smith/accounts\';

    my $key;
    my $value;
    my $result = "";

    # Global user dir assignments. Give ~user access
    # Turned on/off globally through the var UserPublicWeb
    # eg. to turn on  run /sbin/e-smith/config set UserPublicWeb on
    #     to turn off run /sbin/e-smith/config set UserPublicWeb off
    if(defined($conf{\'UserPublicWeb\'}) && ($conf{\'UserPublicWeb\'} eq "on"))
    {
        $result .= "#-------------------------------------------------------\\n";
        $result .= "# Alias to enable /user aswell as /~user access\\n";
        $result .= "#-------------------------------------------------------\\n";
        while (($key,$value) = each %accounts)
        {
            my ($type, %properties) = split (/\\|/, $value, -1);
            if ($type eq \'user\')
            {
                $result .= "Alias /$key /home/e-smith/files/users/$key/home/public_html\\n";
            }
        }

        $result .= "\\n";
        $result .= "#-------------------------------------------------------\\n";
        $result .= "#Generic user dir access directive\\n";
        $result .= "#-------------------------------------------------------\\n";
        $result .= "<Directory /home/e-smith/files/users/*/home/public_html>\\n";
        $result .= "    AllowOverride FileInfo AuthConfig Limit\\n";
        $result .= "    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec\\n";
        $result .= "    <Limit GET POST OPTIONS PROPFIND>\\n";
        $result .= "        Order allow,deny\\n";
        $result .= "        Allow from all\\n";
        $result .= "    </Limit>\\n";
        $result .= "    <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>\\n";
        $result .= "        Order deny,allow\\n";
        $result .= "        Deny from all\\n";
        $result .= "    </Limit>\\n";
        $result .= "</Directory>\\n";
    }
    $result;
;' called at /usr/lib/perl5/vendor_perl/5.8.5/Text/Template.pm line 319
        Text::Template::fill_in('Text::Template=HASH(0x923e2d8)', 'HASH', 'ARRAY(0x90b9b20)', 'PACKAGE', 'esmith::__TEMPLATE__::1', 'BROKEN', 'CODE(0x9157410)', 'UNTAINT', 1, ...) called at /usr/lib/perl5/vendor_perl/5.8.5/Text/Template.pm line 382
        Text::Template::fill_in_file('/etc/e-smith/templates//etc/httpd/conf/httpd.conf/90e-smithAc...', 'HASH', 'ARRAY(0x90b9b20)', 'PACKAGE', 'esmith::__TEMPLATE__::1', 'BROKEN', 'CODE(0x9157410)', 'UNTAINT', 1, ...) called at /usr/lib/perl5/site_perl/esmith/templates.pm line 528
        esmith::templates::processTemplate('HASH(0x8e812ec)') called at /sbin/e-smith/expand-template line 45
WARNING: Template processing succeeded for //etc/httpd/conf/httpd.conf: 1 fragment generated warnings
 at /sbin/e-smith/expand-template line 45
'httpd' is not a valid service name

Offline byte

  • *
  • 2,183
  • +2/-0
Web Pages for Users
« Reply #8 on: September 07, 2006, 04:12:44 PM »
On first look this...

/home/e-smith/accounts

needs to point to...

/home/e-smith/db/accounts
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline byte

  • *
  • 2,183
  • +2/-0
Web Pages for Users
« Reply #9 on: September 07, 2006, 04:16:27 PM »
On second look this...

esmith::config

needs to be changed to...

esmith::ConfigDB

as the first is no longer used.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Dacky

Web Pages for Users
« Reply #10 on: September 08, 2006, 04:36:18 AM »
Part of the script worked in that a public_html folder did appear in the user's home directory.  However, it messed up the httpd.conf file, so I had to reset the template (a nice thing I like about this system).  And now I have the server back working.  So, part of the rpm works.  If anyone is knowledgeable enough to redo this plugin, it would be great for people like us.  I don't know how to build an rpm or modify the script well enough to make it work.  It certainly could be useful for people.  I'll look forward to good news in the future :lol: .

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Web Pages for Users
« Reply #11 on: September 08, 2006, 09:36:03 AM »
it would be easier with a src.rpm or with the spec file...

if anyone has it.

but the answer seem to be NO, regarding what said JonB

Offline raem

  • *
  • 3,972
  • +4/-0
Web Pages for Users
« Reply #12 on: September 08, 2006, 10:48:13 AM »
unnilennium

> it would be easier with a src.rpm or with the spec file...

I have put a request through to Damien Curtain the last packager.
...

Offline byte

  • *
  • 2,183
  • +2/-0
Web Pages for Users
« Reply #13 on: September 08, 2006, 01:11:41 PM »
Quote from: "RayMitchell"
unnilennium

> it would be easier with a src.rpm or with the spec file...

I have put a request through to Damien Curtain the last packager.


Or look at his site...

http://www.pagefault.org/download/rpms/SRPMS/e-smith-user-webspace-0.1-3.src.rpm


this is a working link
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Web Pages for Users
« Reply #14 on: September 08, 2006, 04:37:56 PM »
ok i am working on it ...

a little to debug and i am trying to add a little more security to the sme7 release: id est i don't find that chmod 755 a user dir is a good thing... as after every other users will be able to see personal information thanks to the ftp if they are not chroot on their home folder...
what do you  think about this.



here is the first SME7 release http://www.pialasse.com/RPMS with the sources

read the txt=> i have automatized some task that you had to do manually with the old version


PS:is there a way to upload the work on a contribs.org directory ?