Its a very funny and lovely moment between Thor and Captain Marvel. They might be the best super hero couples ever.
This article will be helpful for those who is using Ubuntu 16.04 – bitnami based server on amazon aws EC2 instance only. In this post i’m explaining how make phpmyadmin publicly available in bitnami based servers.
Use the following rules
<IfVersion < 2.3 >
Allow from All
<IfVersion >= 2.3>
Require all granted
sudo /opt/bitnami/ctlscript.sh restart apache
After doing the above step phpmyadmin will be accessible using the following url pattern
http://<your domian OR ip>/phpmyadmin
I’m using some latest Amazon Machine Image ( AMI ) called LAMP Stack PHP 5.3 LTS, Actually i was using some old AMI that released in 2013 and the instance also created at that time. It was almost impossible for me to integrate certbot in it, so that i finally decided to migrate my codeignitor app into new instance that support php 5.3
Here also i struggled so much to integrate certbot but finally i did it by the following steps.
git clone https://github.com/certbot/certbot
chmod a+x certbot-auto
./certbot-auto certonly --webroot -w /var/www/html/ -d <domainName> --debug
sudo ln -s /etc/letsencrypt/live/<domainName>/fullchain.pem /jet/etc/apache//server.crt
sudo ln -s /etc/letsencrypt/live/<domainName>/privkey.pem /jet/etc/apache//server.key
nano extra/httpd-ssl.conf// uncomment and set the following things with newly created
You are all set now. But take a note, Let’s Encrypt’s certificates are only valid for 90 days. This is to encourage users to automate their certificate renewal process. You can setup a cron job which will run everyday at a particular time to renew certificates. Certificates are renewed only when they expire.
sudo /tmp/certbot/certbot-auto renew --dry-run
sudo crontab -e
12 3 * * */tmp/certbot/certbot-auto
renew --post-hook "sudo /jet/enter restart
" >> /etc/letsencrypt/log/renew.log
This runs the renew everyday at 3:12 am. Remember that certs don’t get renewed unless they are near to expiration, and monthly/weekly cron job would cause your existing certs to occasionally be expired already before they get renewed.
You can contact me in case you need any help to setup the above things, I will providing premium support
It’s little bit complex task for the new programmers to use SSL pinning with cordova-plugin-advanced-http plugin. Plugin installation and usage is not so complex, but most of the people have no idea about how to obtain the .cer file for SSL pinning purpose.
I have already published a blog post about how to generate the .cer file, You may just read this blog post first.
In my project i just want to use an HTTPs based url from my ionic application, My client told me its very important for him because we are transferring some sensitive data through this API.
Firstly, I just installed the cordova-plugin-advanced-http plugin and its npm module in our ionic project and then i search on google to find how to generate .cer file. Most of the results just showing some results about how to convert a .pem file to .crt file and actually not solving my issues.
Example ionic application
I have created a git repository to share my sample application
SSL Pinning may not work properly with Live Reload mode
It was a little bit hard task for me to integrate SSL in my Ionic 3 app using Cordova due to my lack of knowledge in SSL certificates. As usual i just landed in the HTTP native plugin section under ionic frameworks documentation section. It was not so helpful for me, because neither this page or its official github page not explaining how to generate the .cer file for SSL pinning, finally i found the solution by reading lots of Stackoverflow answers and other articles.
Install the plugin as per the instruction on the documentation section
I’m assuming that you need to make https requests to a single domain only
It works only if you had chrome browser on a windows machine with no active antivirus software ( In my case kaspersky using a personal root certificate – that mask the actual SSL certificate keyfile from the user )
In this case, we can generate .cer file from your chrome browser on windows machine. Just access one of your public api url via chrome browser address bar and then click on the green padlock icon of your https url. then you can export the ssl public key as a .cer file
Watch this video to get clear understanding
If you have a Linux or Mac machine or use you Linux server terminal – If your machine must have an installation of openssl.
Use the following linux command to obtain the .cer file
openssl s_client -showcerts -connect <domain name>:443 -servername <domain name>:443 </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.pem
Convert .pem file into .cer file
openssl x509 -inform PEM -in certificate.pem -outform DER -out certificate.cer
Download the certificate.cer file to your local machine and then include a copy on your ionic/cordova project root directory
You must call enableSSLPinning or setSSLCertMode method on your components.ts file based on the version of the installed plugin
This article will be helpful for those who is using Ubuntu 16.04 – bitnami based server on amazon aws EC2 instance only. I’m writing this blog post because, i did’t find any best blogs which explain how to create a subdomain in aws ec2 instance and which also using bitnami based image to configure the instance. I can see, so many blogs and stackoverflow results about this topic, but most of those are talking about creation of virtual host on the standard ubuntu server only. Actually creation of the virtual host was the complex task for me at first and subdomain creation is almost easy.
Steps to create virtual host and create subdomain in bitnami based ubuntu server
Please watch this video to get more clarity on this.
I don’t really like to use putty because i’m a linux user for development. Recently i wanted to connect to an AWS EC2 instance from my windows 10 pc, AWS recommended to use Putty or their CLI. But I don’t like none of those methods, we cannot use windows command prompt or power shell to accomplish the same without doing some modification on the system. So that i connected to aws using GitBash tools.
It is very easy to use for a linux user, because GitBash support some linux commands like ls, ls -la , whoami etc..
First of all we need to locate our private key file (.pem) file on our pc, I have already downloaded the pem file from aws when i created my ec2 instance. Right now its located in my ‘downloads’ folder so that, i just changed the current directory of gitbash to ‘downloads’ folder using cd command.
As i said before, my pem file is located in downloads folder, so that now i can run the command to connect to aws using my pem file called sijo.pem
ssh -i “SIJO.pem” email@example.com
Now, my gitbash connected to my aws ec2 instance as show in the following picture.
This is how to use SSH connection from windows machine without PUTTY. You can also connect to a linux server from gitbash without pem file as well.
I hope this post will be helpful for someone.
If you have enough experience in linux server or similar things then only use the following solution.
I have an Australian client, she want to migrate her websites to another hosting company, ixwebhosting.com was her old hosting company. There were not supporting her for anything related with web server problems like changing php versions and this server blocking suddenly stopped working and not supporting HTTP POST request sometimes. Actually I was working fine before. Finally I suggested to migrate to another hosting company called A2Host, they have some cool pricing plans and almost good technical support.
Actual problem starts when i try to using their ( ixwebhosting ) website control panel, It was not user friendly and don’t have most of the features available in CPanel, There was an Option for zip the project directory in their control panel, but it was not working anyway. It is not possible to download all the files to my local machine using filezilla and again upload the same to the new service provider.
So, how can i solve this issue ?
1. I logged in the new webserver ( A2host ) via SSH
Find your webserver host, port number, username and password , in case of A2H, username and password will be different than your usual login credentials of the control panel
login to the server via linux terminal or user putty in windows
2. Connecting to the old webserver from the current terminal window
Choose your directory you want to save the files being downloaded
cd <your directory>
connect to the old server via FTP
lftp <hostname your using in you desktop ftp client such as filezilla>
after doing this you have to login to FTP server
<your ftp username>
now enter your password
Probably you will be logged in to the FTP server.
ls command to list all the directories and files
use the following command to download a particular directory to your new server
mirror <source directory> <target directory>
NB: Please use experts help to do the same, otherwise it might cases server issues or data loss
I was running with the same problem, My ionic 3 app with ASP.net backend was working just fine, it was not working with IOS ( Iphone x – IoS 11 simulator ). I got some errors like the following.
[Error] failed to load resource: Preflight response is not successful.
[Error] Failed to load resource: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.
I’m not seeing this issue from the Android version of the application. Is there a setting or something that can be enabled within the Ionic app to fix the CORS issue?
Workaround only – Not a perfect solution
I changed the `web view` option of my ionic app.
WKWebView ===> UIWebView
First, open config.xml and add the following properties
<param name="ios-package" value="CDVWKWebViewEngine" />
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
then run the following commands – I hope you are familiar with this commands
ionic cordova plugin remove cordova cordova-plugin-ionic-webview --save
rm -rf platforms/
rm -rf plugins/
ionic cordova build ios
In iOS, there have been two webviews for a few years now, UIWebView and WKWebView. Historically, Ionic apps have used UIWebView, but no longer. Ionic now uses WKWebview by default when building for iOS.
We strongly believe WKWebview is the best option for any app, as it features many improvements over the older, legacy webview (UIWebView). These features include:
We wanted to make sure that people could easily switch to WKWebView without many issues, but there are still some things that you’ll need to consider.
Reference : Ionic wkwebview
Google Cloud Firestore is database service from google and is has very similar features like firebase realtime data base. It is a NoSQL database like MongoDB and it will sync the data with all connected applications automatically in real time.
It has some cool properties like multi regional data replication, multi document transaction and much more..
Key features of Cloud Firestore include:
Right now it is available for the developers in BETA mode, however google may release the stable version with in few months.
What is the difference between Firebase Realtime Database and FireStore ?
Firebase realtime db does not offer the actual NoSQL database however can be store data like a tree structure.
This is a best tutorial for some one who would like to get started with Google Cloud Firestore SDK.