Friday, 16 March 2012

Creating a Development Virtual Machine with (CENTOS/APACHE/PHP/MYSQL/OPENSSH SERVER/SAMBA/JAVA/JBOSS)


  • Installing OPENSSH Server



# yum install openssh-server
# chkconfig sshd on



  • Installing MYSQL Server



# yum install mysql-server
# chkconfig mysqld on
# /etc/init.d/mysqld
# /usr/bin/mysqladmin -u root password 'new-password'
# mysql -u root -p


In the mysql console, allow at root user to achieve a remote connection


mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'r00t';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;



  • Installing Java JDK 1.5.0_22



First download it at http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR


# chmod 700 jdk-1_5_0_22-linux-amd64.bin
# ./jdk-1_5_0_22-linux-amd64.bin
# mkdir /usr/java
# mv jdk1.5.0_22 /usr/java
# ln -s /usr/java/jdk1.5.0_22 jdk


Open these ports 3306, 22, 80, 8787 and 8080 using the window preferences



  • Installing Development Tools for recompile the kernel



# yum install kernel-devel
# yum groupinstall "Development Tools"



  • Installing PHP



# yum install php
# yum install php-mysql
# yum install php-mbstring
# yum install php-posix
# yum install php-pear
# yum install php-devel
# yum install libssh2-devel
# pecl install channel://pecl.php.net/ssh2-0.11.3


Modify /etc/php.ini


Add the following line to activate ssh2


extension=/usr/lib64/php/modules/ssh2.so


Modify the property name short_open_tag from Off to On 


short_open_tag = On



  • Setting up HTTPD



# chkconfig httpd on
# /etc/init.d/httpd start



  • Disabling SELinux



Modify in this file /etc/selinux/config the property named SELINUX to disabled 


SELINUX=disabled



  • Installing Samba
# yum install samba
# chkconfig smb on
# smbpasswd -a developer

Change the workgroup name and the netbios name at /etc/samba/smb.conf

workgroup = WORKGROUP
netbios name = VM1

Adding the developer user to the samba user file at /etc/samba/smbusers

developer = developer

Start samba

# /etc/init.d/smb start
  • Installing JBoss
Download jboss at http://sourceforge.net/projects/jboss/

# unzip jboss-4.2.3.GA.zip
# mv jboss-4.2.3.GA /opt
# cd /opt
# ln -s jboss-4.2.3.GA jboss
# adduser jboss
# chown -Rf jboss.jboss jboss
# cp /opt/jboss/jboss_init_redhat.sh /etc/init.d/jboss
# chmod +x /etc/init.d/jboss

Modify /etc/init.d/jboss

Adding these lines 


# chkconfig: 345 90 10
# description: Runs the JBoss Application Server
# processname: jboss

And modifying these lines

JBOSS_HOME=${JBOSS_HOME:-"/opt/jboss"}
JAVAPTH=${JAVAPTH:-"/usr/java/jdk/bin"}

Add this line to bind any network interface

JBOSS_HOST="0.0.0.0"

Installing jboss as a service

# chkconfig --add jboss
  •  Installing VirtualBox Guest Additions



# reboot
# /media/VBOXADDITIONS_4.1.10_76795/VBoxLinuxAdditions.run
# reboot