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 setup -- Configuration du mode 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 à 23h32
versions 4.4-
This section describes how to set up a virtual host for eZ Publish using the Apache webserver. A virtual host setup is only needed if eZ Publish has been configured to use the host access method, which is the most secure method.
Ce chapitre décrit la mise en œuvre, avec le serveur web Apache, un hôte virtuel pour un site eZ Publish. La configuration d'un hôte virtuel n'est nécessaire que si eZ Publish a été configuré pour utiliser la méthode d'accès par hôte, ce qui représente la méthode la plus sécurisée.
By making use of virtual hosts, it is possible to have several sites running on the same server. The sites are usually differentiated by the name they are accessed. Apache will look for a specified set of domains and use different configuration settings based on the domain that is accessed.
L'utilisation d'un hôte virtuel permet de faire tourner plusieurs sites sur un même serveur. Les sites sont normalement différenciés par le nom avec lequel on accède à eux. Apache recherchera le domaine spécifié et utilisera les paramètres de configuration relatifs à ce domaine.
Generic virtual host setup / Configuration générique d'un hôte virtuel
Virtual hosts are usually defined at the end of "httpd.conf", which is the main configuration file for Apache. Adding a virtual host for eZ Publish can be done by copying the following lines and replacing the text encapsulated by the square brackets with actual values. Please refer to the next section for a real life example of using virtual hosts.
Les hôtes virtuels sont généralement définis à la fin du fichier principal de configuration du serveur Apache: httpd.conf. Pour ajouter un hôte virtuel pour un site eZ Publish il faut y copier les lignes ci-dessous et remplacer le texte placé entre crochets ("[" et "]") par des valeurs réelles. Reportez-vous au prochain article de cette section pour un exemple concret d'utilisation d'hôtes virtuels.
NameVirtualHost [IP_ADDRESS] <VirtualHost [IP_ADDRESS]:[PORT]> <Directory [PATH_TO_EZPUBLISH]> 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 ^/([^/]+/)?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 your favicon to be served # from the standard design. You can customize the path to # favicon.ico by changing /design/standard/images/favicon\.ico #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 [PATH_TO_EZPUBLISH] ServerName [SERVER_NAME] ServerAlias [SERVER_ALIAS] </VirtualHost>
| [IP_ADDRESS] |
The IP address of the virtual host, for example "128.39.140.28". Apache allows the usage of a wildcards here ("*"). L'adresse IP de l'hôte virtuel, par exemple 128.39.140.28. Apache autorise ici l'usage des caractères spéciaux ("*"). |
| [PORT] |
The port on which the webserver listens for incoming requests. This is an optional setting, the default port is 80. The combination of an IP address and a port is often referred to as a socket. Apache allows the usage of a wildcards here ("*"). Le port sur lequel le serveur écoute les requêtes entrantes. Ceci est un paramètre optionnel, le port par défaut étant le port 80. La combinaison d'une adresse IP et d'un port est souvent appelée socket. Apache autorise ici l'usage des caractères spéciaux ("*"). |
| [PATH_TO_EZPUBLISH] |
Path to the directory that contains eZ publish. This must be the full path, for example "/var/www/ezpublish-3.6.0". Chemin vers le répertoire contenant eZ publish. Ce doit être le chemin complet (ou absolu), par exemple: "/var/www/ezpublish-3.6.0". |
| [SERVER_NAME] |
The host or the IP address that Apache should look for. If a match is found, the virtual host settings will be used. L'hôte ou l'adresse IP que Apache doit rechercher. Si une correspondance est trouvée, la configuration relative à l'hôte virtuel sera utilisée. |
| [SERVER_ALIAS] |
Additional hosts/IP addresses that Apache should look for. If a match is found, the virtual host settings will be used. Hôte ou adresse IP additionnels qu'Apache devra rechercher. Si une correspondance est trouvée, la configuration relative à l'hôte virtuel sera utilisée. |
Please note that the "mod_rewrite" module must be enabled in "httpd.conf" in order to use the Rewrite Rules.
Retenez que le module mod_rewrite doit être activé dans le fichier de configuration httpd.conf afin de pouvoir utiliser les règles de réécritures.
NameVirtualHost / La directive NameVirtualHost
The "NameVirtualHost" setting might already exist in the default configuration. Defining a new one will result in a conflict. If Apache reports errors such as "NameVirtualHost [IP_ADDRESS] has no VirtualHosts" or "Mixing * ports and non-* ports with a NameVirtualHost address is not supported", try skipping the NameVirtualHost line. For more info about the NameVirtualHost directive, see http://httpd.apache.org/docs/1.3/mod/core.html#namevirtualhost
Si la directive NameVirtualHost existe déjà dans votre configuration par défaut, en définir une nouvelle produira un conflit. Si Apache repporte une erreur telle que:
NameVirtualHost [IP_ADDRESS] has no VirtualHosts
ou bien
Mixing * ports and non-* ports with a NameVirtualHost address is not supported
essayez alors de supprimer la ligne «NameVirtualHost». Pour de plus amples informations sur cette directive repportez-vous à sa documentation : NameVirtualHost .
SOAP and WebDAV
If you would like to use the SOAP and/or the WebDAV features of eZ publish, you'll have to add the following lines in the virtual host configuration:
Si vous souhaitez utiliser SOAP et/ou la fonction
WebDAV
de eZ publish, vous devrez ajouter les lignes suivantes à votre configuration d'hôte virtuel:
RewriteCond %{HTTP_HOST} ^webdav\..* RewriteRule ^(.*) /webdav.php [L] RewriteCond %{HTTP_HOST} ^soap\..* RewriteRule ^(.*) /soap.php [L] ServerAlias soap.example.com ServerAlias webdav.example.com
Optional re-write rules to improve performance / Règles optionnelles de réécriture pour améliorer les performances
# Everything below is optional to improve performance by forcing
# clients to cache image and design files, change the expires time
# to suite project needs.
<IfModule mod_expires.c>
<LocationMatch "^/var/[^/]+/storage/images/.*">
# eZ Publish appends the version number to image URL (ezimage
# datatype) so when an image is updated, its URL changes to
ExpiresActive on
ExpiresDefault "now plus 10 years"
</LocationMatch>
<LocationMatch "^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?|flash)/.*">
# A good optimization if you don't change your design often
ExpiresActive on
ExpiresDefault "now plus 5 days"
</LocationMatch>
<LocationMatch "^/extension/[^/]+/design/[^/]+/lib/.*">
# Libraries get a new url (version number) on updates
ExpiresActive on
ExpiresDefault "now plus 90 days"
</LocationMatch>
<LocationMatch "^/design/[^/]+/(stylesheets|images|javascripts?|lib|flash)/.*">
# Same as above for bundled eZ Publish designs
ExpiresActive on
ExpiresDefault "now plus 7 days"
</LocationMatch>
<LocationMatch "^/share/icons/.*">
# Icons as used by admin interface, barly change
ExpiresActive on
ExpiresDefault "now plus 7 days"
</LocationMatch>
# When ezjscore.ini/[Packer]/AppendLastModifiedTime=enabled
# so that file names change when source files are modified
#<LocationMatch "^/var/[^/]+/cache/public/.*">
# Force ezjscore packer js/css files to be cached 30 days
# at client side
#ExpiresActive on
#ExpiresDefault "now plus 30 days"
#</LocationMatch>
</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














