Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] Webfsd - Il web server piccolo piccolo
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
mriya3
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2004
Posts: 124
Location: Switzerland

PostPosted: Fri Dec 10, 2004 8:40 pm    Post subject: [TIP] Webfsd - Il web server piccolo piccolo Reply with quote

Avete bisogno di un server web piccolo, leggero e facilissimo da utilizzare?
La soluzione si chiama webfsd (webfs nel portage)

Innanzitutto installiamolo:
Code:
emerge webfs


Poi da shell (anche da utente non root!) lanciamo WebFsd:
Code:
webfsd [opzioni]


E le opzioni disponibili sono:

-h Visualizza l'aiuto
-d Abilità la modalità debug
-s Scrive un log degli errori in syslog. Se mettete due volte -s si aumenterà il dettaglio dei log.
-t secondi Timeout della rete
-c n Numero massimo di connessioni per thread
-a n Dimensione della cache dei contenuti delle directory.
-y n Numero di threads da lanciare
-p porta Porta da utilizzare (default 8000)
-r directory Directory da utilizzare come root del server
-R directory Imposta la directory da usare e ci fa un chroot
-f file Usa il file specificato come indice per le directory (p.es. index.html)
-n hostname Nome dell'host (usato per le redirezioni)
-i ip Specifica l'indirizzo IP
-l logfile Specifica il file di log
-L logfile File di log che viene aggiornato ad ogni riga aggiunta (utile per un tail -f)
-m file Legge i tipi MIME dal file specificato (default /etc/mime.types)
-u user Imposta l'uid a user (possibile solo se lanciato da root)
-g gruppo Imposta gid a gruppo (solo per root)
-F Non demonizzare il server (rimanendo in foreground un CTRL+C è sufficiente per killare il server)
-b utente:password Imposta nome utente e password per l'accesso (solo un nome/password possibile)
-v Abilita i virtual hosts, per esempio se lancio il server con
Code:
webfsd -v -r /home/utente/publichtml

se cerco di accedere a http://ftp.server.net:8000/path/file, otterò /home/utente/publichtml/ftp.server.net/path/file

Buon utilizzo!
:wink:
_________________
--
http://www.mriya3.tk | http://www.mriyasoftware.com
--
"Make everything as simple as possible, but not simpler."
-- Albert Einstein
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Fri Dec 10, 2004 8:41 pm    Post subject: Reply with quote

Grazie per il fantastico tip che mi e' servito stasera :wink:
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Dhaki
Guru
Guru


Joined: 16 Jun 2004
Posts: 325
Location: Ticino - CH

PostPosted: Fri Dec 10, 2004 8:47 pm    Post subject: Reply with quote

Bello bello penso proprio che mi servirà in futuro :D
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Fri Dec 10, 2004 8:57 pm    Post subject: Reply with quote

Aggiunto ai post utilissimi sezione tips
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
rota
l33t
l33t


Joined: 13 Aug 2003
Posts: 960

PostPosted: Fri Dec 10, 2004 9:15 pm    Post subject: Reply with quote

da paura domani installo gentoo su un ibm ...e lo provvo subbito....
Back to top
View user's profile Send private message
=DvD=
Veteran
Veteran


Joined: 25 Mar 2004
Posts: 1353

PostPosted: Fri Dec 10, 2004 10:41 pm    Post subject: Reply with quote

Scusate la mia ignoranza, ma cosa ha di così bello?
(il tono non è critico, è una domanda!!)
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Fri Dec 10, 2004 10:43 pm    Post subject: Reply with quote

=DvD= wrote:
Scusate la mia ignoranza, ma cosa ha di così bello?

Che se voglio condividere file ma non avere un web server vero uso questo. Piccolo veloce da configurare.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
=DvD=
Veteran
Veteran


Joined: 25 Mar 2004
Posts: 1353

