Main Server and Virtual Hosts (Apache)

P@nos ngeorg at nxmail.gr
Mon Nov 22 11:04:39 EET 2004



> On Sun, 21 Nov 2004 17:58:49 +0200, P at nos wrote:
> > >> An zhthso apo ton server to www.mainserver.gr tha mou servirei to 1o
> > >> virtual host pou einai dhlomeno sto vh.conf. (an antistrepso thn
seira
> > twn
> > >> v1 kai v2 sto vh.conf, apanta pali to 1o). An den kano include to
vh.conf
> > >> tha apanthsei to www.mainserver.gr kanonika apo thn dhlosh tou ston
main
> > >> server.
> > # MY VIRTUAL HOSTS
> >
> > NameVirtualHost 192.168.0.3
> >
> > <VirtualHost 192.168.0.3>
> >        ServerAdmin admin at asfaleia.gr
> >         ServerName www.asfaleia.gr
> >         DocumentRoot "/srv/www/www.asfaleia.gr/htdocs/"
> > </VirtualHost>
> >
> > <VirtualHost 192.168.0.3>
> >     ServerAdmin admin at virtual1.gr
> >     ServerName www.virtual1.gr
> >     DocumentRoot "/srv/www/www.virtual1.gr/htdocs/"
> > </VirtualHost>
> >
>
>  Exeis 3exasei na oriseis virtual host gia to www.mainserver.gr. Etsi
> opws to exeis twra, default host einai to prwto pou anafereis, to
> www.asfaleia.gr.
>  Gia na elen3eis to configuration twn virtual hosts sou, mporeis na
> tre3eis httpd -S, to opoio 8a se diafwtisei.


exeis (esu h apo prohgoumeno post) kopsei to parakato pou eixa grapsei

> Den thelo na dhloso to www.mainserver.gr mesa sto vh.conf san virtual
> host. Auto pou thelo einai an zhtountai ta www.v1.gr kai www.v2.gr na
> apantoun apo to virtual host eno an zhteite to www.mainserver.gr na apanta
> apo ton main server.

(esto www.v1.gr kai www.v2.gr ta www.asfaleia.gr kai www.virtual1.gr)


> > ....to pio periergo sou eipa pio einai. Otan kano include to arxeio me
ta
> > virtual hosts to www.mainserver.gr peftei sto 1o vhost...eno an den to
kano
> > apanta kanonika apo ton mainserver...
> >
>
>  An diabazes ligo to documentation prin rwthseis, de 8a sou fainotan
> ka8olou periergo.
>

to thema einai oti auto pou rotao to brhka se biblio (Apache Server 2
Bible - Mohammed J. Kabir)... to perigrafei kapos etsi...

#httpd.conf file



ServerName main.server.com

Port 80

ServerAdmin mainguy at server.com

DocumentRoot "/www/main/htdocs"



ScriptAlias /cgi-bin/ "/www/main/cgi-bin/"

Alias /images/ "/www/main/htdocs/images/"



<VirtualHost 192.168.1.100>

ServerName vhost1.server.com

ServerAdmin vhost1_guy at vhost1.server.com

DocumentRoot "/www/vhost1/htdocs"

ScriptAlias /cgi-bin/ "/www/vhost1/cgi-bin/"

</VirtualHost>



<VirtualHost 192.168.1.110>

ServerName vhost2.server.com

ServerAdmin vhost2_guy at vhost2.server.com

DocumentRoot "/www/vhost2/htdocs"

ScriptAlias /cgi-bin/ "/www/vhost2/cgi-bin/"

Alias /images/ "/www/vhost2/htdocs/images/"

</VirtualHost>



...kai sunexizei na mou fainete periergo gi auto rotao... mporei kati na mou
exei ksefugei...



P at nos





More information about the Linux-greek-users mailing list