自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

VPS上安裝LAMP的步驟

運維 系統(tǒng)運維
VPS是Virtual Private Server 的簡稱,是虛擬專用服務(wù)器技術(shù)。那如何在VPS上使用LAMP呢,今天教大家下具體的方法!

 

VPS 

圖-VPS

VPS上安裝LAMP的步驟如下:

  最近在rashost買了個VPS,128M內(nèi)存,8G硬盤,CentOS5操作系統(tǒng),系統(tǒng)初始化后,內(nèi)存使用情況如下:

  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% /

  好可憐的內(nèi)存,為此,只好盡量少在上面裝東西,什么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,所以沒有用添加服務(wù)的方式)

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

#p#

  安裝PHP基本支持庫

  libxml2

  zlib

  ligpng

  gd

  基本都是按如下流程編譯安裝,但注意安裝的順序:

  cd source-path

  ./configure

  make

  make install

  MySQL rpm包安裝

  rpm -ivh MySQL-server-community-5.1.41-0.rhel5.i386.rpm #服務(wù)端

  rpm -ivh MySQL-client-community-5.1.41-0.rhel5.i386.rpm #客戶端

  rpm -ivh MySQL-devel-community-5.1.41-0.rhel5.i386.rpm #PHP編譯時需要用到

  復(fù)制配置文件

  cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

  編譯安裝PHP5

  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd/bin/apxs --with-gd=/usr/local --with-mysql --with-libxml-dir --with-png-dir --with-pear=/usr/local/php/pear --enable-mbstring --with-config-file-path=/usr/local/php/ --disable-debug --enable-safe-mode

  make

  make install

  cp php.ini-production /usr/local/php/php.ini #復(fù)制php配置文件到設(shè)定的目錄

  如果不需要支持pear,可以去掉 --with-pear=/usr/local/php/pear

  接下來就可以配置LAMP了,想關(guān)配置文件如下

  PHP配置文件:/usr/local/php/php.ini

  Apache主配置文件:/usr/local/httpd/conf/httpd.conf

  MySQL配置文件:/etc/my.cnf

  相關(guān)啟動命令

  service mysql start|stop|restart

  /usr/local/httpd/bin/apachectl -k start|stop|restart

  以上如有不明或遺漏或有更好的方案,請不惜鍵盤,給我留言,謝謝。

  聽說LNMP(Linux+Nginx+MySQL+PHP)比較省內(nèi)存,下次想試試。

通過文章的描述,你是不是也想在VPS上安裝LAMP呢,趕快動手吧!

【編輯推薦】

 

責任編輯:趙鵬 來源: 網(wǎng)絡(luò)轉(zhuǎn)載
相關(guān)推薦

2011-03-11 15:53:07

CentOS安裝LAMP

2011-12-01 14:28:54

VPNNAT

2011-03-09 10:25:25

Linux安裝LAMP

2011-03-11 17:14:27

2011-03-09 09:30:45

Linux安裝LAMP

2011-03-09 10:52:36

CentOS安裝LAMP

2011-03-23 16:08:15

openSUSELAMP

2011-03-11 13:58:54

2011-03-10 10:55:38

Ubuntu搭建LAMP

2011-03-10 10:51:45

Ubuntu搭建LAMP

2011-03-11 14:02:52

PHPmyadmin安裝

2011-03-10 15:44:18

CentOSLAMP安裝

2011-03-21 10:15:07

LAMPLAMP安裝LAMP配置

2011-03-10 15:44:18

CentOSLAMP安裝

2011-03-31 13:40:33

安裝LAMP

2011-11-18 17:37:24

虛擬專用服務(wù)器VPS服務(wù)器虛擬化

2011-11-19 15:45:20

虛擬化虛擬專用服務(wù)器虛擬服務(wù)器

2011-03-09 10:52:04

ContOSLAMP安裝

2011-03-09 13:46:47

SUSElamp安裝

2011-03-08 11:22:32

LAMP安裝
點贊
收藏

51CTO技術(shù)棧公眾號