Koozali.org: home of the SME Server

Webshare come ibays

Offline jonrox

  • **
  • 49
  • +0/-0
Webshare come ibays
« on: August 09, 2010, 02:01:27 PM »
Ciao a tutti, ho un quesito da porvi, ho installato webshare sul mio sme e tutto funziona per il meglio, volevo però far in modo che la cartella opt/webshare dove vengono creati i vari spazi fosse residente in un ibays in modo tale che sia possibile mappare l'unità sui pc.
Qualcuno sa aiutarmi?
Grazie

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #1 on: August 09, 2010, 02:16:35 PM »
ciao
quello che vuoi è fattibile con un custom template, ma non è semplice per una questione di permessi.

prova a vedere se il contrib smeserver-shared-folders può fare al caso tuo

Offline jonrox

  • **
  • 49
  • +0/-0
Re: Webshare come ibays
« Reply #2 on: August 09, 2010, 07:39:09 PM »
L'ho provato solo che non è che mi soddisfi a pieno... proverò a fare delle altre prove.
Grazie cmq per la dritta.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #3 on: August 09, 2010, 07:44:25 PM »
allora spiega la tua esigenza, che è meglio :-) (Cit.)

Offline jonrox

  • **
  • 49
  • +0/-0
Re: Webshare come ibays
« Reply #4 on: August 09, 2010, 08:04:12 PM »
Devrei creare delle cartelle accessibili da web e mappate in rete. in modo tale che i miei collaboratori dall'esterno uppino i vari lavori nella propria cartella e che io in ufficio riesca accedere come un comune ibay. Il problema è che vorrei una pagina di caricamento file come fa webshare in modo che l'utente veda i file caricati nella propria cartella e che sia di facile comprensione.
Webshare farebbe ciò che ho bisogno, solo che non so come mappare in rete le cartelle per un'accesso rapito.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #5 on: August 09, 2010, 10:38:02 PM »
ciao

allora.. ho giochicchiato un po' con il contrib in oggetto

quello che vuoi fare tu è possibile, come detto, con un custom template e un po' di lavoro :-)

iniziamo: creiamo la directory per il template e ci spostiamo li dentro

Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

a questo punto creiamo un file
Code: [Select]
pico 86WebSharealias

e questo deve essere il contenuto:
Code: [Select]
{
    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";
    }
}

a questo punto è necessario:
- creare un ibay che abbia il nome di una directory di webshare (es. prova), dandogli accesso web senza password ed abilitando php
- dare il comando
Code: [Select]
db WebShare setprop prova UseIbay yes SmeUsers yes

ed ora espandiamo il template e riavviamo il servizio
Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart

in questo modo si punterà all'ibay prova e si usareanno gli utenti di SME per accedere (se non voluto, mettere SmeUsers no)