PostPosted: Fri Dec 10, 2004 10:48 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Che se voglio condividere file ma non avere un web server vero uso questo. Piccolo veloce da configurare.

Capito. :oops:
Back to top
View user's profile Send private message
gaffiere
Guru
Guru


Joined: 13 Nov 2003
Posts: 406
Location: Provincia Milano

PostPosted: Fri Dec 10, 2004 10:50 pm    Post subject: Reply with quote

poi vuoi mettere? il tutto in 49 Kb 8)

see ya
_________________
Thomaz "Gaffiere"
Middle-Earth XP2200+, 1Gb Ram, 80Gb + 160Gb Hd, SbLive!, Nvidia 6800GT AGP8x
Gentoo Gnu/Linux 2.6.12-gentoo-r10
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Fri Dec 10, 2004 10:57 pm    Post subject: Reply with quote

gaffiere wrote:
poi vuoi mettere? il tutto in 49 Kb 8)

see ya


Decisamente piú piccolo anche di DAD-IT... che tuttavia offre come plus l'essere multipiattaforma, un linguaggio pe fare pagine dinamiche (lua) e un database (sqlite)
_________________
Ciao da me!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Fri Dec 10, 2004 10:58 pm    Post subject: Reply with quote

gaffiere wrote:
poi vuoi mettere? il tutto in 49 Kb 8)

Spiego il perche' l'ho avuto bisogno. Sto installando una gentoo sul un 133 solo che il livecd di gentoo non parte troppa poca ram. Allora cd debian passo alla console solo che mi accorgo che non ha il bunzip questo cd. Scarico sul mio notebook lo stage bunzippo gzippo e faccio partire il server e wgetto lo stage sul pc dove sto installando (chiaramente ssh inesistente sul cd di debian)
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Dhaki
Guru
Guru


Joined: 16 Jun 2004
Posts: 325
Location: Ticino - CH

PostPosted: Sat Jan 15, 2005 8:02 pm    Post subject: Reply with quote

Dhaki wrote:
Bello bello penso proprio che mi servirà in futuro :D

Infatti l'ho appena installato e lo sto usando come alternativa allo scambio file in msn :D
Back to top
View user's profile Send private message
hardskinone
Guru
Guru


Joined: 02 Jan 2004
Posts: 460

PostPosted: Sat Jan 15, 2005 8:28 pm    Post subject: Reply with quote

Segnalo anche lighttp come alternativa ad apache (php o php-cgi, virtual hosts, chroot, ha quasi tutto).
_________________
Playlinux.net
Back to top
View user's profile Send private message
power83
l33t
l33t


Joined: 28 Nov 2004
Posts: 638

PostPosted: Thu Feb 10, 2005 12:08 am    Post subject: Reply with quote

ma xke' siete contro apache?

che ha che nn v piace?

va meglio la 2 o l'1.3?

esiste in gentoo un how to x apache?
Back to top
View user's profile Send private message
unz
l33t
l33t


Joined: 28 Jul 2004
Posts: 819
Location: Roma, Italia

PostPosted: Thu Feb 10, 2005 1:14 am    Post subject: Reply with quote

lo emergi e quando sta per finire guardi bene le info che ti da ... basta ed avanza per farlo funzionare ... apache2 va benissimo
_________________
Ma che c'hai là? Sulla spalla!!!! http://lascimmia.it/
Back to top
View user's profile Send private message
.:deadhead:.
Advocate
Advocate


Joined: 25 Nov 2003
Posts: 2963
Location: Milano, Italy

PostPosted: Thu Feb 10, 2005 10:19 am    Post subject: Reply with quote

power83 wrote:
ma xke' siete contro apache?

che ha che nn v piace?
Nessuno ce l'ha contro nessun'altro :lol:

Apache è un gran server, ma tu l'avresti usato, se fossi stato nella situazione di fedeli? Meglio usar il tool più adato alla situazione da risolvere: apache è grosso e complesso. webfsd e lighttpd invece sono veloci da installare, intuitivi nella configurazione e non sono affatto esosi di risorse...

