Table des matières
- Introduction : les différentes méthodes d'installation d'eZ Publish
- Virtual host setup -- Configuration du mode Hôte virtuel (eZ Publish 4.4-)
- Virtual host example -- Exemple d'hôte virtuel (eZ Publish 4.4-)
- Virtual host setup -- Configuration du mode Hôte virtuel (eZ Publish 4.5+)
- Virtual host example -- Exemple d'hôte virtuel (eZ Publish 4.5+)
- Prérequis à une installation normale (3.9)
- Prérequis à une installation normale (4.0)
- Prérequis à une installation normale (4.5+)
- Installer eZ Components
- Installer eZ Components : détails de l'installation sous Linux
- Installer eZ Publish sur un système Linux/UNIX
- Installer eZ Publish avec l'assistant graphique d'installation et de configuration
- Installer eZ Publish 4.0.0 : exemple d'installation sur un système Linux / Debian
Virtual host example -- Exemple d'hôte virtuel
Date de publication: le vendredi 9 décembre 2011 à 12h23
Dernière modification: par Pascal BOYER le lundi 12 décembre 2011 à 23h49
versions 4.5+
This example demonstrates how to set up a virtual host on the Apache web server for an eZ Publish installation located in "/var/www/example". Let's say that we want to access eZ Publish by using the following URLs:
Cet article explique comment configurer un hôte virtuel sur un serveur web Apache pour une installation eZ Publish placée dans le répertoire /var/www/example. Supposons que nous voulions accéder à eZ Publish en utilisant les URI suivants:
-
http://www.example.com (actual website for public access)
c'est l'accès au site web public
-
http://admin.example.com (administration interface for the webmaster)
c'est l'accès à l'interface d'administration pour le webmestre
In order to achieve this, we need to set up both eZ Publish and the web server so that they respond correctly to the different requests.
Pour réaliser cela, nous devons configurer eZ Publish et le serveur web Apache afin qu'ils répondent correctement aux différentes requêtes.
eZ publish configuration: siteaccess settings / Configuration de eZ Publish: paramètres des siteaccess
eZ Publish needs to be configured to use the host access method. This can be done from within the web based setup wizard or by manually editing the global override for the site.ini configuration file: "/settings/override/site.ini.append.php". A typical configuration would look something like this:
eZ Publish doit être configuré afin d'utiliser la méthode d'accès par hôte. Ceci est réalisé soit à partir de l'assistant web de configuration (l'assistant graphique utilisé lors de l'installation de eZ Publish) soit en éditant manuellement le template de surcharge globale du fichier site.ini: /settings/override/ site.ini.append.php. Une configuration classique ressemble à ceci:
... [SiteAccessSettings] AvailableSiteAccessList[] AvailableSiteAccessList[]=example AvailableSiteAccessList[]=example_admin MatchOrder=host HostMatchMapItems[]=www.example.com;example HostMatchMapItems[]=admin.example.com;example_admin ...
This configuration tells eZ Publish that it should use the "example" siteaccess if a request starts with "www.example.com" and "example_admin" if the request starts with "admin.example.com". For more information about site management in eZ Publish, please refer to the Site management part of the "Concepts and basics" chapter.
Cette configuration (particulièrement les deux dernières lignes) indique à eZ Publish qu'il doit utiliser le siteaccess example lorsqu'une requête commence par www.example.com et le siteaccess example_admin lorsqu'elle commence par admin.example.com. Pour de plus amples informations sur la gestion du site avec eZ Publish, référez-vous à l'article
Site management -- Gestion du site (le système de siteaccess)
de la section
Concepts and basics -- Concetps et bases
.
Apache configuration: virtual host settings / Configuration de Apache: paramètres de l'hôte virtuel
Assuming that...
En supposant...
-
eZ Publish is located in "/var/www/example"
que eZ Publish soit installé dans le répertoire /var/www/example/
-
the server's IP address is 128.39.140.28
que l'adresse IP du serveur soit 128.39.140.28
-
we wish to access eZ Publish using "www.example.com" and "admin.example.com"
et que nous souhaitions accéder à eZ Publish avec les URL www.example.com et admin.example.com
...the following virtual host configuration needs to be added at the end of "http.conf":
...alors la configuration suivante de l'hôte virtuel doit être ajoutée à la fin du fichier httpd.conf:
NameVirtualHost 128.39.140.28
<VirtualHost 128.39.140.28>
<Directory /var/www/example>
Options FollowSymLinks
AllowOverride None
</Directory>
<IfModule mod_php5.c>
php_admin_flag safe_mode Off
php_admin_value register_globals 0
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value allow_call_time_pass_reference 0
</IfModule>
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/api/ /index_rest\.php [L]
RewriteRule ^/([^/]+/)?content/treemenu.* /index_treemenu\.php [L]
RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* - [L]
RewriteRule ^/var/([^/]+/)?cache/(texttoimage|public)/.* - [L]
RewriteRule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
RewriteRule ^/share/icons/.* - [L]
RewriteRule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
RewriteRule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^/var/storage/packages/.* - [L]
# Makes it possible to place your favicon at the root of your
# eZ Publish instance. It will then be served directly.
RewriteRule ^/favicon\.ico - [L]
# Uncomment the line below if you want you favicon be served from the standard design.
# You can customize the path to favicon.ico by replacing design/standard/images/favicon.ico
# by the adequate path.
#RewriteRule ^/favicon\.ico /design/standard/images/favicon\.ico [L]
RewriteRule ^/design/standard/images/favicon\.ico - [L]
# Give direct access to robots.txt for use by crawlers (Google, Bing, Spammers..)
RewriteRule ^/robots\.txt - [L]
# Platform for Privacy Preferences Project ( P3P ) related files for Internet Explorer
# More info here : http://en.wikipedia.org/wiki/P3p
RewriteRule ^/w3c/p3p\.xml - [L]
# Uncomment the following lines when using popup style debug.
# RewriteRule ^/var/cache/debug\.html.* - [L]
# RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
RewriteRule .* /index\.php
</IfModule>
DocumentRoot /var/www/example
ServerName www.example.com
ServerAlias admin.example.com
</VirtualHost>
Note that it isn't necessary to create a separate virtual host block for "admin.example.com", it can be added to the existing block using the "ServerAlias" directive.
Notez qu'il n'est pas nécessaire de créer un bloc hôte virtuel séparé pour admin.example.com qui peut être ajouté au bloc existant en utilisant la directive ServerAlias.
You can have apache1 and apache2 part in the sample vhost. That way allows to use one vhost for both servers.
Vous pouvez avoir une partie pour Apache 1 et une partie pour Apache 2 dans la configuration de l'hôte virtuel. Il est ainsi possible d'utiliser un seul hôte virtuel pour les deux serveurs.
:
Ndt: Pour toutes les versions inférieures aux versions 4 de eZ Publish, remplacez <IfModule mod_php5.c> par <IfModule mod_php4.c>
<IfModule mod_php5.c> <=== REMPLACER ICI # If you are using Apache 2, you have to use <IfModule sapi_apache2.c> # instead of <IfModule mod_php5.c>. # some parts/addons might only run safe mode on php_admin_flag safe_mode Off # security just in case php_admin_value register_globals 0 # performance php_value magic_quotes_gpc 0 # performance php_value magic_quotes_runtime 0 #http://www.php.net/manual/en/ini.core.php#ini.allow-call-time-pass-reference php_value allow_call_time_pass_reference 0 </IfModule> <IfModule sapi_apache2.c> # If you are using Apache 2, you have to use <IfModule sapi_apache2.c> # instead of <IfModule mod_php5.c>. # some parts/addons might only run safe mode on php_admin_flag safe_mode Off # security just in case php_admin_value register_globals 0 # performance php_value magic_quotes_gpc 0 # performance php_value magic_quotes_runtime 0 #http://www.php.net/manual/en/ini.core.php#ini.allow-call-time-pass-reference php_value allow_call_time_pass_reference 0 </IfModule>
Table des matières
- Introduction : les différentes méthodes d'installation d'eZ Publish
- Virtual host setup -- Configuration du mode Hôte virtuel (eZ Publish 4.4-)
- Virtual host example -- Exemple d'hôte virtuel (eZ Publish 4.4-)
- Virtual host setup -- Configuration du mode Hôte virtuel (eZ Publish 4.5+)
- Virtual host example -- Exemple d'hôte virtuel (eZ Publish 4.5+)
- Prérequis à une installation normale (3.9)
- Prérequis à une installation normale (4.0)
- Prérequis à une installation normale (4.5+)
- Installer eZ Components
- Installer eZ Components : détails de l'installation sous Linux
- Installer eZ Publish sur un système Linux/UNIX
- Installer eZ Publish avec l'assistant graphique d'installation et de configuration
- Installer eZ Publish 4.0.0 : exemple d'installation sur un système Linux / Debian
Commentaires














