鉴于现在的VPS越来越便宜,很多人想自己用VPS搭建LNMP环境.现在网上也有LNMP一键安装包,有利有弊吧.linux

安装好基本的VPS环境后,root登陆centos

  1. [shell]# vim /etc/yum.repos.d/jidda.name.repo[/shell]
    加入以下内容
    [shell]
    [CentALT]
    name=CentALT Packages for Enterprise Linux 5 – $basearch
    baseurl=http://centos.alt.ru/repository/centos/5/$basearch/
    enabled=1
    gpgcheck=0
    protect=1
    [/shell]
    再根据服务器所在地区和网络更换更新源
  2. 启用 EPEL repo
    如果你是32位系统,输入以下命令
    [shell]rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm[/shell]
    如果你是64位系统,则输入以下命令
    [shell]rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm[/shell]
    然后再
    [shell]rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL[/shell]
  3. 安装nginx+php+mysql,输入
    [shell]yum -y install nginx php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator mysql-server[/shell]
    等待安装完成,更具你自己的需要选择是否更新
    [shell]yum -y update[/shell]
    OK,整个环境已经配置好了,并且安装了一些php的常用扩展.
  4. 设置Nginx,PHP-FPM,MySQL开机启动
    [shell]setup[/shell]
    勾选开机启动的服务…
    或者
    [shell]
    chkconfig –level 345 mysqld on
    chkconfig –level 345 php-fpm on
    chkconfig –level 345 nginx on
    [/shell]
  5. 启动Nginx,PHP-FPM,MySQL:
    [shell]
    service mysqld start
    service php-fpm start
    service nginx start
    [/shell]

环境已经配好,根据需要修改/etc下的配置文件

关于作者


jidda一共有27篇博文

发表评论

电子邮件地址不会被公开。 必填项已被标记为 *

*

TOP Online Store
1.Girls' Generation, a Fantasy Jewelry online Store. Nobody Can Keep Away From the Beauty:tiffany ca 2.China Wholesale Electronics:China Wholesale Electronics 3.The android phone is best:Android sale.The Android Ice cream sandwich well be best Android OS. 4.R4 3DS for sale:R4 ds shops,and support Japanese R4:R4 販売. 5.fashion bag:armani watches and MBT shoes.
R4 V1.4.2 and your R4i Gold 1.4.2 and R4i GOLD 3DS card V1.4.2 can not work on it.
Please update your R4i Gold 1.4.2 and R4i GOLD 3DS card V1.4.2 card with this patch. Please read readme.txt attached firstly.Just do as the procedures listed in readme.