Forums / Install & configuration / A whole ez3.2 site secured by SSL, how?

A whole ez3.2 site secured by SSL, how?

Author Message

christian stampf

Thursday 09 October 2003 10:24:38 am

i was wondering if anybody has experience with setting up a ez3.2 site that works only over SSL.

i mean not only the admin section, but also the front-end (or a section of the front-end).

i am currently running on a shared host, but might move to a dedicated server once development is successful.

thanks guys!

Tony Wood

Friday 10 October 2003 2:38:47 am

Hi,

We run sites in both SSL (CA root specific and normal). eZ works on both normal and SSL connections for both admin and front end. I don't think you will have any problems.

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Vincent Saulnier

Friday 10 October 2003 6:21:42 am

How can we do to force SSL on a part of eZ like admin or user/login or a module in particular.

christian stampf

Friday 10 October 2003 9:11:04 am

that is exactly my question. how do you force SSL on the front-end. installing eZ in a SSL directory?

i would appreciate anybody telling me their experiences on how they did it. including tips on how to improve security.

- chris

Tony Wood

Friday 10 October 2003 10:49:17 am

To stop port 80, don't setup port 80 in httpd.conf

tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Vincent Saulnier

Friday 10 October 2003 11:18:16 am

On my end, what I need is to secure only parts of the Site.

I want to force SSL on those parts and force not to use SSL on the other parts.

Anybody has an idea?

Vincent Saulnier

Tuesday 14 October 2003 6:49:47 am

On an other thread I read that it could be done in Apache with ModRewrite.

I'm sure somebody did this.

Please help!

J W

Wednesday 15 October 2003 1:11:01 am

On an non-ezPublish site i would add an redirect in the httpd-config from the non-secure version to the secure one.

There i created an virtualhost:

[code]

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /path/to/www.domain.tld/
ServerName www.domain.tld
ErrorLog logs/error_log
CustomLog logs/access_log combined
RewriteEngine on
RewriteCond %{SERVER_POST} !^443$
RewriteRule ^/(.*)$ https://www.domain.tld/$1 [L,R]
</VirtualHost>

[/code]

Look at the RewriteEngine,RewriteCond and rewriteRule statement.
If someone wants to view the website through port 80, there will be an redirect to port 443, which is secure.

I didn't try this on an ezPublish installation, but i think it should be possible.

I hope this code helps... :)

Vincent Saulnier

Wednesday 15 October 2003 5:58:34 am

Thanks.

If I'm right, this code works if you want a whole domaine to be Forced SSL.

Do you know how to force only directories....
And to force back to Non-SSL for others directories?

J W

Wednesday 15 October 2003 6:10:50 am

You are right, this is for a complete domain.

I don't know how to do this for just an directory, but maybe you could do something like this:
(The following code is directly out of my head, i didn't tested it, so don't blame me if it doesn't work :-) )

[code]

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /path/to/www.domain.tld/
ServerName www.domain.tld
ErrorLog logs/error_log
CustomLog logs/access_log combined
RewriteEngine on
RewriteCond %{SERVER_POST} !^443$
RewriteRule ^/directory_that_needs_to_be_secure/(.*)$ https://www.domain.tld/directory_that_needs_to_be_secure/$1 [L,R]
RewriteCond %{SERVER_POST} !^443$
RewriteRule ^/another_directory_that_needs_to_be_secure/(.*)$ https://www.domain.tld/another_directory_that_needs_to_be_secure/$1 [L,R]
</VirtualHost>

[/code]

To do the opposite (from secure to non-secure) you must alter the virtual host from the secure site.
There you must add the following lines:

[code]

<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /path/to/www.domain.tld/
ServerName www.domain.tld
ErrorLog logs/error_log
CustomLog logs/access_log combined
RewriteEngine on
RewriteCond %{SERVER_POST} !^80$
RewriteRule ^/directory_that_needs_not_to_be_secure/(.*)$ http://www.domain.tld/directory_that_needs_not_to_be_secure/$1 [L,R]
RewriteCond %{SERVER_POST} !^80$
RewriteRule ^/another_directory_that_needs_not_to_be_secure/(.*)$ http://www.domain.tld/another_directory_not_that_not_needs_to_be_secure/$1 [L,R]
</VirtualHost>

[/code]

More detailed information can be found on http://httpd.apache.org/docs/misc/rewriteguide.html.

Vincent Saulnier

Wednesday 15 October 2003 6:26:48 am

Thanks J W,

I'll try that....

Brendan Pike

Monday 24 May 2004 9:27:24 pm

Hi I used the same rewrite in this thread to secure my ezp3 site and it worked very well. However I just discovered a very strange bug where trying to download an excel file (.xls) always ges apache 404 (file not found) errors.

.doc files work no problem so why only .xls, can anyone help?

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

eZ debug

Timing: Jan 14 2025 22:35:15
Script start
Timing: Jan 14 2025 22:35:15
Module start 'content'
Timing: Jan 14 2025 22:35:16
Module end 'content'
Timing: Jan 14 2025 22:35:16
Script end

Main resources:

Total runtime1.0930 sec
Peak memory usage6,144.0000 KB
Database Queries220

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 685.5938214.7813
Module start 'content' 0.00800.9576 900.37502,026.8359
Module end 'content' 0.96560.1273 2,927.2109642.2422
Script end 1.0929  3,569.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00700.6368210.0003
Check MTime0.00150.1342210.0001
Mysql Total
Database connection0.00090.081110.0009
Mysqli_queries0.966888.45852200.0044
Looping result0.00190.17222170.0000
Template Total1.051396.220.5257
Template load0.00380.350120.0019
Template processing1.047595.838920.5238
Template load and register function0.00110.099610.0011
states
state_id_array0.00530.489110.0053
state_identifier_array0.00110.103720.0006
Override
Cache load0.00370.3355980.0000
Sytem overhead
Fetch class attribute can translate value0.00100.091760.0002
Fetch class attribute name0.00170.1600140.0001
XML
Image XML parsing0.00130.122960.0002
class_abstraction
Instantiating content class attribute0.00000.0023160.0000
General
dbfile0.00430.3950270.0002
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 44
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs