Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, October 11, 2013

Build and Deploy the PLAY application

Once you have developed a application in play, you might want to create a binary out of it which you can deploy on another server.
The below steps have to be followed to create a binary of your Play application and to deploy on another server (Linux).

1. In your play application directory, run the below command.
[My application folder] $ play dist
This command will create a zip file with the following name [applicationName]-[version].zip. Example: testapp-1.0.zip.
2. Copy this zip file to the server on which you want to deploy the application.
Example: scp testapp-1.0.zip user@other-server-host:/home/user/.
3. Unzip the file to the folder where you want the application running.
Example: unzip testapp-1.0.zip -d /opt
4. You will find a start file in the unziped folder. But most of the time it will not have executable permissions.
Change the permission by executing the below command.
chmod 777 start
5. You can then execute the command like below.
[Unzipped dist folder] $ ./start

You can also make your application run on different port and provide other options along with the ./start.
Refer the below URL for the options.
http://www.playframework.com/documentation/2.1.x/ProductionConfiguration

Hoping that this information helps some newbies of Play.

Sunday, January 30, 2011

Linux : Establish connection through a proxy

To establish a trusted connection to a firewall protected server through a proxy machine, use the below command.

ssh -C -L 1521:192.16.98.45:1521 dev@proxy-machine

In this example, we are connecting to a oracle server at 192.16.98.45 running on port 1521 through a proxy machine "proxy-machine". "dev" is the username on the proxy machine.
It will ask for a password of the proxy machine and once provided, you will be able to connect.

This way, your machine need not be allowed on the firewall on the oracle server. But you will still be able to connect through another machine which is allowed on the firewall. (The proxy can be your friends machine as well)

Thursday, December 2, 2010

Steps to disable OOM Killer on Linux

OOM kills any process which has been waiting for a long time. But some times, we need to avoid this and make sure these long waiting processes are allowed to complete even if it takes much more time.
To disable OOM, follow the below steps.

Check status of oom-killer:

# cat /proc/sys/vm/oom-kill

Turn oom-killer off/on:
# echo "0" > /proc/sys/vm/oom-kill
# echo "1" > /proc/sys/vm/oom-kill

To make this change take effect at boot time, add the following
to /etc/sysctl.conf:
vm.oom-kill = 0

For processes that would have been killed, but weren't because the oom-
killer is disabled, you'll see the following message
in /var/log/messages:
"Would have oom-killed but /proc/sys/vm/oom-kill is disabled"