Video Streaming using SSL on Alibaba ECS - php

I have an ECS instance on Alibaba using LetsEncrypt for SSL configuration but i have an issue with PHP Video Streaming that is not working when SSL is used where Video Link gives 404 when the streaming begins but It works fine on http.
This is the used package for streaming: http://codesamplez.com/programming/php-html5-video-streaming-tutorial
And also this Package i already used and worked fine on another servers on https
Can anyone advice what should i do?

Sometimes users have the issue that all pages get 404 errors when SSL is activated. The cause may be differ from user to user and server to server. I have also faced this issue, try to do the following to get it resolved.
1) Re-save the permalinks, Re-saving makes sure the WordPress rewrite
rules get flushed. (If you are using WordPress)
2) If you have .htaccess files in your media directories, remove them, or adapt them to the https domain.
3) Check port bindings, sometimes binding may also cause this. i.e (There is no binding for https)

Related

Wordpress website not working properly after installing SSL certificate

I have installed the SSL certificate via Cpanel to my WP website. But right after installing it the UI of the website got disturbed.
Without SSL
With SSL
Update 1
I have looked into it and found out that CSS/JS is not properly loaded. So I changed HTTP to HTTPS in my files where I was using it. But still, the issue is the same. Moreover, I am getting the below errors in my console.
Any help would be highly appreciated
Its due to references of css/images/javascript etc that are not using the SSL (https) but use HTTP instead. I recommend to install Really Simple SSL plugin for the quickest solution. Another solution is to go and fix every incorrect reference but this can be a lot of work and may in some cases need advanced knowledge (editing database entries etc.)
Check with your hosting company to properly configure HTTPS Redirects. The hosting company may ask you to install an HTTPS redirect plugin on your website. If that's work out then good if not, then go to PHPmyAdmin of your cPanel and Export your database. Open the database in Notepad++ and replace all http with https . Save the file. Delete old database tables. Import the file you saved with changes. Be aware, it might break your site, so be sure to take a backup of your database before attempting it. If things don't work out, revert the changes and take the help of a developer to fix it for you.

Unable to run node application along side of php

I'm facing two basic problem which i'm unable to rectify
1) I've a subdomain(with virtual host) with https enabled via letsencrypt, now that subdomain works great with ssl when i visit sub.domain.com and browser shows green sign
Now when i type sub.domain.com:8080 it serves my node application but as soon as i change it to https:// browser say unable to connect which is beyond my imagination how this happening.
2) When first method didn't work, I jumped to second method, on my root domain domain.com inside html folder i placed node application with url like domain.com/nodeapp now when i visit this url, it shows folder structurer with various files and folder, now as soon as i turn the port number on domain.com/nodeapp:8080/ browser shows 404 note i'm already running a php application on my root domain so it might conflict with it, but how can I solve this, We have one module which has to be in node, and we are unable to find the perfect solution.
I suppose your php application is served by an Apache web server, right? It has an extension which does the https encryption, if it is configured correctly (what letsencrypt normally does).
Your Node.js application is configured to listen on port 8080, but doesn't handle encryption automatically. Also, Letsencrypt doesn't configure it (yet) for you.
Have a look at this article how to configure encryption for Node.js by yourself.

Impossible SSL CAS-certificates with phpCAS and examples. It only works without SSL server verification

