Changes

Jump to navigation Jump to search
3,224 bytes added ,  14:55, 28 September 2010
added section "Using with ibays & SME users"
Line 64: Line 64:  
  expand-template /etc/php.ini
 
  expand-template /etc/php.ini
 
  /etc/init.d/httpd-e-smith restart
 
  /etc/init.d/httpd-e-smith restart
 +
 +
=== Using with ibays & SME users ===
 +
 +
From this Italian forum post http://forums.contribs.org/index.php/topic,46399.msg227523.html#msg227523
 +
 +
are instructions re how to use webshare with an ibay and SME users
 +
 +
Create the custom template and fragment
 +
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
 +
pico 86WebSharealias
 +
 +
Contents of 86WebSharealias
 +
{
 +
    my $db      = esmith::ConfigDB->open_ro("WebShare")
 +
    or return "# webshare disabled\n";
 +
 +
    my @webshare = $db->get_all_by_prop( type => 'WebShare' );
 +
 +
    foreach $webshare (@webshare) {
 +
        #name
 +
        my $key = $webshare->key;
 +
        #use  ibay
 +
        my $useibay = $webshare->prop('UseIbay') || "no";
 +
        #use sme users
 +
        my $smeusers = $webshare->prop('SmeUsers') || "no";
 +
        $OUT .= "# webshare\/$key\n";
 +
 +
        if ( "$useibay" eq "no" ) {
 +
                $OUT .= "Alias \/webshare\/$key \/opt\/webshare\/$key\n";
 +
                $OUT .= "<Directory \/opt\/webshare\/$key>\n";
 +
        }
 +
        else {
 +
                $OUT .= "Alias \/webshare\/$key \/home\/e-smith\/files\/ibays\/$key\/html\n";
 +
                $OUT .= "<Directory \/home\/e-smith\/files\/ibays\/$key\/html>\n";
 +
        }
 +
        {
 +
            use esmith::util;
 +
            my $release = esmith::util::determineRelease();
 +
            if ( "$release" ge "7.0" ) {
 +
                $OUT .= "    SSLRequireSSL\n";
 +
            }
 +
            else {
 +
                $OUT .= "    RequireSSL on\n";
 +
            }
 +
        }
 +
        $OUT .= "    Options +Indexes\n";
 +
        $OUT .= "    AllowOverride None\n";
 +
        $OUT .= "    order deny,allow\n";
 +
        $OUT .= "    deny from all\n";
 +
        $OUT .= "    allow from all\n";
 +
        $OUT .= "    AuthName \"Restricted $key access only\"\n";
 +
        $OUT .= "    AuthType Basic\n";
 +
 +
        if ( "$smeusers" eq "no" ) {     
 +
                $OUT .= "    AuthUserFile \/home\/e-smith\/db\/webshare\/htpasswd.$key\n";
 +
        }
 +
        else {
 +
                $OUT .= "    AuthExternal pwauth\n";
 +
        }
 +
        $OUT .= "    Require valid-user\n";
 +
        $OUT .= "    AddType application\/x-httpd-php \.php \.php3\n";
 +
        $OUT .= "    php_flag  magic_quotes_gpc  on\n";
 +
        $OUT .= "    php_flag  track_vars        on\n";
 +
        $OUT .= "<\/Directory>\n";
 +
        $OUT .= "\n";
 +
    }
 +
}
 +
 +
Create an ibay in server manager with the name ibaywebsharename, with no password.
 +
Note ibaywebsharename should be the same as websharename and ibayname
 +
 +
Configure the db setting, expand template & restart service
 +
db WebShare setprop ibaywebsharename UseIbay yes SmeUsers yes
 +
expand-template /etc/httpd/conf/httpd.conf
 +
service httpd-e-smith restart
 +
 +
 +
Copy files from original webshare in /opt to ibay
 +
cd /opt/webshare/ibaywebsharename
 +
cp -a ./* /home/e-smith/ibays/ibaywebsharename/html/
 +
cd /home/e-smith/files/ibays/ibaywebsharename/html
 +
rm index.html
 +
 +
Create a link
 +
mv ./files ./files.old
 +
ln -s ../files
 +
 +
Access the ibay webshare via web browser with this URL (note to use https:)
 +
https://yourdomain.com/webshare/websharename
 +
 +
Access the ibay webshare files locally via samba network share
 +
\\servername\ibaywebsharename\files
 +
    
=== Additional information ===
 
=== Additional information ===
624

edits

Navigation menu