This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » [Share] How to set the SSL to a node?
expandshrink

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

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

Monday 05 July 2010 11:21:25 am - 5 replies

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.

Modified on Monday 12 July 2010 9:17:05 am by david lee

Monday 05 July 2010 5:29:02 pm

Hi,

thank's for this tip^^ Can you make it more readable ? happy.gif Emoticon

Wednesday 12 September 2012 5:50:35 pm

Hi,

i tried to access to a node via SSL with this method but it doesn't work and i don' know why... all the site is in HTTPS, not only myFolder

Here is the code in "settings/override/site.ini.append.php" :

[SSLZoneSettings]
SSLZones=enabled
SSLSubtrees[]=/myFolder

 

and in the virtualhost :

<VirtualHost 172.148.71.104:80>
    <Directory /var/www/ezpublish.website.com>
        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 ^/favicon\.ico - [L]
        RewriteRule ^/design/standard/images/favicon\.ico - [L]
        RewriteRule ^/robots\.txt - [L]
        RewriteRule ^/w3c/p3p\.xml - [L]
        RewriteRule .* /index\.php
    </IfModule>
    DocumentRoot /var/www/ezpublish.website.com
    ServerName ezpublish.website.com
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
   
</VirtualHost>

 

Can you help me ?

Thanks in advance.

Anthony

Modified on Wednesday 12 September 2012 5:52:49 pm by Anthony M.

Wednesday 12 September 2012 6:17:35 pm

Hi,

You didn't do any of the changement proposed by David Lee in the first post on your vhost.

Thursday 13 September 2012 9:40:05 am

Sorry, the good vhost is :

<VirtualHost 172.148.71.104:443>
    <Directory /var/www/ezpublish.website.com>
        Options FollowSymLinks
        AllowOverride None
    </Directory>
   
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/server.crt
    SSLCertificateKeyFile /etc/apache2/ssl/server.key
    <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 ^/favicon\.ico - [L]
        RewriteRule ^/design/standard/images/favicon\.ico - [L]
        RewriteRule ^/robots\.txt - [L]
        RewriteRule ^/w3c/p3p\.xml - [L]
        RewriteRule .* /index\.php
    </IfModule>
    DocumentRoot /var/www/ezpublish.website.com
    ServerName ezpublish.website.com
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
</VirtualHost>

 

Thanks a lot.

Thursday 13 September 2012 2:18:43 pm

Now it's work but i used "SSLSubtrees[]=/myFolder1/myFolder2".

With just one folder, it doesn't work, i don't understand why...

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from