There are many OpenShift PaaS Changes which demands to understand how you should upgrade you and your machine to use our huge guides on OpenShift PaaS. As practically we wrote guides on RedHat OpenShift since it was Beta, you should at least know what things OpenShift PaaS changed. For IaaS, you can follow an older guide, but for PaaS, you must remain updated. Pass is, indeed intended for the developers.
OpenShift PaaS Changes : Before You Start
Many issues the readers used to ask us has been resolved by OpenShift. None, ever give us even a free backlink for free help and guides; you can forget about sponsorship. OpenShift PaaS and Heroku PaaS, both are great and has a free layer of usage. At least, OpenShift and their employees Fav and Retweets for the guides. Without sharing, it is not possible to reach the audience. Google is Evil and there is no meaning of wasting even a microsecond behind thinking what they are suggesting to do. Business works for their own benefit; Facebook, Microsoft and Google practically work for NSA.
What OpenShift offers for Free is not less – who will provide you 03 1 GB kind of “instances” forever for free? Amazon will give 512 MB instances free for 1 year, quite unusable. Heroku has a better control than OpenShift, unfortunately, the free tier gives 512 MB “instances”. We have not “discovered” any 100% free IaaS from a Standard web host for the developers. If we knew, we would host our website on that provider then!
---
OpenShift PaaS Less Used Features : What You Should Know
We are talking about iTerm2–Homebrew–Oh-MyZSH setup as localhost. Try to use Fedora or Debian if you do not have a Mac.
Update Your rhc Client
rhc
client is a Ruby Gem and you should use Terminal to update it :
1 2 3 4 | # OS X setup specific sudo brew update sudo brew doctor # fix the things |
Cask will give you trouble with OS X Yosemite. If you are facing conflicting head errors for Homebrew, then run :
1 2 | cd /usr/local/Library && git stash && git clean -d -f sudo brew update && brew doctor |
Until, brew doctor
is giving 100% clean indication, do not update rhc
. All are Ruby Gems and will add problems. Like, right now I am getting “Your system is ready to brew.” after running brew doctor
command. Homebrew is a good package manager. Run :
1 | sudo gem update rhc |
When we published running WordPress on OpenShift, then domain mapping cartridge was not developed :
1 | https://blog.openshift.com/instant-mapping-applications-with-postgis-and-nodejs/ |
rhc alias
is the command, which helps the domain mapping.
Our guides for pointing naked domain towards OpenShift are for ALL KIND OF USERS. That can be made better if you can learn OpenShift specific works. That is IaaS way, not exactly PaaS way.
SSH is Powerful
OpenShift and Heroku, both has powerful SSH. OpenShift SSH Guide. That video is of 1080p HD resolution! Google will force to view at inferior quality. That YouTube forces lower resolution to attract towards toward the Ads! Whatever, doing SSH is like normally doing SSH. You should know to do SSH like we do in IaaS. Git is the normal way to use PaaS – you must know the revision control terminologies for better usage.
SSH is in this way :
1 | ssh 5162f025e0b8cd96230002f2@openshiftwordpress-abhishekghosh.rhcloud.com |
Where I got this peculiar big thing? By clicking the “Want to log in to your application?” link on Dashboard of the App. That is why I said a gear is “Like Instance”. If you run env
and hit the return key, you’ll get a kind of cat
command against the Environment Variables. If you can control these, there is practically no difference between an IaaS and PaaS. I have not done huge research to discover
these, they are thought when developing the software :
1 | https://developers.openshift.com/en/managing-environment-variables.html |
If you run the whoami
command, you will get that ID -> 5162f025e0b8cd96230002f2
. openshiftwordpress-abhishekghosh.rhcloud.com
is the domain name, 5162f025e0b8cd96230002f2
is the user name. How we normally SSH? In this way :
1 | ssh root@IP_address |
sudo su
will not work. You are not suoder
. You can run :
1 | /etc/init.d/mysqld status |
It is likely you’ll get something. If it WordPress, you’ll definitely get. If you run :
1 | env | grep MYSQL |
you’ll get :
1 2 3 4 5 6 7 8 9 10 | OPENSHIFT_MYSQL_DIR=/var/lib/openshift/5162f025e0b8cd96230002f2/mysql/ OPENSHIFT_MYSQL_DB_PORT=3306 OPENSHIFT_MYSQL_DB_HOST=127.8.47.1 OPENSHIFT_MYSQL_DB_PASSWORD=xxxxxxxxxxx OPENSHIFT_MYSQL_IDENT=redhat:mysql:5.1:0.2.19 OPENSHIFT_MYSQL_DB_USERNAME=yyyyyyyyyyyy OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/5162f025e0b8cd96230002f2/mysql//socket/mysql.sock OPENSHIFT_MYSQL_DB_URL=mysql://yyyyyy:xxxxx-iiiiii@127.8.47.1:3306/ OPENSHIFT_MYSQL_VERSION=5.1 OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/5162f025e0b8cd96230002f2/app-root/logs/ |
run whereis my.cnf
, you’ll get the path – /etc/my.cnf
If you run :
1 | cd / && ls |
You’ll see there is SELinux like any OpenStack IaaS! You can not cd to root
. Run :
1 | ping openshiftwordpress-abhishekghosh.rhcloud.com |
You’ll get the subnet mask. Stop Ping running by CTRL + C
, you will get :
1 | --- ec2-54-80-112-63.compute-1.amazonaws.com ping statistics --- |
yeah, that ec2-54-80-112-63.compute-1.amazonaws.com
is your real thing! If Pinging that returns the same IP like the above, then it is the external IP. If it starts with 10, then it is not the Public IP. Simply run test on :
1 | openshiftwordpress-abhishekghosh.rhcloud.com |
to get the reverse IP :
1 | http://myip.ms/info/whois/54.80.112.63/k/2542706722/website/openshiftwordpress-abhishekghosh.rhcloud.com |
If you run this command on a PHP instance, I mean gear :
1 | echo $OPENSHIFT_PHP_IP |
It is will echo :
1 | 127.8.47.1 |
It is basically doing a cat
. Run man cat
(do not laugh), to get your Cat’s manual. Now check this file :
1 | nano /etc/hosts |
You will get this :
1 2 3 4 5 6 | # HEADER: This file was autogenerated at Wed Aug 20 00:32:35 -0400 2014 # HEADER: by puppet. While it can still be managed manually, it # HEADER: is definitely not recommended. 127.0.0.1localhost.localdomain localhost localhost4.localdomain4 localhost4 10.240.59.150 ex-std-node165.prod.rhcloud.com ex-std-node165 ::1 localhost6.localdomain6 localhost6 localhost.localdomain localhost |
You never knew this “ex-std-node165.prod.rhcloud.com” exits. If you do a curl :
1 | curl -I ex-std-node165.prod.rhcloud.com |
You’ll see that, it is Apache/2, Red Hat server with 302 redirection. If you check the reverse IP :
1 | http://myip.ms/info/whois/54.80.112.63/k/782264231/website/ex-std-node165.prod.rhcloud.com |
You’ll see DNS servers, that IP 54.80.112.63
is in use. Obvious. Amazon has original physical hardware, it has Router, Subnet, CIDR. On that, some OpenStack like Cloud Computing software is running, on that, Openshift has installed OpenShift software with virtual Router, CIDR, IP etc. You can play with the IP and A record to resolve a domain name. Reverse DNS should resolve, which is difficult. You can try with an External IP full router, subnet etc. Otherwise people will hack you. If suddenly OpenShift notices that you are using their IP as your own, they will ban you.
Weapons and Softwares has not much difference. Processors can catch fire if an exploit is ran logically badly. Both the weapon manufacturers and software exploit runners aka hackers has not much huge knowledge. Their tendency is destructive. Alfred Nobel, is very bad person. He had/have (their grand kids are running nicely till date) 14 weapon manufacturing companies! Journalists knew his real stories! They had huge anger for running the exploits, Alfred’s brother died, people thought he has died, in Newspapers, Journalists wrote – “Dr. Alfred Nobel, who became rich by finding ways to kill more people faster than ever before, died yesterday.”
Alfred Nobel read them and said many excellent dialogues! They are mostly suppressed. Except a criminal minded person, who will drop nitroglycerin on a kind of mud and fire it.
Do not abuse the knowledge. You’ll become another Alfred Nobel. Ordinary people will consider you are a bigger person.
The software OpenShift is F/OSS, so the architecture is provided :
1 | http://www.openshift.org/documentation/oo_cartridge_developers_guide.html |
You can run ps aux | less
and poster
to check, what are running. This SSH is not the standard way to install a software on PaaS. You can build anything. You can install Nginx with HHVM. But, you can not control once a thing has been created. Pass demands more grasp on UNIX for building really good softwares. Developing a PHP has not much value. If we start with an empty thing, we can actually do everything. The way will be a bit OpenShift-ish. Instead of that way, we would exit from SSH and run these :
1 2 3 4 5 6 | rhc app create site diy-0.1 # build a dry gear # site is app name rhc app show -a site ssh big-number@site-[your-namespace].rhcloud.com # back to SSH |
I will CD to temp :
1 | cd $OPENSHIFT_TMP_DIR |
Then first download PRCE :
1 2 3 4 | wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2 && tar -xzvf pcre-8.31.tar.bz2 wget http://nginx.org/download/nginx-1.2.2.tar.gz && tar -xzvf nginx-1.2.2.tar.gz cd ngnx* && ./configure --prefix=$OPENSHIFT_DATA_DIR --with-pcre=$OPENSHIFT_TMP_DIR/pcre-8.31 make install |
Then couplete it :
1 | nano $OPENSHIFT_DATA_DIR/conf/nginx.conf |
The difference with normal nginx is that, we need to change with variables :
1 2 | server { listen $OPENSHIFT_IP:$OPENSHIFT_PORT; |
We need to stat the file :
1 | mv $OPENSHIFT_DATA_DIR/conf/nginx.conf $OPENSHIFT_DATA_DIR/conf/nginx.conf.template |
You need to clone the git to local computer and cd to .openshift/action_hooks
directory. There is a need of start
bash script.
You’ll fear so much, so there is ready to use cartridge :
1 | https://github.com/getupcloud/openshift-nginx-php-fpm |
SFTP
Yeah, you know, IP, host, username, port, password, you can SSH, you can not use SFTP? Easy :
1 | https://blog.openshift.com/using-filezilla-and-sftp-on-windows-with-openshift/ |
Bronze plan is quite good for regular usage.
Tagged With paperuri:(a7ed8de35c3a2715aaf3a5083a124a17)