VPS上安装LAMP的步骤(1)


VPS 

图-VPS

VPS上安装LAMP的步骤如下:

最近在rashost买了个VPS,128M内存,8G硬盘,CentOS5操作系统,系统初始化后,内存使用情况如下:

total used free shared buffers cached

Mem: 131232 62872 68360 0 11384 37688

硬盘使用情况如下:

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda1 8256952 626932 7210592 8% /

好可怜的内存,为此,只好尽量少在上面装东西,什么ftp、什么pptp都省得装了。只在上面装了LAMP,分享安装步骤如下。

先安装基本编译程序

yum install gcc

yum install make

下载LAMP需要用到的包

MySQL-client-community-5.1.41-0.rhel5.i386.rpm

MySQL-devel-community-5.1.41-0.rhel5.i386.rpm

MySQL-server-community-5.1.41-0.rhel5.i386.rpm

gd-2.0.35.tar.gz

httpd-2.2.14.tar.gz

libpng-1.2.41.tar.gz

libxml2-2.7.6.tar.gz

php-5.3.1.tar.gz

zlib-1.2.3.tar.gz

由于编译mysql时不大顺利,需要其他包,故没有用源码编译安装,用的是rpm安装安

安装Apache

./configure --prefix=/usr/local/httpd --enable-module=so --enable-rewrite

make

make install

加入启动项,使其随机启动(由于没有安装chkconfig,所以没有用添加服务的方式)

在/etc/rc.d/rc.local中增加启动apache的命令,例如:/usr/local/httpd/bin/apachectl -k start


相关内容