r00t.gr

Programming and more

Entries for the ‘Centos’ Category

How to fix: RESULT: csf will not function on this server due to FATAL errors from missing modules [4]

I tried to install CSF to a linux machine running Cpanel. I got the error: RESULT: csf will not function on this server due to FATAL errors from missing modules [4]RESULT: csf will not function on this server due to FATAL errors from missing modules [4] As it turns out this is an openVz issue. […]

How to install git on centos with yum

# Add the repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm   # Install the latest version of git yum install –enablerepo=webtatic git-all# Add the repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm # Install the latest version of git yum install –enablerepo=webtatic git-all Clean, simple and it works!

How to see what programs use the most memory in linux

You have to run:   ps aux | sort -nk +4ps aux | sort -nk +4 That will print you a list of all the running applications and it wil sort them by the 4th column (memory) The same can be applied for CPU, Virual memory etc. Just change the -nk +4 value to +3 […]

How to install apache mod_expires In directadmin DA centos linux

cd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apachecd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apache add: –enable-expires so it looks like this: #!/bin/sh "./configure" \ "–prefix=/etc/httpd" \ "–exec-prefix=/etc/httpd" \ "–bindir=/usr/bin" \ "–sbindir=/usr/sbin" \ "–sysconfdir=/etc/httpd/conf" \ "–enable-so" \ "–enable-dav" \ "–enable-dav-fs" \ "–enable-dav-lock" \ "–enable-suexec" \ "–enable-deflate" \ "–enable-unique-id" \ "–with-suexec-caller=apache" \ […]

How to run rsync from command line script with password

When everything else fails try:   #!/usr/bin/expect set timeout 19900 spawn /bin/bash expect -re "]# " send "rsync -av –delete user@host:someremotefolder/ somelocalfolder\r" expect -re "password:" sleep 2 send "userpassword\r" expect -re "total size is" expect -re "]# " send "exit\r"#!/usr/bin/expect set timeout 19900 spawn /bin/bash expect -re "]# " send "rsync -av –delete user@host:someremotefolder/ somelocalfolder\r" […]

How to install imagemagik to centos 5.8 – with DirectAdmin DA

It’a atually very easy. Just type: yum install ImageMagick ImageMagick-perl yum install ImageMagick ImageMagick-perl Output: Loaded plugins: fastestmirror, priorities Determining fastest mirrors * base: mirror.kiewel-online.ch * epel: mirrors.n-ix.net * extras: mirror.kiewel-online.ch * updates: mirror.kiewel-online.ch base | 1.1 kB 00:00 epel | 3.7 kB 00:00 epel/primary_db | 3.8 MB 00:00 extras | 2.1 kB 00:00 extras/primary_db […]

How to remote backup Direct Admin (rsync backup)

You can never be sure about backups. If you are have a dedicated server you should know, local backup is never enough. Hard disks fail. Every hard disk will fail eventually. So having a remote backup solution is a must. There are many solutions for that problem. The first think I tried was configure da […]

Openvz + rsync problem Disk quota exceeded (122) [fixed]

Ok I had this annoying error. I rent servers to clients, and I user VPSs on another server to backup them. This one client (latest client) had a problem. When I used rsync to move files to the Backup VPS I got a lot of these errors: rsync: write failed on "/vz/private/106/mnt/sdb1/var/lib/mysql/ibdata1": Disk quota exceeded […]

CentOS Linux: Fix bash: ntpdate: command not found centos

First you have to install ntp: Run as root: yum install ntpyum install ntp Then if you run ntpdate again you might get the error again. You can run ntpdate with: /usr/sbin/ntpdate 2.pool.ntp.org/usr/sbin/ntpdate 2.pool.ntp.org Replace 2.pool.ntp.org with another server if that doesn’t work. If you get a ntpdate[585863]: the NTP socket is in use, exiting […]

Change user on linux (or switch users on linux)

The easiest way to switch users in linux is: su usernamesu username if you type only su then root is default. You can to enter the other user’s password to switch to it.