Contribuisco anche io con l'ultimo light webserver non ancora citato: cherokee !
_________________
Proudly member of the Gentoo Documentation Project: the Italian Conspiracy ! ;)
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Tue Apr 12, 2005 8:16 am    Post subject: Reply with quote

Olà ;)
Ero un pò nel dubbio se riesumere questo thread o o iniziarne uno nuovo, nel dubbio continuo qui, al massimo i MOD mi splitteranno :P:P:P

Dunque... non avendo una macchina che posso dedicare esclusivamente come server e essendo costretto quindi a far svolgere al mio desktop mansioni serveristiche (ftp/http) e non necessitando di php, ho deciso di mettere webfsd.
Uso questo piccolo serverino da un bel pò con moltissima soddisfazione, al punto da hackarmelo per fargli includere un css nella generazione delle pagine html che visualizzano il contenuto delle dirs...
Ora... visto che sono perverso, ho voluto provare il supporto CGI
man webfsd / sito di webfsd wrote:

Recent versions also got limited CGI support (GET requests only) and optional SSL support.

Penso ... bene no? Tanto per me dovrebbe bastare e avanzare....
Mi leggo il man :
man webfsd wrote:

-x path
Use >path< as CGI directory. >path< is interpreted relative to the document root. Note that
CGI support is limited to GET requests.

Quindi edito /etc/conf.d/webfs in questo modo:
Code:

# Configuration for webfsd init script

WEBFS_PORT=80
WEBFS_DOCROOT=/var/www/localhost/htdocs
WEBFS_INDEX=index.html
WEBFS_LOG=/var/log/webfsd.log

# set server name
WEBFS_SERVNAME="Darkstar"

# uncomment to chroot to specified dir
WEBFS_CHROOT="/mnt/web/"

# max allowed connections (defaults to 32)
#WEBFS_MAXCONN=50

# uncomment to enable directory listings
WEBFS_DIR_LIST=true

# uncomment to enable SSL (you'll need to add -C <cert> -P <pass> to WEBFS_OPTS)
#WEBFS_SSL=true

# uncomment to enable ipv6
WEBFS_IPV6=true

# Add any extra options here. See webfsd for more information.
WEBFS_OPTS="-x ./cgi-bin/"

Notare che ho provato tutte le combinazioni possibili tipo: "cgi-bin ./cgi-bin cgi-bin/ /cgi-bin /cgi-bin/ ....." , ma niente... se metto degli scripts in quella dir e li rendo eseguibili, il browser mi mostra il contenuto, nient'altro...
Lo script di prova è stato questo:
Code:

darkstar web # cat cgi-bin/script
#!/bin/sh
echo -ne "Content-type: text/html\n\n<html><body>$QUERY_STRING</body></html>";

I permessi nella dir sono:
Code:

darkstar web # ls -la cgi-bin/
total 25
drwxr-xr-x  2 root root    96 Apr 11 23:18 .
drwxr-xr-x  6 root root   632 Apr 12 09:07 ..
-rwxr-xr-x  1 root root    89 Apr 11 23:12 script
-rwxr-xr-x  1 root root 20480 Apr 11 23:18 uname


Scusate il post enorme, ma volevo essere chiaro... grazie a tutti ;)
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Tue Apr 12, 2005 10:42 am    Post subject: Reply with quote

lavish wrote:
Ero un pò nel dubbio se riesumere questo thread o o iniziarne uno nuovo, nel dubbio continuo qui, al massimo i MOD mi splitteranno :P:P:P


Continua pure qui... fino a che non diventa talmente usato da generare thread da 10 pagine penso che sia meglio che tutti i commenti, i problemi e i tip striano raggruppati ;-)


Per il tuo problema, hai provato a dare un estensione .cgi o simili ai files?
_________________
Ciao da me!
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Tue Apr 12, 2005 11:13 am    Post subject: Reply with quote