I am doing a CAS integration with a project that I am doing with my university. The final integration should be made with symfony2, however first I need to make the example code working.
I finally get working the example_simple.php example with phpCAS 1.3.2 , however the directive:
phpCAS::setNoCasServerValidation();
is the enabled one. I think I should use instead:
phpCAS::setCasServerCACert($cas_server_ca_cert_path);
However when I enable this second one (and disable the other) then the authorization does not work anymore. Here is the relevant output line error of the log:
could not open URL 'https://cas_server.fi/cas/serviceValidate?service=http%3A%2F%2Flocalhost%2Fphpcas2%2Fdocs%2Fexamples%2Fexample_simple.php&ticket=ST-115606-M1Omd1cHWzbLbmxa1nYV-cas' to validate (CURL error #60: SSL certificate problem: unable to get local issuer certificate) [Client.php:2763]
The cas server provided me two .crt files:
MYCASRootCA.crt
MYCASLinuxSUBCA.crt
And they are suppose to be installed in my system (Ubuntu 13.10). They are in different places, such a /etc/ssl/certs/MYCASLinuxSUBCA.pem but also:
/usr/share/ca-certificates/lut/MYCASRootCA.crt
/usr/share/ca-certificates/lut/MYCASLinuxSUBCA.crt
So assuming that the variable $cas_server_ca_cert_path has to have one of these .crt files or .pem dirs (such a /usr/share/ca-certificates/lut/MYCASLinuxSUBCA.crt) I cannot make it work. What I am doing it wrong? My client-server (no the cas server) is in my localhost. Is it a problem? Should I avoid use setCasServerCACert command? Why is it happening?
I've also tried to use the curl-ca-bundle.crt certificate provided by my XAMP instalation (Xampp 1.8.3).
I am a little bit lost with certificates as you can see.
I read about problems with phpCAS and recent Ubuntu versions in https://github.com/Jasig/phpCAS/issues?state=open. However I cannot make this working with the master code, even without certification (by default).
Any ideas would be appreciated...
I have found the solution asking in the github library: https://github.com/Jasig/phpCAS/issues/119
The reason is that the curl binary used by PHP in my xampp installation is different from the system's curl binary. The system one has access to /etc/ssl/certs/ certificates, but the xampp curl does not have (unless you don't indicate it, of course). By default, it searches in a special certificate-bundle-file.
Finally I have found the real certificate for my cas-server and I am using it, however maybe you want to use other proposed solution at the end of the discussion thread if you are having a similar problem.

Mediawiki + Sub-domain + SSL returns 404 error when accessing secure site

Using CPanel/Softaculous to install Mediawiki on my hosted website appears to install fine. Though not sure how much the installer checks.
I then setup a sub-domain such as wiki.mydomain.com to accept requests there.
After that, I also setup SSL cert in Cpanel. The cert is self-signed because at the moment I am just testing out the wiki and everything before I decided if I will purchase a cert.
Then, if I attempt to go to http://wiki.mydomain.com. I get the landing page of MediaWiki but if I attempt to go to https://wiki.mydomain.com I get nothing but a blank browser window.
Now, if i go to https://wiki.mydomain.com/index.php, I get a 404 error (I created a simple html page with a 404 error message then modified my .htaccess to show it on the 404).
When looking at the logs, it appears to be trying to find the index.php file under /home/mydomain/public_html/index.php instead of /home/mydomain/wiki/index.php.
Very confused on why this isn't working at all. I can post some configs and things as well but this account is a newly created CPanel account so not much as been done on it other then installing the wiki software.
(Edit) This is using SharedSSL. I couldn't get it to work without it. Some reason even after I made sure the site was the only one on the IP Address using WHM it was still showing it as a shared IP. :P
Fixed the SharedSSL by using this information: Cpanel Forums
You will have to make a new install of MediaWiki via Softaculous. Go on the install form you will get an option to "Choose Protocol" choose https:// there and in the "Choose Domain" dropdown choose your subdomain https://wiki.mydomain.com leave the "In Directory" field blank and then click on Install button.
Then you should be able to access the MediaWiki install at https://wiki.mydomain.com
I think the reason for this issue is due to how cPanel works with sub-domains and SSL. From what I gather, this appears to be a SSL cert issue since when CPanel rebuilds the httpd.conf using /scripts/rebuildhttpdconf command, it does not create a SSL virtual host for the sub-domain. Also, the parent domain works fine.
I ended up putting the wiki in /home/mydomain/public_html/wiki then setting up redirects for http://mydomain.com and https://domain.com to point to https://mydomain.com/wiki.
For now, that's all I could figure out to fix the issue was to drop the sub-domain.

Website with SSL Certificate

The website I currently created isn't using a ssl cert. If I decide to buy and use a ssl cert for my website do I need to change any code on my website? My website is written in html, php and it has a mysql backend.
Or can I just purchase a new ssl cert and not change any code?
Thanks
The SSL connection is handled by the web server, the code running on top of it has nothing much to do with it. Your code should continue to run as is if the web server is configured sensibly. If you are hardcoding links using http://... somewhere or are otherwise somehow depending on the presence or absence of HTTP/HTTPS in your code, you may need to change these specific parts.

Categories