View previous topic :: View next topic |
Author |
Message |
hellraiser Guru
Joined: 14 Jun 2003 Posts: 431 Location: Pescara [Italy]
|
Posted: Thu Oct 09, 2003 3:39 pm Post subject: [Server Web] URL---> dir |
|
|
allora ho un piccolo server web da finire di configurare...ora vi spiego la mia esigenza da soddisfare
Example:
allora in /home/httpd/ ho "gentoo" e "kernel"
queste due dir sarebbero tutte le pagine html di quei due siti....
in modo che possano essere consultate off-line in LAN
ora pero per raggiungere questi due PATH, nel Browser devo scrivere "http://localhost/gentoo/" o "http://localhost/kernel"
mentre io vorrei che semplicemente scrivendo http://www.gentoo.org mi visualizzi quella dir...
come posso fare ??
mi hanno consigliato l'alias, ma penso che non vadi bene...
penso di dover configurare apache, con i virtual hosting e magari configurare i DNS
ke mi dite ??
_________________ Io non sono nessuno...ma nessuno è come me!
"Open Source is a good idea..." |
|
Back to top |
|
|
DuDe Guru
Joined: 04 Dec 2002 Posts: 314 Location: Roma Italy
|
Posted: Thu Oct 09, 2003 4:38 pm Post subject: |
|
|
A mio avviso, lo puoi fare solo se gestisci un tuo dns interno, dovresti crearti una zona gentoo.org cosi' come kernel.org, poi all'interno di queste zone crei un HOST record che contiene l'ip del server che ospita tali mirror, e che sia chiama www, poi nella tua zona ( esempio pippo.com) metti un cname (alias) per www.gentoo.org e per www.kernel.org che puntano alla machina che ospita i mirror.
Altro non mi viene in mente _________________ mount -t brain /dev/brain /body/skull |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Thu Oct 09, 2003 5:05 pm Post subject: |
|
|
Metti l'indirizzo che ti interessa nel file host, e associalo all'indirizzo ip 127.0.0.1
Poi setta ServerName in modo appropriato nel virtualhost di apache. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
hellraiser Guru
Joined: 14 Jun 2003 Posts: 431 Location: Pescara [Italy]
|
Posted: Thu Oct 09, 2003 6:28 pm Post subject: |
|
|
allora ho fatto dei piccoli passi in avanti...
allora in vhost.conf ho settato questo
<VirtualHost 192.168.0.1>
ServerName gentoo.inferno.org
DocumentRoot "/home/www/gentoo/"
TransferLog /home/www/logs/gentoo.inferno.org_access
ErrorLog /home/www/logs/gentoo.inferno.org_error
</VirtuaLHost>
Logicamente modificando anke /etc/hosts del mio client-PC sono riuscito a risolvere l'indirizzo e a visualizzare almeno la prima pagina...
pero non è quello che volevo io....
infatti io volevo ottenere qualkosa come www.gentoo.org
così ho provveduto a modificare i suddetti file di prima in modo che debbano risolvere www.gentoo.org
ma quando dal browser provo tale URL....dice "the server refused connection"
da ke dipende ??
come posso fare ??
HELP ME
_________________ Io non sono nessuno...ma nessuno è come me!
"Open Source is a good idea..." |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Thu Oct 09, 2003 8:26 pm Post subject: |
|
|
Controlla i log! _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
hellraiser Guru
Joined: 14 Jun 2003 Posts: 431 Location: Pescara [Italy]
|
Posted: Fri Oct 10, 2003 11:14 am Post subject: |
|
|
i log sono muti
non so da cosa dipende...
_________________ Io non sono nessuno...ma nessuno è come me!
"Open Source is a good idea..." |
|
Back to top |
|
|
Ginko Guru
Joined: 01 May 2002 Posts: 371 Location: nearby my linux laptop
|
Posted: Fri Oct 10, 2003 12:04 pm Post subject: |
|
|
Mi sembra che la soluzione piu' elegante ed efficiente sia utilizzare mod_rewrite di Apache. Lo trovi qui e e qualche esempio lo trovi qui.
In pratica ti basta la seguente configurazione di Apache mod_rewrite :
Code: | RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.gentoo.org$
RewriteRule ^/(.*) http://localhost/gentoo [L,R]
RewriteCond %{HTTP_HOST} ^www.kernel.org$
RewriteRule ^/(.*) http://localhost/kernel [L,R] |
[EDIT] L'ho appena provato e funziona perfettamente, pero' hai anche bisogno di mettere www.gentoo.org e www.kernel.org nel file /etc/hosts assieme a localhost (127.0.0.1)
Saluti
--Gianluca |
|
Back to top |
|
|
cerri Bodhisattva
Joined: 05 Mar 2003 Posts: 2957 Location: # init S
|
Posted: Fri Oct 10, 2003 6:33 pm Post subject: |
|
|
I log sono quelli di apache, credo che siano in /var/log.
Forse si dovrebbe chiamare error.log.
Puoi trovare i tuoi logfiles nel file di configurazione. _________________ Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito |
|
Back to top |
|
|
|