General Linux Troubleshooting for RedHat Based Systems Running InterWorx-CP

 DISCLAIMER:

InterWorx only offers support for issues directly related to InterWorx and the custom compiled RPM‘s which we provide with a standard install. We did, however want to provide our clients with some general everyday information. These are things which have been asked again and again in our forums and other avenues. The presence of this page or the information on it does not imply support for these issues, nor does it imply that we intend to be the end all source for Linux and computer information to our clients. This page is presented simply for information only. Your best source of Linux info is the Internet itself which contains MANY sources of Linux info.

 Information on this page should be accurate for Red Hat Linux 9, Red Hat Enterprise Linux (2.x and later), Fedora (all versions), CentOS 2.x and later, and all other clones of RedHat Enterprise 2 and later.

How Do I edit files from the shell?

To edit files on the server you must use one of the many command line text editors that are available vi is one of the most common and is installed on all InterWorx boxes:

vi, vim, vile:

To open a file in the vi Editor: Type

"vi 'filename'" 

and hit “ENTER” key.

To write to a file (save) once it has been open:

Hit “INSERT” key, then begin typing.

To save the file (but not quit):

Hit “ESC” key, then type “:w” and hit “Enter” key. The w means write the file to the disc.

To quit without saving a file:

Hit “ESC” key, then type “:q!” and hit “Enter” key. The q means to quit.

To save and quit a file:

Hit “ESC” key, then type “:wq” and hit “Enter” key. The w means write the file and the q means to quit. To jump to a certain line in the file:

Hit “ESC” to get out of edit mode, then scroll to the top of the file (if you aren’t already there) and just type the line # you want to go to, and hit “j” key. It will jump right to the line. We will use this quite a bit when we begin editing LARGE and COMPLICATED files, or configuration files where you have the line of an error.

How do I install a Source RPM (SRPM)?

Run the command

rpmbuild --rebuild --with rhe4x http://updates.interworx.com/iworx/SRPMS/foo.src.rpm

Where:

  1. rhe4x = RedHat Enterprise 4.
  2. and foo.src.rpm is the name of the SRPM you want to install.

If you’re using a different distro you can use the following codes:

cos3x = CentOS 3.x
cos4x = CentOS 4.x
rhe3x = Red Hat Enterprise 3.x
rhe4x = Red Hat Enterprise 4.x
fdr10 = Fedora 1
fdr20 = Fedora 2
fdr30 = Fedora 3
fdr40 = Fedora 4
fdr50 = Fedora 5
rht9x = Red Hat 9
whb3x = White Box 3.x
whb4x = White Box 4.x

After building the RPMs will be in /usr/src/redhat/RPMS/i386/ and you can force install them by doing the following:

rpm -Uvh --force /usr/src/redhat/RPMS/i386/<rpm-name>.rpm

This assumes your server is an i386 (Intel Pentium and compatible) server. Other directories include:

athlon  
i386  
i486  
i586  
i686  
noarch

What is LogWatch and how do I configure it?

LogWatch is a standard Linux utility which sends you an email every day with a summary of the major events that happen on your server. The data can also be stored in logs located in the /tmp/logwatch directory -- be aware that these could be wiped out after a reboot.

  This is generally -- but not always -- installed and set to medium settings by your data center when an InterWorx server is provisioned.

You will see all successful and unsuccessful ssh logins and all unsuccessful ftp logins, virus definition upgrades, etc. For security reasons it is recommended that you review these emails every morning.

If you aren’t getting your daily emails or would like more details, the LogWatch configuration file is located here: /etc/log.d/logwatch.conf

Sometimes the LogWatch program needs to be started the first time with the command logwatch from the ssh prompt.

How do I change my InterWorx NodeWorx and/or root Password?

InterWorx NodeWorx Password

When you get your new server, your InterWorx and “root” passwords are (normally) the same, however they are not connected to each other and must be changed independently of each other. Normally you will want to keep them the same for simplicity’s sake, but if you give other people access to the NodeWorx password you may want to have a different root password for security.

It IS possible to reset the NodeWorx password from the shell prompt if you need to (for example if you’ve been locked out). To do this, execute the following command as “root” or su- to “iworx”

/home/interworx/bin/resetmasterpassword.pex 


To change your InterWorx password from the web, log into NodeWorx or SiteWorx (whichever password you want to change) and you will see a little box with your user information (name, username and email address) on the mail screen, Click Edit, enter a new password and click save. Another way to edit a SiteWorx password is to log into NodeWorx, click SiteWorx, and click Edit next to the SiteWorx account you want to change.

root Password

To change your “root” password, SSH into your IP address, log in as root and use the command.

$passwd< newpassword > 


It will ask you to retype the new password and when you hit enter, assuming the two passwords match the password is saved.

 You are advised to add a second non-root ssh account to the server and use that for everything that does NOT require root access. The new user will still have complete access to the server, it will just be blocked from doing some (potentially harmful) system-wide things. This is a GOOD thing because it prevents you from doing something stupid unintentionally; “root” will always have full access.

How Do I Change the "Name" of My InterWorx Server?

If your datacenter did not configure the server and/or InterWorx the way you want it (or you didn’t during your InterWorx installation) you will need to make these changes yourself.

To do this you may need to change several two things”

  1. Your hostname (the name your server sends out as it’s identity) and
  2. The name that appears in NodeWorx

 Changing one does not always change the other!

To check your hostname, log into the server as root type

#hostname 
 

