lanp安装流程

安装需要用依赖包

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

yum install pcre-devel
yum -y install make gcc-c++ cmake bison-devel  ncurses-devel

yum install -y gcc gcc-c++ kernel-devel


开始安装:

wget http://cn2.php.net/get/php-5.5.26.tar.gz/from/this/mirror
tar -zxvf php-5.5.26.tar.gz
cd php-5.5.26
./configure --prefix=/usr/local/php5.5  --enable-fpm --with-mcrypt --enable-mbstring --enable-pdo --with-curl -disable-debug  --disable-rpath --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --enable-gd-native-ttf --with-jpeg-dir --with-freetype-dir
make
make install


cp php.ini-development /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf



wget http://sourceforge.net/projects/pcre/files/pcre/8.33/pcre-8.33.tar.gz/download
tar -zxvf pcre-8.33.tar.gz
cd pcre-8.33
./configure
make
make install


wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install


wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
./config
make
make install


####wget http://nginx.org/download/nginx-1.4.2.tar.gz
wget http://nginx.org/download/nginx-1.9.6.tar.gz
tar -zxvf nginx-1.9.6.tar.gz
cd nginx-1.9.6
./configure --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.33 --with-zlib=/usr/local/src/zlib-1.2.8 --with-openssl=/usr/local/src/openssl-1.0.1c
make
make install




源文件 
http://www.nginx.cn/install
http://www.nginx.cn/231.html


===============================================================================================================


install redis:


http://redis.io/download
wget http://download.redis.io/releases/redis-3.0.5.tar.gz
tar xzf redis-3.0.5.tar.gz
cd redis-3.0.5




make


mkdir -p /usr/local/redis/bin/
mkdir -p /usr/local/redis/conf/


cp redis-benchmark redis-check-aof redis-check-dump redis-cli redis-sentinel redis-server /usr/local/redis/bin/
cp redis.conf /usr/local/redis/conf/




/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf


/usr/local/redis/bin/redis-server
/usr/local/redis/bin/redis-cli




redis> keys *
redis> set key "hello"
OK
redis> get key
"hello"
redis-cli shutdown


===============================================================================================================


wget http://pecl.php.net/get/redis-2.2.7.tgz
tar xvzf redis-2.2.7.tgz
cd redis-2.2.7
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install


extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/redis.so"




===============================================================================================================




编译安装MySQL前的准备工作


yum -y install make gcc-c++ cmake bison-devel  ncurses-devel
yum install -y gcc gcc-c++ kernel-devel
yum install -y readline-devel pcre-devel openssl-devel openssl zlib zlib-devel pcre-devel


wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz
tar -zxvf mysql-5.6.22.tar.gz
cd mysql-5.6.22


cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql5.5 \
-DMYSQL_DATADIR=/usr/local/mysql5.5/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql5.5/mysql.sock \
-DMYSQL_TCP_PORT=3307 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
make && make install




创建mysql用户


groupadd mysql
useradd -g mysql mysql




创建目录并分配权限


mkdir /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
进入安装目录执行脚本,启动服务




cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql


cd /usr/local/mysql
scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql


rm -rf /etc/my.cnf
chkconfig mysql on
service mysql start




设置之前,我们需要先设置PATH,要不不能直接调用mysql


ln -s /usr/local/mysql/bin/mysql /usr/bin/


现在,我们可以在终端内直接输入mysql进入,mysql的环境了


mysql


然后开始给数据库管理员设置密码和访问权限


use mysql
UPDATE user SET password=PASSWORD('root') WHERE user='root';
grant all privileges  on *.* to root@"%" identified by "密码写这里";
FLUSH PRIVILEGES;
exit;


<<<<<<<<<
出现如下错误:configure: error: mcrypt.h not found. Please reinstall libmcrypt.
处理之:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz 
tar -zxvf libmcrypt-2.5.7.tar.gz 
cd libmcrypt-2.5.7 
./configure
make
make install 


>>>>>>>>>>


<<<<<
报错信息:
checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no


注意事项:
这里添加的库文件路径一定要和你系统平台arch一致,32bit的系统直接添加/usr/local/lib即可,64bit系统要填加/usr/local/lib64.否则依旧会报错,我当时就是添加了/usr/local/lib死活编辑不了,后来更改为
/usr/local/lib64才可以。切记


解决办法:
vim /etc/ld.so.conf.d/local.conf     # 编辑库文件
/usr/local/lib                       # 添加该行
:wq                                  # 保存退出
ldconfig -v 
>>>>>

猜你喜欢

转载自blog.csdn.net/q490880/article/details/78412947