Wednesday, August 25, 2010
Bash commands
Saturday, July 31, 2010
Running Tomcat as Non-Root User
At this stage, the Tomcat packages, files and binaries are owned by root. We will first need to create a Tomcat user and group that will own these files, and under which Tomcat will run.
Tomcat User :: tomcat
Tomcat Group :: tomcat
Not too imaginative, huh ? We will now create the Tomcat user and group. Open a terminal window and, as root,
# groupadd tomcat
# useradd -g tomcat -d /opt/tomcat tomcat
# passwd tomcat
Now, we will put everything in /opt/tomcat under Tomcat user and group. As root,
# chown -R tomcat:tomcat /opt/tomcat
# chown -R tomcat:tomcat /opt/jakarta-tomcat-5.x.xx
To start Tomcat,
# su - tomcat -c /opt/tomcat/bin/startup.sh
# su - tomcat -c /opt/tomcat/bin/shutdown.sh
MySQL Options
-u name or —user=name: This option specifies which MySQL user name you wish to use. Depending on how MySQL is configured, there can be many MySQL users (see also Chapter 11). If no users have yet been set up or if you have administrative tasks to perform, use the user name root.
This user exists in every MySQL installation and is considered the system administrator.
If you omit the option -u, then under Unix/Linux the current login name will be used, while
under Windows, it will be ODBC. A login is possible only if users with these names have been
set up on the MySQL server.
Wednesday, July 28, 2010
The structure of an RPM package
The Red Hat Package Manager (RPM) is a tool that facilitates installing, uninstalling, and upgrading software for your Red Hat Linux system. It is a file that contains executable programs, scripts, documentation, and other files needed by an application or software unit. RPM packages are generally named using a convention that lets you determine the name of the package, the version of the software, the release number of the software, and the system architecture for which the application is intended. The following diagram shows how the components of a package name are arranged:
(1) Name
(2) Version
(3) Release
(4) Architecture
When you update a package, RPM installs the new version of the software but attempts to leave your existing configuration files intact. You can update a package by using the -U option of the rpm command:
rpm -Uvh package
When you update a package, RPM automatically uninstalls the old version of the package before installing the new one.
http://www.ibm.com/developerworks/linux/library/l-rpm2/index.html
Tomcat user
Tomcat user
a good idea to make the tomcat user’s primary group the nobody group or another group with similarly low permissions. You will need to do this as the root user:
# useradd -g 46 -s /sbin/nologin -d /opt/tomcat/temp tomcat
If you do not have root access, you could run Tomcat as your login user, but beware that any security vulnerabilities (which are extremely rare) in Tomcat could be exploited remotely as your user account.