10/2/15

scp as a background process


To execute any linux command in background we use nohup as follows:
1
$ nohup SOME_COMMAND &
But the problem with scp command is that it prompts for the password (if password authentication is used). So to make scp execute as a background process do this:
1
$ nohup scp file_to_copy user@server:/path/to/copy/the/file > nohup.out 2>&1
Then press ctrl + z which will temporarily suspend the command, then enter the command:
1
$ bg
This will start executing the command in backgroud

How to install & configure Tomcat 6 on Centos 6.5

login as root
yum update
yum install -y java
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps

You can modify default port 8080 to 80 (if required)
vi /usr/share/tomcat6/conf/server.xml
connectionTimeout="20000"
redirectPort="8443" />

For tomcat admin modify file
vi /usr/share/tomcat6/conf/tomcat-users.xml
add line

in between &
Add permanent at start-up
chkconfig tomcat6 on
Start tomcat
service tomcat6 start
Add port on iptables
iptables -I INPUT -p tcp --dport 8o -j ACCEPT
service iptables save
service iptables restart

Open browser and add url or ip of your server in address bar
click on Tomcat Manager give username and password as you have added on the file tomact-users.xml as admin and tomcatpass