By default, PostgreSQL database server remote access disabled for security reasons. However, some time you need to provide the remote access to database server from home computer or from web server.
Step # 1: Login over ssh if server is outside your IDC
Login over ssh to remote PostgreSQL database server:
$ ssh user@remote.pgsql.server.com
Step # 2: Enable [...]
Archive for the ‘Security’ Category
How Do I Enable remote access to PostgreSQL database server?
Setup Capistrano to deploy Rails application on Amazon EC2 with Git
1: Create a new Rails app – we’ll call is ‘deploytest’
$ rails deploytest
$ cd deploytest
2: Create a local Git repository for it
$ git init
$ git add *
$ git commit -a -m ‘initial commit’
$ git status
3: Create a couple of Capistrano files
$ capify .
4: Edit config/deploy.rb
# The name of your app
set :application, “deploytest”
# The directory on [...]
How to use Google Apps mail configuration with rails application.
I am using google apps for my domain www.bhushangahire.com
For one of my rails application I am using this domain mail account setup for sending mails.
But I am not able to send the mail with the default smtp setings we use for sending mail.
So I search on net and I found the Goggle Apps consider its [...]
Get location from IP address in Ruby On Rails for free….
Find below the code for finding location from IP address using IP location tools.
require ‘net/http’
require ‘rexml/document’
include REXML
class MapsController < ApplicationController
def index
@location = locateIp()
end
def locateIp
ip = request.remote_ip
ips = ip.to_s
url = “http://iplocationtools.com/ip_query.php?ip=”+ips
xml_data = Net::HTTP.get_response(URI.parse(url)).body
xmldoc = REXML::Document.new(xml_data)
# Now get the root element
root [...]
Install and Configure FTP Server in Amazon EC2 instance
For many users, running FTP Sever in Amazon EC2 instance is headache at the first time. You need to experiment before being able to transfer data. The main problems are Ingress firewall in Amazon environment and NAT traversal.
Here I’m using vsftp (vsfptd) Server, which is one of the most popular and easy to configure. The [...]
Rails active_record_store & Segmentation fault
Here’s a quick tip if you’re getting errors like this one in your Rails application:
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session/active_record_store.rb:84: [BUG] Segmentation fault
The most probable reason you’re getting the Segmentation fault and your server crashes is because you’re trying to store too much data in sessions table of your application (I assume you are using active_record_store as a session store).
The [...]
Ruby On Rails Security Guide
Ruby on Rails does a decent job in handling security concerns in the background. You will have to configure your application to avoid few security attacks while plugins would be required for many security concerns which are not at all or poorly managed by rails.
Authentication
Authentication is the foremost requirement of most of the web applications [...]