poi:
Code: [Select]
cd /opt/webshare/prova
cp -a ./* /home/e-smith/ibays/prova/html/
cd /home/e-smith/files/ibays/prova/html
rm index.html

a questo punto, nella directory, c'è una subdir che si chiama files.. dobbiamo però far puntare files a /home/e-smith/files/ibays/prova/files, ergo
Code: [Select]
mv ./files ./files.old
ln -s ../files

se tutto è andato bene, entrando in

https://tuoserver/webshare/prova
 ed autenticandoti con uno degli utenti di SME (o di webshare, a seconda di come si è scelto) si ha accesso ia web alla stessa dir che è disponibile via samba su \\tuoserver\prova\files

non ho provato molto, quindi sta a te verificare se tutto è ok

fammi sapere

Ciao

Offline jonrox

  • **
  • 49
  • +0/-0
Re: Webshare come ibays
« Reply #6 on: August 10, 2010, 06:28:32 PM »
Grazie per la spiegazione, oggi  non ho avuto il tempo di provare, domani cmq mi ci dedico e ti faccio sapere.

Offline jonrox

  • **
  • 49
  • +0/-0
Re: Webshare come ibays
« Reply #7 on: August 10, 2010, 06:43:26 PM »
ho controllato un pò, è possibile far puntare l'ibay direttamente sulla cartella webshare principale in modo da riuscire a vedere tutti i gli spazi creati ed evitare perciò di crearni un ibay per ogni spazio?

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #8 on: August 10, 2010, 07:05:32 PM »
possibile è possibile, ma a questo punto ti conviene fare un custom template per samba per esporre la directory /opt/webshare.
in questo caso considerqa che devi gestire i permessi e che da samba vedi tutto, compresi i file/dir necessari alla gestione di webshare
 se vuoi puoi modificare il fragment che ti ho incollato sopra per farlo puntare non ad una ibay ma a una subdir della stessa..

ti lascio fare qualche esercizio di fantasia e di test.. in ogni caso son qua

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Webshare come ibays
« Reply #9 on: January 24, 2012, 10:17:09 PM »
Firstly my apologies for my use of english in here I do not speak Italian..and the topic here is exactly what I want to do and is not discussed in the english forums. There is a bug submitted HERE

On a 8.9b7 installation using the details here and in the Webshare contrib to setup and use Webshare with ibays & SME users I have been unable to get it to work, the custom template causes an error in http and no web access is possible.

While the basic install of Webshare is OK using Webshare with ibays & SME users fails, has anyone been able to get it to work, if yes how?

Thank You
--
qui scribit bis legit

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #10 on: January 24, 2012, 11:05:39 PM »
Trex, you should tell us exactly the error message.. :-)
please open a new topic in 8.x section, and remember to add the error message in the bug report
thank you

Offline FrancescoC

  • ****
  • 226
  • +0/-0
Re: Webshare come ibays
« Reply #11 on: April 26, 2012, 05:42:39 PM »
Io  dopo aver dato

expand-template /etc/httpd/conf/httpd.conf
service httpd-e-smith restart

non visualizzo più le pagine web  , come mai?
Grazie

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Webshare come ibays
« Reply #12 on: April 26, 2012, 05:53:35 PM »
non ne ho idea e ho la sfera di cristallo guasta.. prova a guardare nei log (/var/log/httpd/error_log per cominciare) e riporta l'eventuale messaggio di errore

inoltre sarebbe bello sapere cosa hai fatto, perchè nessuno di noi possiede le arti divinatorie della parapsicologia :-)

Offline FrancescoC

  • ****
  • 226
  • +0/-0
Re: Webshare come ibays
« Reply #13 on: April 26, 2012, 06:29:27 PM »
Hai perfettamente  ragione ma come al solito le dita sono più veloci del cervello  :smile: !
Ho installato da ieri uno SME 7.5.1 e l'ho modificato per accedere ai contrib come scritto sul forum. Quando vado a installare il contrib Webshare tutto ok , ma quando vado  a modificarlo per far si che un ibay lo colleghi a una webshare mi salta tutta la parte web e il file  /var/log/httpd/error_log    dice:                   

[Thu Apr 26 18:13:41 2012] [warn] RSA server certificate CommonName (CN) `serve$
[Thu Apr 26 18:13:41 2012] [notice] Digest: generating secret for digest authen$
[Thu Apr 26 18:13:41 2012] [notice] Digest: done
[Thu Apr 26 18:13:45 2012] [warn] RSA server certificate CommonName (CN) `serve$
[Thu Apr 26 18:13:45 2012] [notice] Apache configured -- resuming normal operat$
[Thu Apr 26 18:17:10 2012] [notice] Graceful restart requested, doing restart
[Thu Apr 26 18:17:10 2012] [notice] Digest: generating secret for digest authen$
[Thu Apr 26 18:17:10 2012] [notice] Digest: done
[Thu Apr 26 18:17:10 2012] [warn] RSA server certificate CommonName (CN) `serve$
[Thu Apr 26 18:17:10 2012] [notice] Apache configured -- resuming normal operat$
[Thu Apr 26 18:19:28 2012] [notice] Graceful restart requested, doing restart
[Thu Apr 26 18:19:28 2012] [warn] The Alias directive in /etc/httpd/conf/httpd.$
Syntax error on line 822 of /etc/httpd/conf/httpd.conf:
AuthUserFile takes 1-2 arguments, text file containing user IDs and passwords

Offline FrancescoC

  • ****
  • 226
  • +0/-0
Re: Webshare come ibays
« Reply #14 on: April 26, 2012, 06:44:12 PM »
La riga 822 recita:

    AuthName "Restricted test access only"

 :???: