CentOS上15分钟内安装LAMP(适用于所有VPS)

 

http://www.hostloc.com/thread-43782-1-2.html

本文适用于所有的vps,测试环境为YARD 128M OPENVZ和IWEBFUSION 256M OPENVZ
非LNMP,非一键安装包

yum -y update
yum -y install gcc gcc-c++ authconf automake libtool libevent libevent-devel
yum -y install ncurse nucrse-devel gd gd-deevel freetype freetype-devel fontconfig fontconfig-devel libjpeg libjpeg-devel zlib zlib-devel pcre pcre-devel
yum -y install libmcrypt mhash

yum -y install mysql mysql-server mysql-devel
yum -y install httpd httpd-devel
yum -y install php*


启动apache
/etc/init.d/httpd restart

启动mysql
/etc/init.d/mysqld restart

编辑一个php测试文件
vi /var/www/html/info.php
加入:
<?php
phpinfo();
?>

现在可以通过http://ip/info.php查看LAMP信息了
例如我的测试机地址是
http://64.34.205.27/info.php


设置开机启动
chkconfig httpd on
chkconfig mysqld on


附:如果需要修改的话,那么修改配置文件即可。
附1:mysql配置文件所在位置:
# ls -l /etc/my.cnf 
-rw-r--r-- 1 root root 441 Nov  4 02:53 /etc/my.cnf


附2:apache配置文件所在位置:
# ls -l /etc/httpd/
total 8
drwxr-xr-x 2 root root 4096 Jan 11 07:06 conf
drwxr-xr-x 2 root root 4096 Jan 11 07:03 conf.d
lrwxrwxrwx 1 root root   19 Jan 11 06:53 logs -> ../../var/log/httpd
lrwxrwxrwx 1 root root   27 Jan 11 06:53 modules -> ../../usr/lib/httpd/modules
lrwxrwxrwx 1 root root   13 Jan 11 06:53 run -> ../../var/run



附3:php配置文件所在位置:
# ls -l /etc/php.ini 
-rw-r--r-- 1 root root 45079 Nov 30 00:53 /etc/php.ini
#

<<全文结束>>

 

 

 

 

 

 

后来的回复者

 

你的不够全面:

引用:
cd /tmp
mkdir src
cd /tmp/src
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison file
yum -y install libtool libtool-libs autoconf kernel-devel
yum -y install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
yum -y install ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal nano sendmail
yum -y install fonts-chinese gettext gettext-devel
yum -y install ncurses-devel
yum -y install gmp-devel pspell-devel
yum -y install unzip
yum install gcc gcc-c++ flex autoconf automake make m4 patch libtool openssl-devel file time mlocate sudo bind-utils -y
yum update -y
wget  http://monkey.org/~provos/libevent-2.0.9-rc.tar.gz
tar -xzf libevent-2.0.9-rc.tar.gz
cd libevent-2.0.9-rc
./configure
make && make install
cd /tmp/src
wget  http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
tar -xzf memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure
make && make install
cd /tmp/src
wget  http://launchpad.net/libmemcache ... mcached-0.44.tar.gz
tar -xzf libmemcached-0.44.tar.gz
cd libmemcached-0.44
./configure
make && make install
cd /tmp/src
yum install mysql-server -y
rpm -ivh  http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm
yum --enablerepo=webtatic install php-devel php php-mysql php-sockets php-process php-pecl-memcache php-pecl-gearman httpd php-mcrypt php-mbstring -y
cd /var/www/html
wget  http://sourceforge.net/projects/ ... ges.tar.gz/download
tar -xzf phpMyAdmin-3.3.8.1-all-languages.tar.gz
mv phpMyAdmin-3.3.8.1-all-languages phpmyadmin
cd /root



再回复者

yum -y install gcc gcc-c++ authconf automake libtool libevent libevent-devel
yum -y install ncurse nucrse-devel gd gd-deevel freetype freetype-devel fontconfig fontconfig-devel libjpeg libjpeg-devel zlib zlib-devel pcre pcre-devel
yum -y install libmcrypt mhash

还是安装了不少废物....
yum install httpd php mysql-server mysql
其实一句话就完事了..

 

你可能感兴趣的:(PHP,mysql,centos,gcc,memcached)