Archive for the ‘Articles — Webhosting’ Category

How to install Clamav

Friday, April 20th, 2007

Follow the steps below to install clamav.

mkdir exiscan
cd exiscan
wget http://mirror.clamav.net/clamav-0.88.4.tar.gz
tar zxvf clamav-0.88.4.tar.gz
cd cpanelappz-clamav-Linux-i686
./install
Choose option 4
Then rerun ./install and choose option 1

Note – : If you have cpanel’s clamavconnector installed, this installer will detect that and refuse to install/ proceed further. You need to uninstall the cpanel’s version from inside WHM before trying to install this package.

 

The link for Fantastico does not appear in my customer’s CPANELs. What do I do?

Friday, April 20th, 2007

You need to check three things:

* Is there a symbolic link to the fantastico directory in the theme(s) you are using?

To create the symbolic links, run the following command for each theme that needs a link:

Code:
ln -s /usr/local/cpanel/3rdparty/fantastico /usr/local/cpanel/base/frontend/x

Change “x” at the end of the command to the directory name of the theme you want to add the symbolic link to (monsoon, bluelagoon, etc.)

PLEASE NOTE: Some people have complained recently that the symbolic link to the fantastico directory gets removed every time CPANEL updates itself. This isn’t a problem with Fantastico, this is a problem with CPANEL itself. This has already been submitted as a bug. You can follow its progress here:

http://bugzilla.cpanel.net/show_bug.cgi?id=1220

* Make sure Fantastico is CHECKED (active) in the WHM Feature Manager feature set(s) you need it to be active in. Log into your WHM as root and click on the Feature Manager link and edit sets as needed.
* If you are running CPANEL 10.4.0C150 or later, and Fantastico still doesn’t appear in CPANEL’s own themes (xskin, etc.) please try running this when logged into your server as root via SSH:
Code:
mv /usr/local/cpanel/3rdparty/fantastico/xskin.html /usr/local/cpanel/base/frontend/x/cells/fantastico.html

If after all this Fantastico is not appearing in your customer’s CPANEL and you are using a custom theme, then try switching at least one account to “x” and see if the Fantastico link appears. If it does, you may be using a theme that does not support Fantastico and you should contact the theme’s creator (but PLEASE make very sure you’ve followed the steps above BEFORE doing so, to help rule out other issues).

I get a parse error on line 89 in Fantastico

Friday, April 20th, 2007

I get a parse error on line 89 in Fantastico that looks similar to:
Quote:
Parse error: parse error in /usr/local/cpanel/base/tmp/username-10170834-22345 on line 89

This problem is due to a bug in some versions of CPANEL. The fix is as folllows:

Go to WHM -> Mysql -> MySQL Root Password
Set a password.

Now log in as root via SSH and view /root/.my.cnf and remove any quotes in that file.

For example, change:
Code:
user=”name”
pass=”blah”

to
Code:
user=name
pass=blah

I receive a WGET error when I try to install or update Fantastico.

Friday, April 20th, 2007

I receive a WGET error when I try to install or update Fantastico.

You have wget permissions set lower than 0700 and Fantastico cannot access it, you need to change the permissions of wget to at least 0700. Make sure you enter the correct path to wget when installing, usually: /usr/bin/wget

How do I UNINSTALL FANTASTICO?

Friday, April 20th, 2007

Log into your server via SSH as root and execute the following:

Code:
rm -rf /var/netenberg/fantastico_de_luxe/
rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/
rm -rf /usr/local/cpanel/3rdparty/fantastico*
rm -rf /usr/local/cpanel/base/frontend/*/fantastico
rm -f /usr/local/cpanel/base/frontend/x/cells/fantastico.html
rm -f /usr/local/cpanel/whostmgr/docroot/cgi/addon_fantastico.cgi

The first line, /var/netenberg/ should be replaced with whatever directory you installed the Fantastico master files to, for example:

/home/netenberg/
or
/opt/netenberg/
or
/backup/netenberg/

Install subversion version management system (cvs replacement)

Thursday, April 19th, 2007

Subversion is a program much like cvs that allows for version management.

For RHLE-3 :

mkdir /usr/local/src/subversion
cd /usr/local/src/subversion
wget http://summersoft.fay.ar.us/pub/subversion/latest/
rhel-3/i386/subversion-1.4.2-1.i386.rpm

wget http://summersoft.fay.ar.us/pub/subversion/latest/
rhel-3/i386/subversion-devel-1.4.2-1.i386.rpm

wget http://summersoft.fay.ar.us/pub/subversion/latest/
rhel-3/i386/neon-0.24.7-1.i386.rpm

wget http://summersoft.fay.ar.us/pub/subversion/latest/
rhel-3/i386/mod_dav_svn-1.4.2-1.i386.rpm

wget http://summersoft.fay.ar.us/pub/subversion/latest/
rhel-3/i386/subversion-debuginfo-1.4.2-1.i386.rpm

rpm -Uvh *rpm

If above links are not working please use this to find the exact one –

http://summersoft.fay.ar.us/pub/subversion/latest/

Simple Commad to detect DOSS attack

Thursday, April 19th, 2007

Try this command as one of the method to check if your server is under doss attack

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

You can block ips using apf -d ipnumber

Installing mytop ..

Thursday, April 19th, 2007

MySQL is one of the most important programs on a server, unfortunatly it is also pretty resource intensive. One a server it is not uncommon for a single user or even a query to take up the bulk of the servers cpu cycles. Mytop is a very useful program to see what queries a server is currently processing as well as which user is executing them. Think of mytop as top for mysql. If you see a lot from a user that means they are probably the hog. Mytop can also be useful for figuring out exactly which queries are causing the problem in the case of a self-designed website. The following is how to install mytop on the server and run it. Thanks to carlos for the actual commands

We are going to install 2 perl modules in addition to mytop to ensure that it will work.

Install TermReadKey:

cd /usr/local/src
wget http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
tar -zxf TermReadKey-2.30.tar.gz
cd TermRead*
perl Makefile.PL
make test
make
make install
cd ..

Now install DBI:

wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.48.tar.gz
tar -zxf DBI-1.48.tar.gz
cd DBI*
perl Makefile.PL
make test
make
make install
cd ..

Finally install mytop:

wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.4.tar.gz
tar -zxf mytop-1.4.tar.gz
cd mytop*
perl Makefile.PL
make test
make
make install

Now simply run “mytop” and your done!

Thanks to eth0 :)

How to disable direct root login ?

Tuesday, April 17th, 2007

1. SSH into your server as ‘admin’ and gain root access by su

2. Copy and paste this line to edit the file for SSH logins
pico -w /etc/ssh/sshd_config

3. Find the line
Protocol 2, 1

4. Uncomment it and change it to look like
Protocol 2

5. Next, find the line
PermitRootLogin yes

6. Uncomment it and make it look like PermitRootLogin no

7. Save the file Ctrl+X then Y then enter

8. Now you can restart SSH
/etc/rc.d/init.d/sshd restart

Now, no one will be able to login to root with out first loggin in as admin and ‘su -’ to root, and you will be forcing the use of a more secure protocol. Just make sure you remember both passwords!

E-mail Alert on Root SSH Login

Tuesday, April 17th, 2007

1. Login to your server and su to root.

2. cd /root

3. pico .bashrc

4. Scroll to the end of the file then add the following:
echo ‘ALERT – Root Shell Access (YourserverName) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d”(” -f2 | cut -d”)” -f1`” you@yourdomain.com

Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address

5. Crtl + X then Y

Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.