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.

446Chapter 20Open Source Web <str<strong>on</strong>g>Applicati<strong>on</strong></str<strong>on</strong>g> Servers(well, sudo lets you limit it, but a mistake can be fatal—c<strong>on</strong>sider what happensif you let them run a program that lets them escape to a shell). So, for example,if you want to let the Web services group install and maintain JBoss, but youd<strong>on</strong>’t want them to mess with any standard software <strong>on</strong> the system, then createa separate place for n<strong>on</strong>system software.Two comm<strong>on</strong> places for such software <strong>on</strong> <strong>Linux</strong> systems are /opt and/usr/local. We tend to use /usr/local mainly because this is the defaultpath <strong>on</strong> an awful lot of software that uses autoc<strong>on</strong>f to handle cross-platformcompilati<strong>on</strong> (it is used by the majority of Free Software programs, but excepti<strong>on</strong>sinclude what are arguably the four most widely used Free Software packages:the <strong>Linux</strong> kernel, the Apache Web server, the Perl language, andXFree86). So we are going to install JBoss under /usr/local and we are goingto give a number of users the power to install and manage software in/usr/local.You will need to be root to carry out this procedure. Here are thesteps—but d<strong>on</strong>’t worry, we’ll pad them out with a lot of p<strong>on</strong>derousexplanati<strong>on</strong>:1. Create the group.Groups are defined in the file /etc/group. Each line in that filedefines a group. Each line is of the form:GroupName:x:GroupID:GroupMembersGroupName is the name of the group. It is the group name that showsup in l<strong>on</strong>g form ls output. The sec<strong>on</strong>d field is for the group’s password.If we may c<strong>on</strong>fess, we d<strong>on</strong>’t know if this feature works anymore. You usedto be able to specify a group password, but this defeats the whole purposeof not sharing passwords. Sharing passwords is a security risk. D<strong>on</strong>’t doit. The third field is the group ID number. Remember that files haveowning users and owning groups. These are both stored as numbers. Usernumbers are known as uids and group numbers as gids. These numbersshould be unique. If you reuse a number for more than <strong>on</strong>e group, theeffect could be indeterminate, since it would depend <strong>on</strong> how a given programwas written. D<strong>on</strong>’t reuse numbers. The final column is a commadelimitedlist of user names. Those named users are said to bel<strong>on</strong>g to thegroup. We’ll talk some more about what that means as we go <strong>on</strong>.

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

Saved successfully!

Ooh no, something went wrong!