welcome: please sign in
location: Server_OS

Basic System Config for Different OS

These are basic configurations for web servers, focus on VPS settings and are for different Linux distributions. All of them have been tested on my own VPS boxes, but I don't make any kind of promise that they can work on different machine too.


When using ArchLinux on an OpenVZ box, there will be a FATAL: Kernel too old error if upgraded glibc. This is becouse the host uses a kernel older than Arch's, usually 2.6.18.

An older source for OpenVZ

Use an old verson of the official sources.


   1 [core]
   2 # Add your preferred servers here, they will be used first
   3 # Include = /etc/pacman.d/mirrorlist
   4 Server = http://arm.konnichi.com/2010/12/29/core/os/x86_64


   1 # Any
   2 Server = http://arm.konnichi.com/2011/01/28/$repo/os/x86_64
   3 # Server = ftp://mirrors.kernel.org/archlinux/$repo/os/x86_64
   4 # Server = http://mirrors.kernel.org/archlinux/$repo/os/x86_64

A 3rd part glibc

Use a 3rd party glibc build to avoid the error, this glibc is build with kernel 2.6.18


   1 [glibc-vps]
   2 Server = http://dev.archlinux.org/~ibiru/openvz/glibc-vps/x86_64


A newer kernel

   1 sudo apt-get install python-software-properties software-properties-common
   2 sudo add-apt-repository ppa:xorg-edgers/ppa
   3 sudo apt-get update && apt-get dist-upgrade

Remove old kernel

   1 dpkg --get-selections | grep linux
   2 sudo apt-get remove linux-image-3.2.0-24-virtual
   3 sudo apt-get autoremove
   4 sudo apt-get autoclean
   5 sudo update-grub

A Minimal System

This is actually for Debian.

   1 apt-get --force-yes -y purge lynx memtester unixodbc python-* odbcinst-* tcpdump ttf-* apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin
   2 # Then type "Yes, do as I say!" to continue
   3 apt-get autoremove && apt-get autoclean && apt-get update && apt-get dist-upgrade

Note for Debian 7 in OpenVZ:

   1 echo upstart hold | dpkg --set-selections
   2 apt-get install upstart

or the system brokes after dist-upgrade.

If apt-get complains about not having specific GPG keys:

   1 apt-get install debian-keyring # for Debian
   2 apt-get install ubuntu-keyring # for Ubuntu
   3 # or
   4 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <KEY ID>

Use apt-get --reinstall install when necessary.


   1 deb http://ftp.debian.org/debian jessie-backports main
   2 deb-src http://ftp.debian.org/debian jessie-backports main


   1 apt-get -t jessie-backports install xxx


DotDeb doesn't officially support Ubuntu, but can still use it by adding these lines into /etc/apt/sources.list:

   1 echo "deb http://packages.dotdeb.org $(lsb_release -cs) all" >> /etc/apt/sources.list
   2 echo "deb-src http://packages.dotdeb.org $(lsb_release -cs) all" >> /etc/apt/sources.list

Then add the key:

   1 curl http://www.dotdeb.org/dotdeb.gpg | apt-key add -


Percona is an improved MySQL project.

To install percona on Debian, follow this:

   1 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
   2 gpg -a --export CD2EFD2A | sudo apt-key add -

Then add this to /etc/apt/sources.list:

   1 echo "deb http://repo.percona.com/apt $(lsb_release -cs) main" >> /etc/apt/sources.list
   2 echo "deb-src http://repo.percona.com/apt $(lsb_release -cs) main" >> /etc/apt/sources.list

Install by:

   1 apt-get update && apt-get install percona-server-server-5.5 percona-server-client-5.5

CentOS/RHEL/Fedora/Scientific Linux

Remove old kernel

   1 rpm -qa | grep kernel
   2 yum remove kernel-2.6.32-220.el6.i686


   1 rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
   2 rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
   3 #rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

More sources:

   1 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
   2 rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
   3 yum update

Remi repo needs to be enabled manually.

Special repo:

   1 rpm -Uvh http://centos.alt.ru/pub/repository/centos/6/i386/centalt-release-6-1.noarch.rpm

This repo has a latest httpd build, but it conflicts with remi repo, so this need to be disabled and manually selected only when upgrading httpd.

   1 rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
   2 # rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm

The Webtatic repo has a up-to-date httpd, a PHP 5.3.x and MySQL in both 5.1.x and 5.5.x for CentOS 5 but only has PHP 5.4.x for CentOS 6. Need to be enabled manually.

And there is a JasonLitka repo that have a newer MySQL 5.1.x with the package name mysql, see instructions in the page.

Clean Up

   1 yum remove Deployment_Guide-en-US finger cups-libs cups bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools ypbind telnet rsh rcp postfix httpd sendmail bind bind-utils libX* mesa-* perl-* phonon-* ql* qt* samba-* xorg-* alsa-* avahi-* plymouth-* sos


Edit /etc/vimrc and config it as above:

   1 if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   2    set fileencodings=utf-8,ucs-bom,latin1
   3 endif



When in an OpenVZ container, screen may terminates immediately after execution, that's because of a bad permission on TTYs, to fix it, make sure the permissions looks like this in /etc/fstab:

   1 /dev/ptmx  /dev/pts    devpts  rw,nosuid,noexec,relatime,gid=5,mode=620    0       0


Package Management

A slackpkg is useful.

   1 installpkg /path/to/the/file.pkg.xz # install a package


Maybe need to reinstall glibc.

   1 slackpkg update
   2 slackpkg reinstall glibc

Set timezone permanently:

   1 zic -l Asia/Shanghai


Server_OS (last edited 2017-03-19 14:36:14 by AstroProfundis)

How many stars in your bowl, How many sorrows in your soul?
CopyRight © 2011-2017 Allen Zhong, under a CC BY-NC-ND 4.0 License. | IPv6 Enabled.