If you get something other than your domain name you want (e.g. custdomain.tld or a domain you want to change away from), you need to change your hostname. To do this type

#hostname yourdomain.com 
 

(where yourdomain.com is the name of the domain you want to change to)

to check of this worked, type:

#hostname 
 


again and see if the value has changed. If it hasn’t you will need to edit the files by hand (see below).

For the name in InterWorx simply log into NodeWorx and the domain name will be shown near the top of the main screen. If it isn’t what you want it to be you need to edit the InterWorx configuration file manually.

Manual File Editing: On a RedHat/Fedora/CentOS box edit the following files:

  1. /var/qmail/control/me (the name qMail, your MTA is sending out)
  2. /home/interworx/iworx.ini (if you are using InterWorx and NodeWorx does not display the correct name)
  3. /etc/sysconfig/network (scroll down and be careful not to edit anything but “hostname”)
  4. /etc/hosts

 In InterWorx 2.x boxes editing the iworx.ini file should not be required anymore.

If all you do is change the qMail/InterWorx settings you can get by with running:

# service smtp reload (for qMail)
# service iworx reload (for InterWorx)

If you changed /etc/hosts and/or /etc/sysconfig/network you will need to reboot your server

#reboot

or

#shutdown -r

When your server reboots you can verify the change by logging into NodeWorx and running the #hostname command from the shell.

Is it possible to disable the root shell?

 DANGER! --- DANGER! -- NEVER EVER DO THIS!

You can disable any other user’s shell by running the command

usermod -s /bin/nologin

(or from the root shell of from the NodeWorx interface (2.1 and later))

However, doing this to root will completely disable the root account (not just root SSH login) and you will not even be able to su - or sudo to root from another account. Nor will you -- or your data center -- be able to login from the console (i.e. physically sitting in front of your server). In other words you will be locked out of the administrator account on your box. The only way around this is to shut down the server, slave your hard drive onto another server, mount that drive as a slave and manually edit the configuration files giving root its shell back. This would be considered a billable expense by most data centers, and some would not be willing to do it at all.

What you probably want to do is disable the root SSH login. This is done in the following way:

  1. Edit /etc/ssh/sshd_config
  2. Set “PermitRootLogin” to “no”
  3. service sshd restart

What is the difference between disabling the root SSH login and disabling the root shell?

Disabling root SSH login prevents a user from logging in as root either from the console or via ssh. By default a system users ssh access is disabled -- with the exception of root. Assigning a shell via the command usermod -s /bin/bash (For the bash shell) will give it ssh access.

The shell is the shell environment that a user functions in. Every user must have one to do anything on the system Disabling the root shell will disable the user completely.

 Disabling the root shell will result in crippling the user which, in the case of root will cripple the system as many processes need to be run as root.

How do I disable the root SSH login?

  1. Edit /etc/ssh/sshd_config
  2. Set “PermitRootLogin” to “no”
  3. service sshd restart

InterWorx 2.2 will have the ability to do this from the SSH Management page in NodeWorx.

How do I speed up my server?

This isn’t really an InterWorx problem but since it is so common with dedicated servers, we are including it here:

Processor speed/memory:

Use the command top to determine any processes that are using too much processor power/memory. If they are unnecessary use the command

killall < process_name > 


where < process_name > is the name of the process you want to kill. Make sure you know what you are killing. If it is a service (e.g mysqld) then you may want to restart it

service < servivename > start


If nothing seems awry here you may want to look at a hardware upgrade or increasing your swap partition (provided it is on a secondary hard drive). In general you don’t want to run large active databases on a Celeron server and you may also want to look at a RAM upgrade. Your data center’s sales and support team can work with you to find the best solution.

Network connection:

If your server seems laggy it is possible that the network card has not negotiated to full duplex. This can be remedied using the mii-tool.

mii-tool


You should get something like this:

eth0: negotiated 10baseTx-FD, link ok
or
eth0: negotiated 100baseTx-FD, link ok (for a 100Mb network card)

To find out the abilities of your card run:

mii-tool -v

eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:00:00, model 0 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

 In most cases you will have a card that works with both 10 and 100 Mb/sec (like the example). Check with your data center to see if you paid for the 10 or 100 connection to see what it was supposed to be negotiated to.

Assuming you’re not auto negotiated to the connection you paid for, (as root) execute the following command:

/sbin/mii-tool eth0 -A 10baseT-FD or 10baseT-HD to negotiate Full Duplex or Half Duplex replacing the 10 with 100 if that is what you paid for

OR

/sbin/mii-tool eth0 -F 10baseT-FD or 10baseT-HD to force Full Duplex or Half Duplex -- if the auto negotiate command did not work.

In general it’s best to try to negotiate first and force only if necessary.

I am getting a php error but it's just a number. How do I know what this means?

Run perror <errorcode> from the shell to get a more useful description of the error. For example:

[root@iworx root]# perror 122
Error code 122:  Disk quota exceeded

I need to install an optional PHP component. How do I do that?

You need to install PEAR if it isn’t already. To install, follow the instructions on the PEAR website http://pear.php.net/manual/en/installation.php The follow the directions provided to install components.

I need to install a perl module. How do I do that?

If ‘cpan’ is installed on your server, you should be able to run the following from command line:

[root@iworx root]# cpan
install <module_name>

If it’s not, you need to download the perl module you need from cpan.org and install it on the server from source following the install instructions included in the module package.

COPYRIGHT © InterWorx L.L.C. 2004-2008 PRIVACY POLICYEULA