Monday, August 15, 2016

Passwordless SSH login

I created this to remind myself how I did it.

First I disabled password authentication so no password login can be made possible. Just edit the file "/etc/ssh/sshd_config" then set the "PasswordAuthentication" to "no".

Don't forget to restart the ssh service.
For Debian - service ssh restart
For CentOS/Fedora - service sshd restart

Add yourself to the sudoers file. Command to edit it...
# visudo
Then add yourself. Example is below
# User privilege specification
root    ALL=(ALL:ALL) ALL
[your username]  ALL=(ALL:ALL) ALL

Friday, August 12, 2016

Setup ImageMagick on CentOS 6

source: Install ImageMagick on CentOS 6

First install dependencies:
yum -y groupinstall 'Development Tools'
yum -y install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-devel php-devel

Download the source
# wget http://www.imagemagick.org/download/ImageMagick.tar.gz

Now for the installation routine
# tar xvf ImageMagick.tar.gz
# cd ImageMagick*
# ./configure
# make
# make install

Verify that the compile and install were successful:
# convert --version
Troubleshooting: if convert command did not show up try logging out and in.

Monday, August 8, 2016

How to Install JBOSS 7 Final on CentOS 6

source: How to Install JBOSS 7.1.1 Step by Step on CentOS

First install JAVA SDK 7
# yum -y groupinstall 'Development Tools'

Then Download Java 7 SDK. I used the rpm release to install it. If you wish to install from source download the tar file. Install it using the rpm command
# rpm -ivh jdk-7u79-linux-x64.rpm

Then execute the following commands
# export JAVA_HOME=/usr/java/jdk1.7.0_79   
# export JAVA_HOME  
# PATH=$JAVA_HOME/bin:$PATH  
# export PATH

Now, ensure the path has been set correctly with below command,
# echo JAVA_HOME
Will shows JAVA_HOME path

To check java Version:
# java -version

Now to install JBOSS after completing the installation of Java SDK.

Download JBOSS 7 Final
# wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip

Extract that files and move the folder
# unzip -q jboss-as-7.1.1.Final.zip  
# mv jboss-as-7.1.1.Final /usr/share/jboss-as

Create a user jboss
# groupadd jboss  
# useradd -s /bin/bash -g jboss jboss  

Add this to the .bash_profile of the created jboss user. The command is as below...
# sudo -u jboss vim /home/jboss/.bash_profile
Then add the content before "export PATH" line
export JAVA_HOME=/usr/java/jdk1.7.0_79
export JAVA_HOME  
PATH=$JAVA_HOME/bin:$PATH

Symlink the config file for JBoss.
# mkdir /etc/jboss-as
# ln -s /etc/jboss-as/jboss-as.conf /usr/share/jboss-as/bin/init.d/jboss-as.conf

Then edit the config. Set it like below...
# General configuration for the init.d scripts,
# not necessarily for JBoss AS itself.

# The username who should own the process.
#
 JBOSS_USER=jboss

# The amount of time to wait for startup
#
# STARTUP_WAIT=30

# The amount of time to wait for shutdown
#
# SHUTDOWN_WAIT=30

# Location to keep the console log
#
 JBOSS_CONSOLE_LOG=/home/jboss/log/console.log

Symlink the start/stop/restart script for JBoss.
ln -s /etc/init.d/jboss  /usr/share/jboss-as/bin/init.d/jboss-as-standalone.sh

To start JBOSS run from command line
# /etc/init.d/jboss start

To check if running...
# netstat -anp | grep 8080
tcp   0   0    127.0.0.1:8080    0.0.0.0:*    LISTEN    12710/java

Using "top" command the JAVA service should be ran by jboss user, not root.

Now to make it run on boot
# chkconfig --add jboss  
# chkconfig --level 234 jboss on