Linux Tutorials
Linux Server Managment
Rebuilding/Restarting Exim Mail Server
Feb 17th
When troubleshooting the Exim log file:
tail -f /var/log/exim_mainlog
If you need to restart or rebuild Exim, you can dump your databases
* /etc/exim.conf
* /var/spool/exim/db
Which Exim just rebuilds automatically by issuing the following command via SSH:
rm -fv /var/spool/exim/db/*
Then to start Exim:
/scripts/eximup –force
Linux server tip: force reboot/shutdown
Apr 23rd
Forcing reboot
A Linux Server is not Windows XP and if reboot fail you usually still connect by SSH and do something. This commands will show you how to remotely hard reboot machine. Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc, it’s more like hitting the reset button.
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
This commands enable sysrq and after this calls fast reboot. If you want to force shutdown machine try this.
Force shutdown
echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger
This came handy, when I had a server that had some IO error and it can no longer read from disk, only few cached binaries into memory kept it running (kernel, SSHD, bash), I could still access the machine via SSH but can no longer do anything, forcing the reboot as mentioned above was my only resort, and it worked like charm…
How To Set Up A Load-Balanced MySQL Cluster With MySQL 5.1
Apr 18th
This tutorial is based on Falko Timme’s tutorial for MySQL Cluster 5.0. It shows how to configure a MySQL 5.1 cluster with five nodes: 1 x management, 2 x storage nodes and 2 x balancer nodes. This cluster is load-balanced by an Ultra Monkey package which provides heartbeat (for checking if the other node is still alive) and ldirectord (to split up the requests to the nodes of the MySQL cluster).
More >
How to update Virtuozzo Node to the newest Kernel
Apr 6th
Virtuozzo includes a utility to update itself and the included templates. To run this, you will need to ssh into the hardware node and execute the command:
vzup2date
In order to update the templates, add a -t to the command thusly:
vzup2date -t
It should be noted that if Virtuozzo is installed on the server, the standard Redhat up2date command should never be run.
If you are running Virtuozzo on a Windows server, then you can run the Virtuozzo update utility accessed through the Start menu.
Turbo charging MySQL by setting up the query cache
Mar 27th
To make sure MySQL uses the query cache, there are a few variables you need to set in the configuration file . Usually its my.cnf or my.ini so check on your server with the shell command locate , in our case we are running on a CentOS 5.2 distro and to its my.cnf located in /etc so we opened it by using : nano /etc/my.cnf
Moving mySQL DBs between servers
Mar 27th
Moving mySQL DBs from one server to another:
mysqldump -uUSER -pPASSWORD txp_database > txp_database.sql
puts the entire thing in one nicely portable text file.
on a new server it takes
mysql -uUSER -pPASSWORD txp_database < txp_database.sql
to import it.
Taking backup of mysql database using cron
Mar 27th
Taking backup of mysql database using cron
Create a file called database_backup.sh and also an empty directory called mysql_backup. The database_backup.sh script should have the following info :
How to Reset your Linux Root Password
Mar 26th
Whenever you can’t remember Root password, you can read this tutorial and do step by step to Reset it … You can log in with single-user mode and create a new root password.
Reboot your computer. When GRUB is presenting the menu list, follow those instructions:
CentOS – what happened to netconfig in 5.1
Mar 26th
For whatever reason CentOS decided to drop netconfig and renamed it to
system-config-network
Common SSH Commands and Linux Shell Commands
Mar 26th
We’ve put together some of the more frequently used SSH commands or linux shell commands, and organized them by name so you can easily find a command, their description and how to use it. This guide will continue to be updated and should not be considered a complete list of SSH commands or linux shell commands, but commands, we found, often used. If you would like to add to this guide, please email us and let us know.
Moving large files from one linux server to your new linux server
Jan 26th
Ok, so you like to move your 3 gig backup from your old server to your new server, but the the good old wget command is not doing the trick?
There is an easy way around with the scp command
How to check and stop if DDoS attack is going on.
Sep 20th
Distributed denial-of-service attacks
In a distributed attack, the attacking computers are often personal computers
with broadband connections to the Internet that have been compromised by viruses
or Trojan horse programs. These allow the perpetrator to remotely control machines
to direct the attack, and such an array of computers is called a botnet. With
enough such slave or zombie hosts, the services of even the largest and most well-connected
websites can be disrupted.
How can I repair corrupt MySQL tables?
Sep 12th
Every so often, MySQL
tables have a way of corrupting themselves. MySQL offers a quick and
painless method of repairing those tables.
How to mount and unmount a drive in linux
Aug 26th
How To Mount A Drive In Linux
This simple step by step guide will show you how to mount a new hard drive or partitions onto your Linux server
Linux sub directory size info
Jul 20th
Need to know the exact size of your subdirectories in Linux?
Just go to the directory , like cd / and try this
du -cksh *
Easyapache failing on CentOS server
Jul 20th
Had an issue with one on our CentOS cPanel servers running 64 bit and cPanels easyapache upgrade. The folks at cPanel helped out with their usual professional response
How to find MAC address in CentOS
Jul 19th
Open SSH and type the following and press Enter:
/sbin/ifconfig | grep -i hwaddr
The sequence of hexadecimal digits that appears to the right of eth0 HWAddr (e.g. 08:00:27:ED:DA:8b) is
your network card’s MAC Address
cPanel – Manually back up and transfer an account via SSH
Jun 22nd
Sometime accounts are to big to transfer via the WHM transfer feature.
Below you can find some steps to do so manually
Log into your server and create a cPanel backup for the account
/scripts/pkgacct <username> <location> backup
<username> refers to the username you want to backup.
<location> is the path to where the backup will be placed (in your case you want to put /backup/cpbackup here).
So backup tells pkgacct that you want to create a backup file.
If you leave this off it creates a cpmove archive. Not sure what the difference is between a cpmove and a backup file, but this tells pkgacct you just want to create a <username>.tar.gz file in <location>.
And after the backup has been completed you can simple move it by pushing it via SCP
here is the tutorial http://www3.wiredgorilla.com/content/view/322/1/
Problems with CenotOS5 – cPanel and BIND
Jun 22nd
If you have issues with cPanel running CentOS5 with BIND then the easiest way is to downgrade BIND to 9.2.4
The reason you’re having trouble is because CentOS 5 uses bind-9.3 and CentOS 4 uses bind-9.2 – The changes between these versions is significant enough that cPanel won’t work with it properly.
For instance by default there is no /etc/named.conf file created when bind-9.3 is installed and the default named.conf file for bind-9.3 is significantly different than in older versions.
Until the code is updated to work with bind-9.3, I have found the workaround to be to remove bind-9.3 packages and install bind-9.2 packages as follows:
kernel yum upgrade
Jun 21st
check what kernel you are running at the moment
uname -a
and to upgrade your kernel
yum update \kernel*
check if your kernel is added to grub
cat /boot/grub/grub.conf
and then reboot
shutdown -rf now
