解压命令 (tar -zxvf .tar.gz| tar xvf .tgz)
安装lnmp1.4
(https://lnmp.org/install.html)
wget -c http://soft.vpser.net/lnmp/lnmp1.4.tar.gz && tar zxf lnmp1.4.tar.gz && cd lnmp1.4 && ./install.sh lnmp
(新系统先yum安装模块,旧系统重新安装就不用了,yum install gcc gcc-c++ bzip2 make vixie-cron flex ncurses-devel wget patch ntp libxml2 libxml2-devel libevent m4 autoconf zip unzip libjpeg libjpeg-devel gd gd-devel freetype freetype-devel libpng libpng-devel openssl openssl-devel file libtool libtool-libs gmp-devel pspell-devel parted zlib perl mod_perl-devel apr-util ftp readline-devel readline-devel apr apr-util curl-devel)
1、安装iptables服务:
(http://blog.csdn.net/c233728461/article/details/52679558)
systemctl stop firewalld
systemctl mask firewalld
并且安装iptables-services:
yum install iptables-services
设置开机启动:
systemctl enable iptables
systemctl stop iptables
systemctl start iptables
systemctl restart iptables
systemctl reload iptables
保存设置:
service iptables save
配置规则:
Centos下lnmp正确iptables配置规则
https://www.cnblogs.com/lbnnbs/p/6554701.html
2、改数据库远程访问权限
mysql -u root -p
use mysql
mysql> select host, user from user;
将相应用户数据表中的host字段改成'%';
update user set host='%' where user='root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' 不予理会
flush privileges;
3、查看防火墙和关闭
firewalld-cmd --state
systemctl stop firewalld.server
或
service iptables stop
安装一键安装包以外的模块
一、memcache
(http://www.linuxidc.com/Linux/2014-06/103361.htm)
1.安装依赖库(libevent)
[root@localhost tong]# tar xvf libevent-1.4.13-stable.tar.gz
[root@localhost tong]# cd libevent-1.4.13-stable
[root@localhost libevent-1.4.13-stable]# ./configure --prefix=/usr/local/test/libevent
[root@localhost libevent-1.4.13-stable]# make
[root@localhost libevent-1.4.13-stable]# make && make install
[root@localhost libevent-1.4.13-stable]# echo $?
0
[root@localhost libevent-1.4.13-stable]#
2.安装memcached服务端
[root@localhost libevent-1.4.13-stable]# cd ..
[root@localhost tong]# tar xvf memcached-1.4.20.tar.tar
[root@localhost tong]# cd memcached-1.4.20
[root@localhost memcached-1.4.20]# ./configure --prefix=/usr/local/test/memcached --with-libevent=/usr/local/test/libevent/
[root@localhost memcached-1.4.20]# make
[root@localhost memcached-1.4.20]# make install
[root@localhost memcached-1.4.20]# echo $?
0
[root@localhost memcached-1.4.20]#
3.安装memcache客户端
[root@localhost memcached-1.4.20]# cd ..
[root@localhost tong]# tar xvf memcache-3.0.6.tgz
[root@localhost memcache-3.0.6]# /usr/local/php/bin/phpize
[root@localhost memcache-3.0.6]# ./configure --enable-memcache --with-php-config=/usr/local/test/php/bin/php-config --with-zlib-dir
[root@localhost memcache-3.0.6]# make
[root@localhost memcache-3.0.6]# make install
[root@localhost memcache-3.0.6]# echo $?
0
[root@localhost memcache-3.0.6]# vim /usr/local/test/php/lib/php.ini --进入php.ini配置文件添加如下两行
extension_dir = "/usr/local/test/php/lib/php/extensions/debug-non-zts-20090626/"
extension=memcache.so
4.启动memcached服务
./memcached -d -m 2048 -u root -c 1024 -p 11211
查看linux版本信息:
lsb_release -a
-bash: lsb_release: command not found
解决方法:yum install redhat-lsb -y