Timothy E. Archer

System.out.println("Hello World!");

Browsing Posts in Linux/Unix

Recently I had to fix a linux system whose root file system was allowed to fill up. Not having much knowledge of the system, I needed a quick way to find out which files were consuming the most space to see if any of those could be purged. The likely culprit was some huge log files, but how to find them?

du and sort to the rescue!

This simple command dumped out the sizes of all files on the system:

du -x / | sort -rn | more

Let’s pick it apart:
continue reading…

I recently setup Apache Tomcat 6.0.10 and in this post I will share the steps that I went through to install it on my RedHat Linux AS 4 server.

The Basics – Download and Install The Software

  1. First make sure you have a Java Development Kit installed on your server. I have a write up on how to do this at http://timarcher.com/?q=node/59.
  2. Download the Tomcat binary distribution from http://tomcat.apache.org/download-60.cgi. I selected the tar.gz option under the Core section.
  3. Once you have downloaded your file, place it somewhere on your Linux box (I put mine in /root/tomcat). The name of the file I downloaded was apache-tomcat-6.0.10.tar.gz.
    continue reading…

By default, RedHat Linux AS and AS4 servers don’t come with a JDK (Java Development Kit) installed on them. Depending on your install, if you run the java command you may get some sort of error message or a file not found message.

In this post I will describe how to install a JDK on your RedHat Linux server. It should also work on Fedora, however I have not tried it personally.
continue reading…

I believe that every organization should have a NTP/time server if they have more than one computer on site. Having an NTP server will allow you to keep the times on all of your computers in sync. This helps when comparing the logs from various servers to trace through various events that happened. It’s nice to be assured that the event really happened at the time specified in the log file regardless of what server you’re on.

In this post I will show you how to setup your RedHat Linux AS 3 or 4 machine as an NTP server. You could then take all of your other servers and workstations and have them synchronize their time from your NTP server.
continue reading…

By default FTP comes disabled on stock RedHat AS3 and AS4 server installs. For the most part you should not be using it anyways, and instead using something more secure like SFTP. However, in some rare occasions I find the need to enable FTP. Below I will show you how to do it:

  1. Become the root user on your server.
  2. Change to the /etc/xinetd.d directory
    cd /etc/xinetd.d/
    

    continue reading…

Many Oracle shops want their database to automatically start when their server boots up, and to automatically shutdown when they shutdown the server.

Below I will share with you the Oracle init script that I use on my server. It has been tested with Oracle 10gR2 on RedHat Linux AS3.

  1. Login as the root user on your server.
  2. Put the following script in the file named /etc/init.d/dbora:
    continue reading…

When I setup my RedHat AS4 Linux server and connected it to the Internet, I soon saw in my logs that there were unauthorized people trying to login all day long. For the most part these attempted logins were from hacking scripts whose job is to try various common usernames and password until they find a combination that works. Frequently I would see entries in my /var/log/messages file that look like:

Apr  8 14:52:34 as1 sshd(pam_unix)[8217]: check pass; user unknown
Apr  8 14:52:34 as1 sshd(pam_unix)[8217]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=111.111.111.111

While these scripts were never able to login, I did not like that fact that they were able to try to so easily.

My solution to stopping these hacking scripts from trying to login to my server was to just change the port that SSH listens on. It’s simply security through obscurity. I’m not here to argue on whether this will totally protect my server or not since I know there are multiple sides to the argument. You’ll find people who will suggest that I use public/private keys, firewalls, and VPN’s, and for an environment housing sensitive data I do agree with this. However, for my home server I was unwilling to spend any money. I wanted a solution that stopped my problem and took less than 5 minutes of effort.

Here’s how I did it on RedHat AS 4. continue reading…

A basic, but very useful command I use in the day to day management of my servers is the Unix find command. The find command will search through directories looking for files that match your search criteria.

The most command tasks I use the find command for are to:

  • Find files greater than X kBytes, especially log files that are getting big.
  • Find files modified in the last X days. This is useful for finding old log files and deleting them.
  • Finding files that have a certain keyword in their file name. For example, finding everything named *.txt.
  • Using find to execute grep to look through the content of the files for certain keywords.

continue reading…

Have you ever wondered how to easily change the date, time, and time zone configuration on your RedHat Linux server? Every once in a while I need to manipulate the date or time, especially when I ship servers to a new location in a different time zone, and I always fumble around for the commands.

Here is the easiest and fastest method I can find to do this: continue reading…

With the servers that I manage, I sometimes need to run a command that starts some sort of GUI interface requiring an X server. This holds especially true if the server holds an Oracle database. The GUI tools Oracle provides make it easy to install Oracle, use the database configuration assistant (DBCA), run the wallet manager (OWM), and other utilities, however they all require an X Server.

What I don’t like to do is to have to determine my local computer’s IP address, and from the Unix server manually export my DISPLAY to that IP address every time I want to run one of the programs requiring an X server.

Instead, what I do on my RedHat Linux AS3 servers is edit the /etc/profile script, and add in one simple line: continue reading…

Powered by WordPress Web Design by SRS Solutions © 2014 Timothy E. Archer Design by SRS Solutions