Problem: Apache HTTP Server on a web hosting system will undoubtedly run multiple virtual hosts. Each of those virtual hosts logs its activity in a separate location making it impossible to effectively monitor each log and each virtual host for errors or security issues. Solution: Use mod_status to monitor Apache’s …
February, 2010
-
24 February
How to setup umask on a Linux server
In Linux umask, or user file-creation mode mask, determines the permissions of new files. In other words, whenever you make a new file or upload/transfer a file from your local machine or another server, umask sets the initial permissions of that file. In most Linux distributions, umask for all users …
-
22 February
cPanel shell scripts for Linux
cPanel is best known as a graphical web hosting control panel. Since it is web based, however, there may be times when a system administrator may prefer or may need to execute commands from the Linux shell, either locally or remotely via SSH. Fortunately, cPanel comes with a host of …
-
17 February
How to merge two different files in Linux
In yesterday’s post, we learned how to find the discrepancies between two similar files using a command called diff. With it, we were able to compare them and identify the actual lines containing differences. Once you have identified the differences between the two, you have a couple of options. If …
-
16 February
How to compare two files in Linux
Question: I have two scripts in a directory on my server. One is the right one and one is not, but I do not remember which is which. How can I compare the two files? Answer: Linux and UNIX-like operating systems usually come with a comparison command called “diff”. This …
-
16 February
How to delete duplicate files in Linux
Question: Two of my directories on my server have some the same files. How can I easily delete any duplicates while preserving the unique files? Answer: There exists a Linux tool for just about everything, and this is no exception. You need a tool called fdupes, which searches the path …
-
15 February
How to list all users in Linux
Question: How do I see all of the users that have accounts on my server? Answer: In a previous post, we covered the “who” command, which will tell an administrator which users are currently logged into the system, but another important thing to know about your server is which users …
-
12 February
How to compile and install software from source in Linux
Ideally everything you ever need for your Linux server will be nicely packaged and easily installed through your distribution’s repositories. At worst you might need to add a third-party repository to download the .rpm or .deb packages that you need. But when you realize the world is not as perfect …
-
11 February
Share file folders on a Linux server
Many web-based organizations depend on the ability to communicate and share files easily. Even if you already have a website, however, you might not have an easy way to share files and folders, aside from giving each user FTP or SSH access. There are proprietary solutions, such as Dropbox or …
-
9 February
How to schedule a reboot on a Linux server
Automating tasks in Linux is a pretty straightforward process, mainly because the tool used to do it comes with all Linux distributions. It is called Cron, as we mentioned in an earlier post. Cron allows you to automate all sorts of tasks, including reboots. But if you just need to …