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.
A 3rd part glibc
Use a 3rd party glibc build to avoid the error, this glibc is build with kernel 2.6.18
A newer kernel
Remove old kernel
A Minimal System
This is actually for Debian.
Note for Debian 7 in OpenVZ:
or the system brokes after dist-upgrade.
If apt-get complains about not having specific GPG keys:
Use apt-get --reinstall install when necessary.
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:
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:
Then add this to /etc/apt/sources.list:
1 apt-get update && apt-get install percona-server-server-5.5 percona-server-client-5.5
Remove old kernel
Remi repo needs to be enabled manually.
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.
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.
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:
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
A slackpkg is useful.
Maybe need to reinstall glibc.
Set timezone permanently:
1 zic -l Asia/Shanghai