[RÉSOLU]Héberger 2 sites à la fois

Mon premier site c’est celui que j’ai ajouter (copier/collé) dans mon var/www et le 2è je les ajouté dans un répertoire, voila mon vhost.conf :

[code]<VirtualHost 192.168.3.210:80>
ServerName www.domaine2.pk
DocumentRoot /var/www/domaine2/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/domaine2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
            AllowOverride None 
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch 
            Order allow,deny 
            Allow from all 
    </Directory> 

    ErrorLog /var/log/apache2/error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/access.log combined 
    ServerSignature Off 

[/code]

tu enlève l’ip et tu met ça :

[code]<VirtualHost *>
ServerName www.domaine2.pk
DocumentRoot /var/www/domaine2/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/domaine2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    ServerSignature Off

[/code]

J’ai mis “*” a la place de ladresse IP, c’est pareil: il m’ouvre la page toujours sur mon site virtuel , mais je narrive pas à accéder a mon premier site…

dans le fichier de configuration de ton permier site tu met un ‘*’ pareille

Mais vu que mon premier site ce n’est pas un vhost, où est son fichier de configuration :question: faudrait-il ke je le mette lui aussi dans un vhost :question:

oui tu le met à la suite dans le même fichier.

Finalement voila mon vhost.conf:

[code]<VirtualHost *>
ServerName www.domaine2.pk
DocumentRoot /var/www/domaine2/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/domaine2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
            AllowOverride None 
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch 
            Order allow,deny 
            Allow from all 
    </Directory> 

    ErrorLog /var/log/apache2/error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/access.log combined 
    ServerSignature Off 

<VirtualHost *>
ServerName debian
DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
            AllowOverride None 
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch 
            Order allow,deny 
            Allow from all 
    </Directory> 

    ErrorLog /var/log/apache2/error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/access.log combined 
    ServerSignature Off 

[/code]

et je narrive toujour pas à acceder a mon premier site…

Voila ce que me di apache:

[quote]debian:~# /etc/init.d/apache start
Starting web server: apache[Fri Jun 16 15:31:29 2006] [warn] default VirtualHost overlap on port 80, the first has precedence
[Fri Jun 16 15:31:29 2006] [warn] default VirtualHost overlap on port 80, the first has precedence
[Fri Jun 16 15:31:29 2006] [warn] default VirtualHost overlap on port 80, the first has precedence
.[/quote]

Tu met a la première ligne :

NameVirtualHost * et reload apache

Effectivement c’est ce qu’il me manquait, merci :smiley:

Mais j’ai encore 2 petis bugs:

-> jaariv a accéder o 2 site, ms sur mon premier site kan je midentifi et bien la page d’acceuil ne saffiche pas :confused:

-> apache me dit:

[quote]debian:~# /etc/init.d/apache start
Starting web server: apache[Fri Jun 16 15:45:32 2006] [warn] NameVirtualHost *:80 has no VirtualHosts
.[/quote]

inverse dans ta config les deux sites comme ceci :
ça changera pas ton erreur mais c plus propre.

[code]
NameVirtualHost *

<VirtualHost *>
ServerName debian
DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    ServerSignature Off

<VirtualHost *>
ServerName www.domaine2.pk
DocumentRoot /var/www/domaine2/

Options FollowSymLinks
AllowOverride None

<Directory /var/www/domaine2/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    ServerSignature Off

[/code]

Et voici une doc pour les vhost :
httpd.apache.org/docs/2.2/fr/vho … based.html

Oui sa marche :smiley:
merci !

sinon ya pas moyen de virer ce message d’erreur :question:

JE connais plus apache2 qu’apache.
et je connais pas par coeur le tree de ta configuration globale apache.
Apperemment c’est dû à un autre fichier qui inclu un autre vhost.
Faudrait le trouver et le renommer.

Je voulais juste rajouter un comment.
Si on veut se servir d’un serveur web ou tout autre serveur, il vaut mieux comprendre comment il fonctionne et lire les docs avant tout.
C’est beaucoup plus facile pour se dépanner.

J'ai fait exactement cela , au démarrage de apache (1) il me met un message d'erreur:

Code:
debian:~# /etc/init.d/apache start
Starting web server: apache[Fri Jun 16 14:08:41 2006] [warn] VirtualHost 192.168.3.210:80 overlaps with VirtualHost 192.168.3.210:80, the first has precedence, perhaps you need a NameVirtualHost directive
.
debian:~# /etc/init.d/apache restart
Restarting apache.

et l’edition du apache.conf ??!, il te faut le namevirtual host avant la déclaration de tes Vhosts… mais une seule foi…


mon apache.conf se situe dans /etc/egroupware/, le voici:

[code]# Apache and PHP configuration for eGroupWare
#
# Read /usr/share/doc/egroupware-core/phpgwapi/php-configuration.txt and
# /etc/php4/apache/php.ini about the meanings and suggested values for
# the configuration settings.  Many settings are required to have a
# certain value for eGroupWare to function reasonably, so only change
# something if you are sure.

Alias /egroupware /usr/share/egroupware

<Directory /usr/share/egroupware/>
  Options FollowSymLinks ExecCGI
  AllowOverride None
  Order allow,deny
  Allow from all
  DirectoryIndex index.html index.php
  AddHandler cgi-script .cgi
  AddDefaultCharset Off
  php_flag file_uploads on
  php_flag log_errors on
  php_flag magic_quotes_gpc on
  php_flag magic_quotes_runtime off
  php_flag register_globals off
  php_flag short_open_tag on
  php_flag track_vars on
  php_value error_reporting 'E_ALL & ~E_NOTICE'
  php_value max_execution_time 90
  php_value mbstring.func_overload 7
  php_value memory_limit 24M
  php_value session.gc_maxlifetime 1440
  php_value session.save_path /var/lib/egroupware/sessions
  php_value include_path .
  php_value open_basedir /usr/share/egroupware:/var/lib/egroupware:/tmp
  php_value upload_max_filesize 6M
</Directory>

<Directory /usr/share/egroupware/fudforum/>
  AllowOverride Limit Options
</Directory>

<Directory /usr/share/egroupware/phpsysinfo/>
  php_value open_basedir /
</Directory>[/code]

c'est celui la k'il faut éditer ?

mon apache.conf se situe dans /etc/egroupware/, le voici:

[code]# Apache and PHP configuration for eGroupWare

Read /usr/share/doc/egroupware-core/phpgwapi/php-configuration.txt and

/etc/php4/apache/php.ini about the meanings and suggested values for

the configuration settings. Many settings are required to have a

certain value for eGroupWare to function reasonably, so only change

something if you are sure.

Alias /egroupware /usr/share/egroupware

<Directory /usr/share/egroupware/>
Options FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.html index.php
AddHandler cgi-script .cgi
AddDefaultCharset Off
php_flag file_uploads on
php_flag log_errors on
php_flag magic_quotes_gpc on
php_flag magic_quotes_runtime off
php_flag register_globals off
php_flag short_open_tag on
php_flag track_vars on
php_value error_reporting 'E_ALL & ~E_NOTICE’
php_value max_execution_time 90
php_value mbstring.func_overload 7
php_value memory_limit 24M
php_value session.gc_maxlifetime 1440
php_value session.save_path /var/lib/egroupware/sessions
php_value include_path .
php_value open_basedir /usr/share/egroupware:/var/lib/egroupware:/tmp
php_value upload_max_filesize 6M

<Directory /usr/share/egroupware/fudforum/>
AllowOverride Limit Options

<Directory /usr/share/egroupware/phpsysinfo/>
php_value open_basedir /
[/code]

c’est celui la k’il faut éditer ?