Install Jboss 7 on CentOS 5
Jump to navigation
Jump to search
Diese Seite ist in Bearbeitung
Contents
1 Install OS
2 Hardware & Host
- Install Media: http://ftp.plusline.de/centos/5.8/isos/i386/CentOS-5.8-i386-netinstall.iso
- Disk: 20GB virtio
- Memory: 4GB
- CPU: 2
- NIC: 1x virtio
2.1 Setup
- Language: English
- Keyboard: sg-latin1
- Installation media type: HTTP
- Configure TCP/IP:
- IPv4/Dynamic
- IPv6/Disabled
- Media Location:
- Server: ftp.plusline.de
- Path: /centos/5.8/os/i386/
- Installation: New Installation
- What Type of Installation: Create custem Disk Layout:
- /dev/vda1 - 150M - ext3 - /boot
- /dev/vda2 - max - LVM PV - VG: vg_system
- /dev/vg_system/root - 15GB - ext3 - /
- /dev/vg_system/swap - 2GB - swap
- Install Bootloader on MBR: /dev/vda
- Networking: Static/see above
- Hostname: buffel.gallien.bitbull.ch
- TimeZone: Europe/Zurich
- System clock uses UTC: YES
- Software Groups: none
- Customize now: NO
2.1.1 Initial Configuration
vi /etc/sysconfig/iptables ------ *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i lo -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited COMMIT ------ sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config chkconfig iptables on service iptables restart # remove unneeded packages wget -O - http://www.bitbull.ch/dl/scripts/cos5-post.sh | bash yum upgrade yum install system-config-network-tui sysstat dstat tcpdump screen vim-common strace ltrace ethtool reboot
3 Install Java
- download java jdk from oracle website
yum install libX11 yum install --nogpgcheck jdk-7u6-linux-i586.rpm
- installation shows some error, dont mind
- verify installation (ignore error from script)
rpm -V jdk
- configure alternatives
cd $(rpm -ql jdk | grep bin$ | head -1) ls -1 | while read file do alternatives --install "/usr/bin/$file" "$file" "$PWD/$file" 1 alternatives --set "$file" "$PWD/$file" # alternatives --display "$file" done
- configure enviorment
echo "JAVA_HOME=$(rpm -ql jdk | grep bin$ | head -1 | rev | cut -d/ -f2- | rev) export JAVA_HOME PATH=$JAVA_HOME/bin:\$PATH export PATH" > /etc/java.conf chmod 755 /etc/java.conf ln -s /etc/java.conf /etc/profile.d/java.sh
4 Install Jboss
cd /opt/ wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz tar vxfz jboss-as-7.1.1.Final.tar.gz ln -s jboss-as-7.1.1.Final jboss-as mkdir /var/log/jboss-as chown -R jboss:jboss /var/log/jboss-as /opt/jboss-as/standalone find /opt/jboss-as/ -type f -name '*.xml' -exec sed -i 's/127.0.0.1/192.168.123.63/g' {} \; adduser -M -d /opt/jboss-as jboss chmod 755 mkdir /etc/jboss-as echo 'JBOSS_HOME="/opt/jboss-as" JBOSS_USER=jboss STARTUP_WAIT=30 SHUTDOWN_WAIT=30 JBOSS_CONSOLE_LOG=/var/log/jboss-as/console.log' > /etc/jboss-as/jboss-as.conf chmod 755 /etc/jboss-as/jboss-as.conf ln -s /etc/jboss-as/jboss-as.conf /etc/profile.d/jboss.sh ln -s /opt/jboss-as/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-as chkconfig jboss-as --add chkconfig jboss-as on
- add management user if needed
/opt/jboss-as/bin/add-user.sh What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a): a Enter the details of the new user to add. Realm (ManagementRealm) : Username : admin Password : Re-enter Password : The username 'admin' is easy to guess Are you sure you want to add user 'admin' yes/no? yes About to add user 'admin' for realm 'ManagementRealm' Is this correct yes/no? yes Added user 'admin' to file '/opt/jboss-as-7.1.1.Final/standalone/configuration/mgmt-users.properties' Added user 'admin' to file '/opt/jboss-as-7.1.1.Final/domain/configuration/mgmt-users.properties'