CentOS LNMP安装

来源:互联网 发布:windows snmp 软件 编辑:程序博客网 时间:2024/06/04 17:54
LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RadHat、Debian/Ubuntu VPS(VDS)或独立主机安装LNMP(Nginx、MySQL、PHP、phpMyAdmin)生产环境的Shell程序。

一、安装好CentOS,登陆CentOS

二、输入命令

yum install screen 或 apt-get install screenyum install net-toolsscreen -S lnmpyum install wgetwget -c http://soft.vpser.net/lnmp/lnmp1.1-full.tar.gz && tar zxf lnmp1.1-full.tar.gz && cd lnmp1.1-full && ./centos.sh

安装过程中需要输入Mysql root的密码,和询问安装PHP、MariaDB等模块的版本,选择后按任意键开始。
安装结束以后,LNMP脚本就会自动安装编译Nginx、MySQL、PHP、phpMyAdmin、Zend Optimizer这几个软件。

三、虚拟主机

新增:

/root/vhost.sh

删除命令:

ssh登陆执行命令:rm /usr/local/nginx/conf/vhost/域名.conf如,前面我们添加的主域名是www.vpser.net,则该命令为:rm /usr/local/nginx/conf/vhost/www.vpser.net.conf 


虚拟主机配置文件在:/usr/local/nginx/conf/vhost/域名.conf
伪静态规则文件需要放在/usr/local/nginx/conf/ 下面。

四、其它

1、eAccelerator

在lnmp解压后的目录(我这里目录是/lnmp1.1-full),执行
./eaccelerator.sh

2、xcache

./xcache.sh

3、memcached

./memcached.sh


4、imageMagick

./imageMagick.sh


5、Redis

./redis.sh


6、mysql 远程登陆权限

grant all PRIVILEGES on databasename.* to 'user'@'%' identified by '123456';flush privileges;

然后设置iptables


五、状态管理

LNMP状态管理命令:

LNMP状态管理: /root/lnmp {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PHP-FPM状态管理:/etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}

如重启LNMP,输入命令:/root/lnmp restart 即可,单独重启mysql:/etc/init.d/mysql restart

LNMPA状态管理命令:

LNMPA状态管理: /root/lnmpa {start|stop|reload|restart|kill|status}
Nginx状态管理:/etc/init.d/nginx {start|stop|reload|restart}
MySQL状态管理:/etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached状态管理:/etc/init.d/memcached {start|stop|restart}
PureFTPd状态管理: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd状态管理: /etc/init.d/proftpd {start|stop|restart|reload}
Apache状态管理:/etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}


安装参考:

http://lnmp.org/install.html

0 0