ispCP - Board - Support
[Howto] Automatic https and http for the same domain - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Contributions Area (/forum-40.html)
+--- Forum: Howtos (/forum-41.html)
+--- Thread: [Howto] Automatic https and http for the same domain (/thread-7262.html)

Pages: 1 2


[Howto] Automatic https and http for the same domain - aseques - 07-20-2009 07:06 PM

I had a request from a customer asking for a typical setup with ssl and not ssl virtualhosts
Basically in the default layout, it creates a ssl enabled folder, and the content there can ONLY be viewed under ssl.
What I did was to alter the ispcp-dmn-mngr so this folder gets created and ready to use.
The other part is to alter the apache templates, so it can serve both contents.
NOTE:
This setup will work with ONE certificate for the whole server, so there will be warnings about wrong certicates.
The ssl part is useful only if you want to have a LowCost SSL area. The other part is mostly useful so your customers can access without knowing the ip/hostname of the server.

I put together a page on the wiki explaining the details, it shoud be easy to follow, even on a already installed system.
http://www.isp-control.net/documentation/howto/both_https_and_not_https_when_creating_a_domain

Please post any problems suggestions about this in this thread.
This has been tested with 1.0.3.1 and 1.0.4 branch, it might work in older setups too, but it's not recommended.

Cheers.

UPDATE
This is the patched ispcp-dmn-mngr for 1.0.4
[attachment=1188]

This is the OLD patched ispcp-dmn-mngr for 1.0.3.1
[attachment=1189]

Notes
There used to be a patch here, but after the bind error in 1.0.3.1 (http://www.isp-control.net/forum/thread-9117.html) I updated the posted ispcp-dmn-mngr to match the stable one.


RE: [Howto] Automatic https and http for the same domain - esmiz - 12-11-2009 02:22 PM

Hello Aseques

Do you know if would it be possible to get ssl and non ssl content in the same folder?
I mean without creating an extra folder.

Beste regards


RE: [Howto] Automatic https and http for the same domain - aseques - 12-11-2009 07:22 PM

(12-11-2009 02:22 PM)esmiz Wrote:  Hello Aseques

Do you know if would it be possible to get ssl and non ssl content in the same folder?
I mean without creating an extra folder.

Beste regards

I created this method to help with a migration from plesk, and this is the way it works over there.
To be able to view the content both in ssl and not ssl, it's even simpler. You should do the following:
.- Don't patch the ispcp-dmn-mngr (and so the htsdocs folder won't be created)
.- Modify the apache 443 virtualhost so it reads the content of the folder htdocs instead of htsdocs

That should work, you won't be able to restrict to ssl only for any part of the site tough.

Cheers


RE: [Howto] Automatic https and http for the same domain - kilburn - 12-15-2009 05:50 PM

Great mod aseques! Thanks!

Quote:That should work, you won't be able to restrict to ssl only for any part of the site tough.

Easy to do with mod_rewrite, just google for it Wink


RE: [Howto] Automatic https and http for the same domain - esmiz - 12-16-2009 04:48 AM

Many thanks for the answers guys.

P.D. Hi Kilburn, Why do you have such a name? Are you from Kilburn London NW?
I lived there for 5 years some time ago


RE: [Howto] Automatic https and http for the same domain - kilburn - 12-16-2009 05:53 PM

(12-16-2009 04:48 AM)esmiz Wrote:  P.D. Hi Kilburn, Why do you have such a name? Are you from Kilburn London NW?
I lived there for 5 years some time ago

No, I'm not. I chose this nick *many* years ago, before knowing that such a city existed. Despite that, I managed to go there and take some photos when I went to visit some friends from Manchester! Big Grin


RE: [Howto] Automatic https and http for the same domain - mwlake - 02-13-2010 02:22 AM

Tried to apply this patch using:
/var/www/ispcp# patch -p0 -i ispcp_dmn_mngr_htsdocs.patch
result was:
patching file engine/ispcp-dmn-mngr
Hunk #1 FAILED at 1693.
1 out of 1 hunk FAILED -- saving rejects to file engine/ispcp-dmn-mngr.rej

Using: ISPCP 1.0.3-1 on Ubuntu 8.04 LTS

Any help would be appreciated


RE: [Howto] Automatic https and http for the same domain - aseques - 02-13-2010 02:49 AM

(02-13-2010 02:22 AM)mwlake Wrote:  Tried to apply this patch using:
/var/www/ispcp# patch -p0 -i ispcp_dmn_mngr_htsdocs.patch
result was:
patching file engine/ispcp-dmn-mngr
Hunk #1 FAILED at 1693.
1 out of 1 hunk FAILED -- saving rejects to file engine/ispcp-dmn-mngr.rej

Using: ISPCP 1.0.3-1 on Ubuntu 8.04 LTS

Any help would be appreciated
It would help to reply you if you allowed the people to send PM to you Smile

In any case I updated the post with the already patched version.


RE: [Howto] Automatic https and http for the same domain - marauder - 03-06-2010 05:13 AM

@aseques; can update it to the new version please? Smile


RE: [Howto] Automatic https and http for the same domain - merykonil - 03-08-2010 03:52 PM

You mention that “the downside of this approach is that there will be separate cached copies for both the HTTP and HTTPS based URLs. If a vistor to your site first uses a non-secure HTTP based URL and then switches to HTTPS they would have to download fresh copies of resources that had already been accessed over HTTP.”