Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 998
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Sun May 25, 2003 9:48 am    Post subject: apache Reply with quote

comment faire pour héberger plusieurs site avec apache.
Back to top
View user's profile Send private message
Dorgendubal
Apprentice
Apprentice


Joined: 24 Apr 2003
Posts: 231
Location: Switzerland (Zürich)

PostPosted: Sun May 25, 2003 10:01 am    Post subject: Reply with quote

tu les mets dans des répertoires différents et tu orientes tes sites vers ces répertoires. Je vois pas d'autres moyens.
Back to top
View user's profile Send private message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 998
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Sun May 25, 2003 10:09 am    Post subject: Reply with quote

oui mais c'est dans la configuration de apache que je dois le faire ou alors autre part?
Back to top
View user's profile Send private message
Dorgendubal
Apprentice
Apprentice


Joined: 24 Apr 2003
Posts: 231
Location: Switzerland (Zürich)

PostPosted: Sun May 25, 2003 10:15 am    Post subject: Reply with quote

ben le répertoire: /home/httpd/htdocs/ est le répertoire par défaut sur lequel tu te connectes en tapant localhost dans un browser (ou alors nom.domaine).

si tu crées deux répertoires : rep1 et rep2 dans /home/httpd/htdocs/ alors:
http://localhost/rep1/ pour aller sur ton site 1
http://localhost/rep2/ pour aller sur ton site 2
Back to top
View user's profile Send private message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 998
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Sun May 25, 2003 10:17 am    Post subject: Reply with quote

ah mais y a pas un moyen de faire:
http://iawl.homelinux.com pour le site 1
http://fsdl.dyndns.org pour le site 2
sur le même ordinateur bien sur
Back to top
View user's profile Send private message
Dorgendubal
Apprentice
Apprentice


Joined: 24 Apr 2003
Posts: 231
Location: Switzerland (Zürich)

PostPosted: Sun May 25, 2003 11:40 am    Post subject: Reply with quote

fb99 wrote:
ah mais y a pas un moyen de faire:
http://iawl.homelinux.com pour le site 1
http://fsdl.dyndns.org pour le site 2
sur le même ordinateur bien sur


si c'est que pour ton ordi, tu peux modifier /etc/hosts du genre:

127.0.0.1/site1 iawl.homelinux.com
127.0.0.1/site2 fsdl.dyndns.org

Je suis absolument pas sûr si ça peut marcher ... faut que t'essaies.
En tout cas:

127.0.0.1 iawl.homelinux.com devrait marcher.

ps: le problème c'est qu'ensuite chaque fois que tu voudras aller sur un site de "iawl.homelinux.com" ou "fsdl.dyndns.org", tu seras envoyé vers ton propre ordi (localhost).
Back to top
View user's profile Send private message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 998
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Sun May 25, 2003 11:42 am    Post subject: Reply with quote

ok merci.
Back to top
View user's profile Send private message
kimbo
n00b
n00b


Joined: 04 May 2003
Posts: 56
Location: aix en provence

PostPosted: Sun May 25, 2003 6:55 pm    Post subject: Reply with quote

Il est possible de creer des hotes virtuels.
Pour cela utilise la directive VIRTUAL_HOST dans le fichier de configuration d'appache.


a +
Back to top
View user's profile Send private message
arlequin
l33t
l33t


Joined: 16 Nov 2002
Posts: 707
Location: grep $USER /etc/passwd | cut -d':' -f6

PostPosted: Mon May 26, 2003 8:20 am    Post subject: Reply with quote

En fait, c'est relativement plus que simple (et comme l'a dit kimbo).
Il faut que t'aille dans le fichier /etc/apache/conf/vhost/Vhosts.conf. Là tu indique tes differents domaines.
J'ai pas le bidules sous les yeux, mais c'est ça...
_________________
J'vous dis ciao !
Au fait, ciao ça veut dire bye en anglais.
Back to top
View user's profile Send private message
sergio
Apprentice
Apprentice


Joined: 11 Jun 2002
Posts: 265
Location: Clermont Ferrand, France

PostPosted: Mon May 26, 2003 8:25 am    Post subject: Reply with quote

Tiens, voici un exemple de fichier de configuration que j'utilise courement : (j'ai masqué le nom de domaine pour des raisons de confidentialité)

Code:

