[Share] How to set the SSL to a node?

Author Message

david lee

Monday 05 July 2010 2:21:25 am

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 bold 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 blod 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.

Yannick Komotir

Monday 05 July 2010 8:29:02 am

Hi,

thank's for this tip^^ Can you make it more readable ? :)

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:08:47
Script start
Timing: Jan 18 2025 02:08:47
Module start 'layout'
Timing: Jan 18 2025 02:08:47
Module start 'content'
Timing: Jan 18 2025 02:08:48
Module end 'content'
Timing: Jan 18 2025 02:08:48
Script end

Main resources:

Total runtime0.9093 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.3203152.6250
Module start 'layout' 0.00700.0028 741.945339.4453
Module start 'content' 0.00980.8983 781.3906542.5469
Module end 'content' 0.90810.0012 1,323.937512.1563
Script end 0.9093  1,336.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3930160.0002
Check MTime0.00170.1838160.0001
Mysql Total
Database connection0.00070.080810.0007
Mysqli_queries0.850793.5521540.0158
Looping result0.00050.0582520.0000
Template Total0.871695.920.4358
Template load0.00300.334220.0015
Template processing0.868695.518220.4343
Template load and register function0.00010.011110.0001
states
state_id_array0.00130.141310.0013
state_identifier_array0.00100.110820.0005
Override
Cache load0.00230.2576730.0000
Sytem overhead
Fetch class attribute can translate value0.00050.054120.0002
Fetch class attribute name0.00110.119240.0003
XML
Image XML parsing0.00110.120420.0005
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00090.0970220.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs