Koozali.org: home of the SME Server

Web Pages for Users

Offline byte

  • *
  • 2,183
  • +2/-0
Web Pages for Users
« Reply #30 on: October 12, 2006, 03:02:06 PM »
Quote from: "unnilennium"

As now the discussion is about a contrib I suggest YOU to continue here :
http://forums.contribs.org/index.php?topic=33660.msg143772#msg143772


I have moved this topic into the Contribs forum for you. Thanks!
--[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 #31 on: October 13, 2006, 09:00:52 AM »
Taigo,

Use the template I posted a few days ago.  It works for me.

From terminal as root I did this (on one line):
pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/94UserWebPhp

Then in the window I entered this:

{
        use esmith::AccountsDB;

        $OUT = "";
        my $accounts = esmith::AccountsDB->open;
        my @users = $accounts->users;

        foreach my $user (@users)
        {
                $OUT .= "\n<Directory /home/e-smith/files/users/".$user->key."/$
                $OUT .= "    AddType application/x-httpd-php .php .php3 .phtml\$
                $OUT .= "    AddType application/x-httpd-php-source .phps\n";

                # Set the sandbox within which PHP is confined to play
                my $basedir = $user->prop('PHPBaseDir')
                    || ("/home/e-smith/files/users/" . $user->key . "/");
                $OUT .= "    php_admin_value open_basedir $basedir\n";
                $OUT .= "</Directory>\n";
        }
}

Then I saved (control x)
Then I typed expand-template /etc/httpd/conf/httpd.conf
Then I typed service httpd-e-smith restart

This will put a couple of lines in your httpd.conf for each user. I hope it works for you also.

trolljanz

Web Pages for Users
« Reply #32 on: October 13, 2006, 09:37:12 AM »
Dacky,

That was the kinda of a response I was expecting of.
I haven't tried it yet, but a million thanks  for the swift reply.



Cheers

Tiago Janz

trolljanz

Web Pages for Users
« Reply #33 on: October 13, 2006, 11:03:58 PM »
Hi Dacky,

When I try to do the expand the script yield lots of syntax warnings.
Wasn't anything chopped when published?


Cheers

Tiago Janz

trolljanz

Web Pages for Users
« Reply #34 on: October 13, 2006, 11:43:19 PM »
Gotcha


This was my exact steps to go on

Code: [Select]
pico /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/94UserWebPhp


Code: [Select]

{
    use esmith::AccountsDB;

    $OUT = "";
    my $accounts = esmith::AccountsDB->open;
    my @users = $accounts->users;

    foreach my $user (@users)
    {
        $OUT .= "\n<Directory /home/e-smith/files/users/".$user->key;
        $OUT .= "/home/public_html>\n";

        $OUT .= " AddType application/x-httpd-php";
        $OUT .= " .php .php3 .phtml\n";
        $OUT .= " AddType application/x-httpd-php-source .phps\n";

        # Set the sandbox within which PHP is confined to play
        my $tmppath = "/home/e-smith/files/users/";
        $tmppath .= $user->key . "/";
        my $basedir = $user->prop('PHPBaseDir') || ($tmppath);
        $OUT .= " php_admin_value open_basedir $basedir\n";
        $OUT .= "</Directory>\n";
    }
}


Code: [Select]

ctrl+x
tab to confirm




Code: [Select]

expand-template /etc/httpd/conf/httpd.conf


Code: [Select]

service httpd-e-smith restart



And it did work out

Offline Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Web Pages for Users
« Reply #35 on: November 03, 2006, 01:01:43 PM »
here is a nice work; i will have to publish a new release with this great steps.

trolljanz

Web Pages for Users
« Reply #36 on: November 03, 2006, 02:40:02 PM »
Im learning about sme and perl scripts, I'm doing a script  to do all these mambo jambo and  gets trigged when a user is added. But I have some compile errors. If any one wants to help me Ill post the script.

Cheers

Tiago

Offline robwellesley

  • *
  • 92
  • +0/-0
Web Pages for Users
« Reply #37 on: January 25, 2007, 01:47:51 PM »
# service httpd restart

should be

# svc -t /service/httpd-e-smith

Offline sonoracomm

  • *
  • 208
  • +0/-0
    • http://www.sonoracomm.com
Web Pages for Users
« Reply #38 on: January 29, 2007, 07:06:07 AM »
unnilennium,

Thanks very much for your update on this contrib!  It was just what I was looking for.

I see the discussion of enabling PHP for regular users.  I am not completely up to speed on PHP security issues, but I would urge caution enabling CGI for just anyone...  Maybe someone more versed in PHP security could comment on this?

I took a few notes as I was testing this out and I posted them on my web site primarily for my own benefit, but it might help others...

http://www.sonoracomm.com/index.php?option=com_content&task=view&id=146&Itemid=32

Thanks again,

G