[eZ publish] How to set the SSL to a node?

When I want to access a node of eZ via SSL, here are something to be done in my test envirement.

 

1. Modify the setting file

Open the file "settings/override/site.ini.append.php", add the code below :

 

[SSLZoneSettings]
SSLZones
=enabled
SSLSubtrees[]
=/news/categoryOne

Be aware to the red code, here i want to set to the node "/news/categoryOne", that is to say, when i visit the url "http://myhost/news/categoryOne", the browser will auto direct to "https://myhost/news/categoryOne".

 

2. Modify the httpd.conf

Here are the code of virtualhost.

 

代码
<VirtualHost 127.0.0.1:443>
<Directory
"/opt/lampp/htdocs/art">
Options FollowSymLinks
AllowOverride all
Allow from all
<
/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/.* - [L]
Rewriterule ^
/var/[^/]+/storage/.* - [L]
RewriteRule ^
/var/cache/texttoimage/.* - [L]
RewriteRule ^
/var/[^/]+/cache/texttoimage/.* - [L]
RewriteRule ^
/var/[^/]+/cache/public/.* - [L]
Rewriterule ^
/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
Rewriterule ^
/share/icons/.* - [L]
Rewriterule ^
/extension/[^/]+/design/[^/]+/(stylesheets|images|flash|javascripts?)/.* - [L]
Rewriterule ^
/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^
/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^
/favicon\.ico - [L]
RewriteRule ^
/robots\.txt - [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 "/opt/lampp/htdocs/art"

SSLEngine on
SSLCertificateFile
/opt/lampp/etc/ssl.crt/server.crt
SSLCertificateKeyFile /opt/lampp/etc/ssl.key/
server.key
ServerName myhost
ServerAlias myhost admin.myhost
<
/VirtualHost>

You will find that is very similar to set a common virtualhost, except the red code, because we have to access via SSL, so we have to use another port to it (Here i use the default port 443) , and also, open the SSLEngine, and set the certificate file and keyfile.

 

 

After that, you can visit https://myhost/news/categoryOne via SSL.

posted @ 2010-07-05 17:18  DavidHHuan  阅读(449)  评论(0编辑  收藏  举报