################# Vhosts.conf
#This is where we store the VirtualHosts configuration.
#
#Since Apache 1.3.19, we modified the setup to include some nice tricks:
#
#- We added the User and Group directives so VirtualHosts now work with
#  suexec directive. If set, Apache will run all cgi scripts under that
#  user and group (provided the uid and gid are > 1000 for security). The
#  directories and cgi files *must* belong to that user/group for the
#  feature to work
#- We added the Setenv VLOG directive. This works in conjunction with
#  the CustomLog in common.conf. When Setenv VLOG is set, apache will
#  create a /var/log/httpd/VLOG-YYYY-MM-<ServerName>.log instead of logging
#  to access_log. Use this instead of defining a special logfile for
#  each vhost, otherwise you eat up file descriptors.
#- You can also specify a path for the VLOG for each Vhost, for example,
#  to place the logs in each user's directory. However, if you want to
#  use the file for accounting, place it in a directory owned by root,
#  otherwise the user will be able to erase it.
#- I suggest only including the ErrorLog *only* if the vhost will use
#  cgi scripts. Again, it saves file descriptors!

#This is needed for Frontpage support
#Port 80
#ServerRoot /etc/apache
#ResourceConfig /dev/null
#AccessConfig /dev/null



NameVirtualHost *

<VirtualHost *>
ServerName www.xxx.net
DocumentRoot /home/httpd/htdocs
</VirtualHost>


<VirtualHost *>
ServerName yyy.xxx.net
DocumentRoot /home/httpd/htdocs/www/yyy
</VirtualHost>

<VirtualHost *>
ServerName informatique.xxx.net
DocumentRoot /home/httpd/htdocs/www/informatique
</VirtualHost>

<VirtualHost *>
ServerName stats-agro.xxx.net
DocumentRoot /home/httpd/htdocs/www/stats-agro
ServerAlias stats-agro.xxx.com
</VirtualHost>

<VirtualHost *>
ServerName webzzz.xxx.net
DocumentRoot /home/httpd/htdocs/www/zzz
</VirtualHost>

<VirtualHost *>
ServerName metiers.xxx.net
DocumentRoot /home/httpd/htdocs/www/metiers
ServerAlias metiers.xxx.com
</VirtualHost>

<VirtualHost *>
ServerName yyy2.xxx.net
DocumentRoot /home/httpd/htdocs/www/yyy2
</VirtualHost>


Et ensuite dans le fichier apache.conf décommente la ligne suivante :

Code:

Include conf/vhosts/Vhosts.conf


Il faut bien sur qu'au niveau de ta résolution de noms (ton fichier /etc/hosts ou ton serveur DNS) que tous les noms de serveur virtuels renvoie l'adresse IP de ton serveur apache : regarde l'exemple suivant (pour BIND)

Code:

monserveur  IN A 192.x.x.x
www.xxx.net IN CNAME monserveur 
informatique.xxx.net CNAME monserveur
stats-agro.xxx.net CNAME monserveur

etc...



Mes serveurs virtuels sont tous des alias du premier...

J'espère que cet exemple pourra t'aider...

A+
Back to top
View user's profile Send private message
yuk159
Veteran
Veteran


Joined: 18 Apr 2003
Posts: 1802
Location: noumea ,nouvelle-caledonie

PostPosted: Mon May 26, 2003 10:40 am    Post subject: Reply with quote

merci sergio pour ton fichier de conf :P

sinon fb99 si ton server n'est pas un truc critique exposer au grand jour sur le net tu peux
toujours installer webmin pour configurer tout ca

mais bon c'est vrai que tu apprendra pas grand chose :)
_________________
The box said: "Requires Windows 98/2000/XP/NT, or better."
So, I installed LINUX!
Instagram
Back to top
View user's profile Send private message
crevette
Guru
Guru


Joined: 21 May 2002
Posts: 543
Location: Chrooted in Nice, France

PostPosted: Mon May 26, 2003 8:52 pm    Post subject: Reply with quote

ce qui est bien c'est que chaque site est independant et tu peux avoir des options bien spécifique

Voici un exmple avec plus d'options de mon site web

Code:

<VirtualHost 10.1.253.45>
ServerName baptiste.navlink.com
DocumentRoot /home/httpd/baptiste/src/htdocs/
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog /var/log/apache/baptiste_access_log common
ServerAdmin baptiste.mille-mathias@navlink.com
Alias /templeet.php /home/httpd/baptiste/src/htdocs/templeet.php
Alias /index.php /home/httpd/baptiste/src/htdocs/index.php
Alias /images /home/httpd/baptiste/src/htdocs/images
Alias /files /home/httpd/baptiste/src/htdocs/files
Alias /template /home/httpd/baptiste/src/htdocs/template
Alias /photos /home/httpd/baptiste/src/htdocs/photos
ErrorDocument 404 /templeet.php
ErrorDocument 403 /templeet.php
</VirtualHost>



si tu as d'autre questions n'hesites pas :)
_________________
http://www.mille-mathias.info
Back to top
View user's profile Send private message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 998
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Mon May 26, 2003 8:53 pm    Post subject: Reply with quote

merci beaucoup pour toutes vos réponses :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
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