13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

462Chapter 20Open Source Web <str<strong>on</strong>g>Applicati<strong>on</strong></str<strong>on</strong>g> Serversrestart)$0 stop$0 start;;*)echo "usage: $0 (start|stop|restart|help)"esac# define where JBoss is - this is the directory# c<strong>on</strong>taining directories log, bin, c<strong>on</strong>f, etc.JBOSS_HOME=${JBOSS_HOME:-"/usr/local/jboss"}# make sure Java is <strong>on</strong> your pathJAVAPTH=${JAVAPTH:-"/usr/java/jdk/bin"}Finally, we d<strong>on</strong>’t need to run the “all” c<strong>on</strong>figurati<strong>on</strong>, we <strong>on</strong>ly need thedefault c<strong>on</strong>figurati<strong>on</strong> at the moment, so we change the argument to the run.shinvocati<strong>on</strong>:# define the script to use to start JBossJBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c default"}JBoss C<strong>on</strong>figurati<strong>on</strong>sWhen you unpacked JBoss, it c<strong>on</strong>tained three predefined server c<strong>on</strong>figurati<strong>on</strong>slocated in jboss/server. The three c<strong>on</strong>figurati<strong>on</strong>s are namedall (which runs every single service JBoss supports, including RMI/IIOPand clustering features), default (which runs <strong>on</strong>ly the set needed to runservlets, JSP, and EJBs), and minimal (which runs just JNDI, the logger,and a URL deployment service; no Web c<strong>on</strong>tainer, no JMS, no EJBs).In effect, the selected c<strong>on</strong>figurati<strong>on</strong> is the server. You can, ofcourse, customize any c<strong>on</strong>figurati<strong>on</strong>, and you may create additi<strong>on</strong>alc<strong>on</strong>figurati<strong>on</strong>s.Now, this script allows you to run JBoss as any user. It defaults to userjboss if n<strong>on</strong>e is specified. You have to decide what to do here. Without specifyinga user, it will run as root. That is a major security risk. On an out-of-theboxRedHat or Fedora system, there is no user called jboss. We will have tocreate <strong>on</strong>e. There are a lot of security c<strong>on</strong>cerns to creating a special “n<strong>on</strong>login”user. The most important involve changing the user entries in /etc/passwd

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!