解壓命令 (tar -zxvf .tar.gz| tar xvf .tgz)php
安裝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 lnmphtml
(新系統先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)mysql
一、安裝iptables服務:
(http://blog.csdn.net/c233728461/article/details/52679558)
systemctl stop firewalld
systemctl mask firewalld linux
而且安裝iptables-services:
yum install iptables-services c++
設置開機啓動:
systemctl enable iptables sql
systemctl stop iptables
systemctl start iptables
systemctl restart iptables
systemctl reload iptables 數據庫
保存設置:
service iptables save vim
配置規則:
Centos下lnmp正確iptables配置規則
https://www.cnblogs.com/lbnnbs/p/6554701.htmlbash
二、改數據庫遠程訪問權限
mysql -u root -p
use mysqlcurl
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;
三、查看防火牆和關閉
firewalld-cmd --state
systemctl stop firewalld.server
或
service iptables stop
安裝一鍵安裝包之外的模塊
1、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