How to start Activemq with XML configuration file

You can download Aapache activeMQ from following URL;
http://activemq.apache.org/activemq-530-release.html

Choose the your OS(Linux/Windows). After downloading apache-activemq-5.3.0-bin.zip.
Extract the ActiveMQ. Open command prompt and go to activeMQ/bin directory and run the “activemq” command.

ActiveMQ will start without configration.
If you are running ActiveMQ on local machine than you can open the ActiveMQ’s Admin from following URL;
http://0.0.0.0:8161/admin/ (8161 is default port)

If you want to run ActiveMQ with XML file. Use following command
#bin/activemq xbean:file:../config.xml

For more information Please visit the http://activemq.apache.org/

Advertisements

How to setup mongrel cluster setup on fedora

First install the following gems:
#su
#gem install mongrel
#gem install mongrel_cluster
#cd project_name
#mongrel_rails cluster::configure -e production -p 3000 -N 3 -c /home/purab/project_name -a 127.0.0.1 —-prefix /project_name
# mongrel_rails cluster::start

You are able to start your applicaton at http://127.0.0.1:3000, http://127.0.0.1:3001 and http://127.0.0.1:3002

for all the cluster
# mongrel_rails cluster::stop

Advanced prepairation for production realeaze
$ mkdir /etc/mongrel_cluster

#vim /etc/mongrel_cluster/project_name.yml
copy and paste following text;
user: project_name
cwd: //home/purab/project_name
log_file: /home/purab/project_name/mongrel.log
port: “3000”
environment: production
group: dev
address: localhost
pid_file: /home/purab/project_name/tmp/pids/mongrel.pid
servers: 3

or you can run the following command

or copy and paste the content from config/mongrel_cluster.yml file to /etc/mongrel_cluster/project_name.yml

# ln -s /home/purab/project_name/config/mongrel_cluster.yml /etc/mongrel_cluster/project_name.yml

Then open your httpd.conf file for apache configration:

<Proxy balancer://project_name>
BalancerMember http://127.0.0.1:3000
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
</Proxy>

<VirtualHost *:80>
ProxyPreserveHost On
# Avoid open you server to proxying
ProxyRequests Off
# Options +FollowSymLinks
RewriteEngine On

RewriteRule ^/(images|stylesheet|javascript|html)/?(.*) /home/purab/project_name/public/$0 [L]
ServerAdmin purab@yahoo.co.in
DocumentRoot /home/project_name/
ServerName example.com
RewriteRule  ^/(.*)$  balancer://project_name%{REQUEST_URI} [P,QSA,L]
</VirtualHost>

Restart the apache server
#/etc/init.d/httpd restart

Command for restart the mongrel servers from any where
# mongrel_rails cluster::restart -C /etc/mongrel_cluster/project_name.yml

Solved: Access denied with code 400 (phase 2).

When I restarted my apache server. I am using the fedora 9 here.

I did not get my default page opened in browser.
When I opened the apache error log file. I saw following error.

ModSecurity: Access denied with code 400 (phase 2). Pattern match “%0[ad]” at REQUEST_HEADERS:Cookie. [id “950910”] [msg “HTTP Response Splitting Attack. Matched signature <%0a>”] [severity “ALERT”] [hostname “localhost”] [uri “/”] [unique_id “SuWoGH8AAAEAAFF3rKEAAAAA”]

I after doing some R&D but I did not got any perfect soluction.
Then I cleared the whole browser cookies. That solves my problem.

solution – clear the browser cookies…

how to use sftp command with different port

I am using the Fedora 9 here for this explaination.

I tried to sftp on remote server for port no 2202. I got the following error on command prompt.

[purab@localhost ~]$ sftp user@example.net -oPort=2202

Connecting to example.net…
ssh: connect to host stylo.smartsourcingglobal.net port 22: No route to host
Couldn’t read packet: Connection reset by peer

Then i tried the following command, than I able to make connection with port

[purab@localhost ~]$ sftp -oPort=2202 user@example.net

Article taken from: http://wpapi.com/2009/09/25/how-to-use-sftp-command-with-different-port/