randomaze wrote:
Per il tuo problema, hai provato a dare un estensione .cgi o simili ai files?

ho provato... ma non cambia nulla.. è la prima volta che provo a far qualcosa del genere... vi sembra corretto lo script?
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Wed Apr 13, 2005 9:51 am    Post subject: Reply with quote

UP

Non ho trovato nulla in google e la cosa mi sembra strana... possibile che non esista nessuno al mondo che abbia mai provato una cosa del genere? Almeno il programmatore l'avrà testato il supporto, no? :lol:
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Thu Apr 14, 2005 8:49 am    Post subject: Reply with quote

Mi sa che questo è l'ultimo UP che faccio... .diciamo che poi, andrei oltre i limiti della decenza (cosa che non mi sfagiola molto)... ieri ero tentato da un
Code:
emerge apache
ma non mi sembrava giusto nei confronti del nostro povero webserverino... non trovate?

;)
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
hardskinone
Guru
Guru


Joined: 02 Jan 2004
Posts: 460

PostPosted: Sun Jun 12, 2005 7:59 pm    Post subject: Reply with quote

Uppo questo 3d perchè ho appena trovato [url=http://nanoweb.si.kz/]questo[url] webserver implementato in PHP (!). In portage non c´è ancora un ebuild (nemmeo su bugzilla) visto che io $scusa_banale_random non posso fare ebuild qualcuno è così gentile?

Nel frattempo provo a compilare a mano manina.
_________________
Playlinux.net
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Sun Jun 12, 2005 9:03 pm    Post subject: Reply with quote

hardskinone wrote:
Uppo questo 3d perchè ho appena trovato [url=http://nanoweb.si.kz/]questo[url] webserver implementato in PHP (!). In portage non c´è ancora un ebuild (nemmeo su bugzilla) visto che io $scusa_banale_random non posso fare ebuild qualcuno è così gentile?

Nel frattempo provo a compilare a mano manina.


Mi sembra OT in questo thread... qui si parla di webfsd.
Comunque alla fine ho capito qual'era un problema. Un bug sull'implementazione del chroot.. ho risolto e patchato con un amico (a cui devo gran parte del lavoro) e la patch è stata mandata allo svilupatore

Ciau!

[EDIT] curiosità, come fai a compilarlo se è scritto in php? :P
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
Flonaldo
Guru
Guru


Joined: 21 Nov 2003
Posts: 572
Location: Bologna

PostPosted: Sun Jun 12, 2005 10:54 pm    Post subject: Reply with quote

se cerco di accedere a http://ftp.server.net:8000/path/file, otterò /home/utente/publichtml/ftp.server.net/path/file

Si ma come? ho eseguito tutto ma non mi va mica...forse faccio qualche cappella!
_________________
Odio un po' di meno gli uomini coi capelli rossi
La mia musica http://www.last.fm/user/Flonaldo/
Back to top
View user's profile Send private message
lavish
Bodhisattva
Bodhisattva


Joined: 13 Sep 2004
Posts: 4296

PostPosted: Mon Jun 13, 2005 5:30 am    Post subject: Reply with quote

Flonaldo wrote:
se cerco di accedere a http://ftp.server.net:8000/path/file, otterò /home/utente/publichtml/ftp.server.net/path/file

Si ma come? ho eseguito tutto ma non mi va mica...forse faccio qualche cappella!


Ma non puoi mica fare così 8O :? (magari si potesse :lol: )
Ponendo il caso che ftp.server.net sia la tua webroot, l'indirizzo a cui accedere a path/file sarà http://<tuo_ip>/path/file (ovviamente anche http://localhost/path/file e i redirect DNS). Riguardo alla porta, sicuro che si tratti della 8000 e non della 80?

Ciao
_________________
minimalblue.com | secgroup.github.io/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum