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.

448Chapter 20Open Source Web <str<strong>on</strong>g>Applicati<strong>on</strong></str<strong>on</strong>g> ServersNOTEThere are two strategies that <strong>Linux</strong> distributi<strong>on</strong>s follow for assigning a defaultgroup to a new user. One is to put all users into a group called staff or somesuch. This is widely c<strong>on</strong>sidered a security risk since it often leads to making filesaccidentally readable or writable by all users <strong>on</strong> the system. The more comm<strong>on</strong>method is to create a group for each user when the user is created.TIPIf you get in the habit of creating groups, you might want to assign the numberssystematically: 500–599 groups for programs, 600–699 groups for program installati<strong>on</strong>,700–799 groups for company departments to allow them to c<strong>on</strong>troltheir own Web c<strong>on</strong>tent, and so <strong>on</strong>.2. Change group ownership of /usr/local.Odds are, /usr/local already exists <strong>on</strong> your system. It may evenhave several programs installed in it. You must give the group ownershipover everything in /usr/local and below. The chgrp command changesthe group owner of files, and the -R argument says to do so recursively:# cd /usr/local# chgrp -R local .At this point, everything in /usr/local and below is group-ownedby the local group.3. Set group permissi<strong>on</strong>s <strong>on</strong> /usr/local.Basically, you want the group to be able to read and write everythingin /usr/local. To do this, you need to change the permissi<strong>on</strong>s <strong>on</strong> all thefiles with the chmod. As with chgrp, this command takes a -R argumentthat recursively walks the directory tree. We need to give every<strong>on</strong>e in thegroup read and write permissi<strong>on</strong> <strong>on</strong> all the files:# chmod -R g+rw .

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

Saved successfully!

Ooh no, something went wrong!