Knowledgebase
Portal Home > Knowledgebase > 5. Dedicated Servers > Specially Linux Tips
The knowledgebase is organized into different categories. Either choose a category from below or search the knowledgebase for the answer to your question.
Search
Articles
Accept a different port# in iptables
Login as rootcp /etc/sysconfig/iptables /etc/sysconfig/iptables-ori01nano...
Views: 544
Add a Virtual NIC or Network Card
To add a virtual nic:
ifconfig eth0:1 192.168.0.90 netmask 255.255.255.0
To confirm it is...
Views: 683
Add user to sudoers list
sudoers list is the user list that allowed to execute specify command in sshTo add 1 user to...
Views: 820
Awstats is reflecting no data
It's not a major issue.. the awstat won't start process when the domain logs in apache is not...
Views: 138
Block all IP, but open to certain IP for certain port with iptables
iptables -A INPUT -p tcp --dport 25 -j DROPiptables -A INPUT -p tcp -s 202.162.229.0/24 --dport...
Views: 344
Block an IP from access to your server with IPtable
In order to correct this you will want to use the netstat -n command to see the ip addresses...
Views: 646
CentOS - IPV6 Network Configuration
Add nameserver to resolv.config
nano /etc/resolv.conf
Add line for ipv6 nameserver...
Views: 706
CentOS / Fedora Send Yum Package Update Notification Via Email
CentOS has yum-updatesd, which provides notification of updates which are available to be applied...
Views: 999
Change default server page on DirectAdmin server
Replace index file in this location
/var/www/html/
Views: 1035
Change Email max size
cp /etc/exim.conf /etc/exim.conf-ori1nano /etc/exim.confSearch for this words and change limit...
Views: 557
Change php upload size and Webmail attachment size
nano php.ini fileSearch for uploaded_filesizeChange max upload file size accordingly
Views: 574
Change SSH Port number
To change the SSH port number login as root and edit /etc/ssh/sshd_configFind the line that says...
Views: 611
Change Timezone and set time & date for CentOS
Change Timezone
cd /usr/share/zoneinfo/Asia/
cp /etc/localtime /etc/localtime-ori
cp...
Views: 1169
check CPU(s) information
cat /proc/cpuinfo
Views: 597
Check for possible existing exploits
shfor x in "/dev/shm /tmp /usr/local/apache/proxy /var/spool /var/tmp"; do ls -loAFR $x...
Views: 376
Check for possible existing exploits
shfor x in "/dev/shm /tmp /usr/local/apache/proxy /var/spool /var/tmp"; do ls -loAFR $x...
Views: 557
Check Linux memory being used
To check memory allocation maps
cat /proc/meminfo
To check process memory usage by...
Views: 604
Check OS version and distro vis ssh
To check OS version
cat /proc/version
To check distro
cat /etc/redhat-release
Views: 605
Check Raid Rebuild status
cat /proc/mdstat
Views: 220
Check RAM and CPU info via SSH
Check CPU
cat /proc/cpuinfo
Check Memory / RAM
cat /proc/meminfo
Views: 707
Check service status in ubuntu
Some service are notable to check status. The command below will give you the available option...
Views: 578
Check the most IP connect to server
netstat -an | sort +4 | grep :80 | awk '{print $5}' | sed -e s/':.*'/''/g | sort | uniq -c | sort...
Views: 588
Convert Cpanel Backup to DirectAdmin Backup
This scripts convert Cpanel backup file to DirectAdmin backup file for restore purpose.
Login to...
Views: 1519
CPanel and Cpanel DNSONLY Installation Instructions
CPanel now uses a universal install script which can be found athttp://layer1.cpanel.net/. You...
Views: 900
Create FTP user without shell
login as root
nano /etc/shells
add a line to the list "/bin/nologin"...
Views: 366
Cron Command
* * * * * command to be...
Views: 574
Delete mail queue
grep -lir nobody@sv1.nocser.net /var/spool/exim/input | xargs rm -fv
Views: 620
Enable Register_Globals
To enable register_globals globallylocate php.ini (should be at /var/lib/php.ini)Backup php.ini...
Views: 930
Enable session.auto for 1 Domain
Edit httpd.conflocate the Domain< IfModule mod_php4.c >php_admin_value session.auto_start...
Views: 602
Enable session.auto globlaly
locate php.inishould be at /usr/lib/php.inicd /usr/lib/cp php.ini php.ini-ori1nano php.iniSearch...
Views: 557
Fail to start named (/usr/sbin/named: undefined symbol: dns_resolver_setudpsize)
If you are getting ” Starting named: /usr/sbin/named: symbol lookup error: /usr/sbin/named:...
Views: 752
find large file
find / -type f -size +100000000c -ls
This will list all file located at "/" that...
Views: 641
Find out who is monopolizing or eating the CPUs
# ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
or
# ps -eo pcpu,pid,user,args | sort -r...
Views: 563
Fix MySQL up but can not connect
/scripts/cleanupmysqlprivs/scripts/securemysql -amysql_fix_privilege_tables --password=chmod 755...
Views: 581
Format and Mount 2nd HDD
Format and Mount 2nd HDD to /mnt/backupLogin as rootperform this commandfdisk -lthat will give...
Views: 626
Format Hard Drive
Use command below to format your secondary hard drive.
mkfs.ext3 /dev/sdb
Select "yes" when...
Views: 234
FTP - Configure ftp to allow passive mode
For pureftp:
open /etc/pure-ftpd.conf, and this line
PassivePortRange 30000 35000
For...
Views: 352
Hardening Server included
LSM (Linux Socket Monitoring) installed and configured - Function is to monitor ANY...
Views: 575
Help on preventing uploads of exploits
shchmod 0750 `which curl` 2>&-; chmod 0750 `which fetch` 2>&-; chmod 0750 `which...
Views: 605
host lookup did not complete
Error message========================Message 1HVHR1-0000Rh-5m is not frozenLOG:...
Views: 620
How do I block a IP completely from access to my system?
iptables -I INPUT -p all -s 123.123.123.123 -j DROP
Views: 555
How do I disabled root SSH login?
Login via SSH and edit /etc/ssh/sshd_configLook to see if there is a line like PermitRootLogin...
Views: 588
How do I give a user super user (su) access?
useradd -m -G wheel **user**passwd Enter the new password
Views: 596
How to check Postgresql version
psql -U postgres(enter password for user "postgre")From psql, type SELECT version();
Views: 711
How to checksum from ssh
md5sum filename.txt
Views: 590
How to display server volume Group
ssh to server and apply command below
vgdisplay
Views: 500
How to find out my server Apache version?
Httpd / Apache Web server version can be displayed with command below.
Simple out put:
httpd...
Views: 585
How to install "locate" with yum
yum install mlocate
Views: 1008
How to install Apache on CentOS
Install Apache web server on Centos
$ yum install httpd
Verify Apache installed version...
Views: 507
How to install tomcat 6
Make sure you have autoconf install before you proceed.
cd /usr/share/tomcat6/bintar xvfz...
Views: 697
How to make httpd start during boot up
Do thefollowing:chkconfig --list|grep httpYou get something like this:httpd 0:off 1:off 2:off...
Views: 323
How to remove yum Caches
Run this command to remove all of the packages held in the caches:
su -c 'yum clean packages'...
Views: 626
How to upgrade postgresql from 8.1 to 8.27
1. Print current webmin screens for posgresql: particularly allowed hosts (don't need to do this,...
Views: 557
Hypervm installation instruction
Once the server is ready (configured with LVM) login as root and issue the following commands:...
Views: 1093
hypervm-xen-vmlinuz error for when create vps
I added a new slave. I tried to create a new vps with centos 5.x on the new slave. I receive...
Views: 1376
Install Awstats on Directadmin Server
Integrated awstats into DirectAdmin.It's a global on/off swtich, and not a per domain setup....
Views: 1209
Install ImageMagick and Imagick on Cpanel Server
Install ImageMagick
Check first if it’s installed:
/scripts/checkimagemagick
Proceed...
Views: 720
Install nano with yum
yum install nanoIf tum is not installcd /rootmkdir downloadscd downloadswget...
Views: 876
Install php on CentOS
Login as root to install php and common php component
# yum install php php-gd php-imap...
Views: 610
Install phpmyadmin on Centos
In order for phpmyadmin to work, you must install all component needed by phpmyadmin
Component...
Views: 838
Install scp on linux server
yum install openssh-client
Views: 848
Installing DBD::mysql from source
wget http://www.cpan.org/modules/by-module/DBD/DBI-1.56.tar.gz tar xvzf DBI-1.56.tar.gz cd...
Views: 1045
invalid maildirsize file while change Email quota
Cpanel server:
1. upcp to latest stable 2. run these two commands one after the other: find...
Views: 487
Manage Mysql Database with command line
Create Database with command line
mysql -u root -pmysql> CREATE DATABASE...
Views: 687
Missing (stealth) nameservers
This happen when primary nameserver did not register with ICAAN. For example ns1 and...
Views: 597
Missing Dependency: bind during yum upgrade
Error: Missing Dependency: bind = 30:9.3.3-7.el5 is needed by package bind-chroot
1) yum remove...
Views: 588
mod_rewrite
This will let us change url to user name. The url carry a (username=user1)...
Views: 579
MRTG
HOW-TO MRTG on cPanel...
Views: 666
Named is down due to rndc.key problem
chmod a+r /etc/rndc.key/etc/init.d/named restart
Views: 585
Net Install CentOS
Malaysia OS Mirror: http://centos.ipserverone.com/centos/5.5/os/x86_64/
Views: 441
Network Card IP information
Display Network Card IP information: /sbin/ifconfigEdit Network Card IP information: cd...
Views: 615
PHP error - Unable to load dynamic library
PHP module not found when I apply
php -v
Error message:
[root@vz1 ~]# php -v PHP Warning:...
Views: 1505
ping: unknown host
When I do a ping I got this errorping: unknown hostcp /etc/resolv.conf /etc/resolv.conf-ori1nano...
Views: 605
Prevent PHP Spammer
You can do this by editing your php.ini file & enter the following:disable_functions =...
Views: 600
Protect DDOS attack with medialayer (D)DoS Deflate
cd /root/download/wget http://www.inetbase.com/scripts/ddos/install.sh chmod 0700...
Views: 687
Quota not running on DirectAdmin
When create account with DirectAdmin, it return with quota not set up.
nano /etc/fstab
# Device...
Views: 1156
Replacing A Failed Hard Drive In A Software RAID1 Array
1 Preliminary Note
In this example I have two hard drives, /dev/sda and /dev/sdb, with...
Views: 472
Reset Linux MySQL Root pass
1. Log on to your system as Administrator.2. Stop the MySQL server if it is running. For a server...
Views: 221
Reset MySQL root pass
Log on to your system as either the Unix root user or as the same user that the mysqld server...
Views: 581
Restart a frozen or Crashed Linux X Desktop
Restart Gnome Desktop:
/etc/init.d/gdm stop/etc/init.d/gdm start
Restart KDE Desktop:...
Views: 563
Restart a service in Ubuntu
/etc/init.d/servicename restart
Views: 592
Rkhunter - install and run
On BSD sytems:cd /usr/ports/security/rkhunter; make install clean; rehash; rkhunter -c(or for...
Views: 588
RPM resources for download
Here is the full list of rpm for centos
http://software.virtualmin.com/bleed/centos/5/x86_64/
Views: 339
Search for path to perl
whereis perl
Views: 558
Secure Mysql command line
/usr/bin/mysql_secure_installation
Views: 363
Set upload file limit for pure-ftp
SSH as rootcp /etc/pure-ftpd.conf /etc/pure-ftpd.conf-ori1nano /etc/pure-ftpd.conffind...
Views: 579
Solve PHP Fatal error: Allowed memory size of 8388608 bytes exhausted
This error message can spring up in a previously functional PHP script when the memory...
Views: 560
SSH with Private Key
Refer to http://linux-sxs.org/networking/openssh.putty.html
Views: 588
Stop Exim
killall exim
or
Service exim stop
or
killall -9 exim
Views: 599
tar command functioon
Create, Extract, See ContentsThe tar program takes one of three funcion command line arguments
c...
Views: 502
Telnet Relay test
SSH to server# telnet relay-test.mail-abuse.org
Views: 606
Transfer files between Linux Server using scp
To transfer file securely between 2 Linux server with scp command
scp -P 22 *.*...
Views: 505
Turning off SELinux
Turning off SELinux Temporary
echo 0 > /selinux/enforce
Turning SELinux back on
echo 1...
Views: 605
Update Linux Server Software
yum updateorup2date
Views: 587
Updatedb and locate not found
Locate and updatedb is not install by default due to heavy cpu usage. However you can install...
Views: 538
Wildcard DNS
Edit your zone file for the domain in question. Create an A reaord *.domain.com to Domain share...
Views: 615
yum "Metadata file does not match checksum" problem
Try one of the following:
yum clean all
yum clean metadata
yum update
yum -y remove...
Views: 674
Yum fail to update python on x86_64 server
==============stuff ommitted==========then======= .. File...
Views: 757
Yum install Mysql 5 on Centos 5
yum install php-mysql mysql mysql-server/sbin/chkconfig --levels 235 mysqld on/etc/init.d/mysqld...
Views: 631
Yum update errors - Invalid boolean
This is the error when doing yum update
---Options Error: Error parsing 'gpgcheck': invalid...
Views: 1103
Zone-transfer block remote server
Put this cose at the top of /etc/named.conf after...
Views: 839
Zone-transfer test for allowed any host
You can verify this by using the 'dig' command on a REMOTE server:=> Add an A record to some...
Views: 592
Powered by WHMCompleteSolution