Installation:InstallerDocumentation:LinRunAsUser

last edited byusericonjordan on 27-Sep-2011

Documentation Home

Contents

Security and User Accounts

This section is intended to cover the security issues of running Railo/Tomcat under specific user accounts. It is not intended to be a full paper on securing your Railo installation. It should be noted that when you install ANY piece of software on a server, you are opening your server up to potential security risks. It is important to be aware of what those risks are, and how to manage them. It is also important to note that no matter how hard you try, nothing you can do will ever make anything 100% secure. There will always be SOME security risk. The key is difficulty, and managing those risks appropriately.

Railo as Root

By default on Linux systems, the Installer will offer to run under the "root" user account. It's very important that you understand that this is a usability suggestion, and not a security suggestion. The idea is that you install the server, then install your application, and work out any user-related issues it may have by running as root. Once you've got your application installed and working properly, it is highly recommended that you change the running user to something other then the "root" user.

Changing the Railo User

The installer comes packaged with a script that makes it easy to switch the user account that Railo runs as. Again, this can be a useful tool for problem-solving, making it easy to change the user that Railo runs as in order to diagnose user or permission-related issues. The syntax for the change_user.sh script is as follows:

 change_user.sh {username} {installdir} [nobackup]

Example Usage (Debian/Ubuntu/Mint):

 $ sudo /opt/railo/sys/change_user.sh apache /opt/railo/ nobackup

Example Usage (RedHat/CentOS):

 # /opt/railo/sys/change_user.sh apache /opt/railo/ nobackup

User Permissions Per Site

If you change the Railo to something other then the ROOT user, you need to configure your sites to allow write access from whatever the Railo user is. This will allow Railo/Tomcat to write the WEB-INF files to that directory. If you don't want the Railo/Tomcat user to have write access to your site directory, you'll need to create the WEB-INF directory yourself and at least provide write access to that WEB-INF directory.

To show how this is done, let's use the "apache" user again, like we did above. If our site directory is /home/admin/www.sitename.com/, we'll need to create the directory and assign permissions to it so that the "apache" user can write to it. We can do that with this command:

Example Usage (Debian/Ubuntu/Mint):

 $ sudo mkdir /home/admin/www.sitename.com/WEB-INF/
 $ sudo chown apache:apache /home/admin/www.sitename.com/WEB-INF/

Do that for each site you've configured in your tomcat server.xml file. After you've got a WEB-INF directory in every site with permissions adjusted on each of them, don't forget to restart Railo/Tomcat!

 $ sudo /opt/railo/railo_ctl restart

Documentation Home

 
Download in other Formats:
markup Markup | pdf PDF | html HTML | word Word