Re: virtualhost: both http and https too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > So, do I need add new https virtualhost config to default-ssl? or merge
> > ssl config to http virtual host?
> 
> So, I've done exactly the same config file for http virtualhost and the
> rendering of browser is ok. I've added (debian) new https virtualhost to
> /etc/apache/site-available but the rendering of browsers has incorrect.
> 
> You can show both sites going:
> 
> http://www.mokaccino.it/index.php (works)
> https://www.mokaccino.it/index.php (bad)

I see two problems with the https site.

One, the SSL certificate is for pineappleweb.it, so you get a certificate
error when you try to load it.

Two, the page is trying to load some scripts by HTTP instead of HTTPS, for
example:

	<script type="text/javascript" src="http://www.mokaccino.it/js/jquery.carouFredSel-6.2.1-packed.js";></script>
	<script type="text/javascript" src="http://www.mokaccino.it/js/jquery.min.js";></script>
	<script type="text/javascript" src="http://www.mokaccino.it/js/jquery.mobile.customized.min.js";></script>
	<script type="text/javascript" src="http://www.mokaccino.it/js/jquery.easing.1.3.js";></script> 
	<script type="text/javascript" src="http://www.mokaccino.it/js/camera.min.js";></script> 

Most browsers won't load HTTP content within an HTTPS page, because they
consider it insecure.  Some (IE, Firefox?) will pop up a dialog to ask the
user if they want to load unsafe content.  Chrome won't load the scripts by
default, but it adds a little shield icon in the URL bar where the user can
ask to "Load unsafe scripts".

So that's why your page looks wrong in HTTPS, at least in Chrome - it's not
loading your scripts, because they're HTTP and not HTTPS.  Once I tell Chrome
to load the unsafe scripts, the HTTPS page looks just like the HTTP one.

To make your page work in both HTTP and HTTPS, the best solution is to take
away the protocol and hostname in the src attributes:

	<script type="text/javascript" src="/js/jquery.carouFredSel-6.2.1-packed.js"></script>
	<script type="text/javascript" src="/js/jquery.min.js"></script>
	<script type="text/javascript" src="/js/jquery.mobile.customized.min.js"></script>
	<script type="text/javascript" src="/js/jquery.easing.1.3.js"></script> 
	<script type="text/javascript" src="/js/camera.min.js"></script> 

Good luck,
Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux