下载并安装lnmp
以下为Demo,实际情况按需调整
| wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz -cO lnmp1.7.tar.gz && tar zxf lnmp1.7.tar.gz && cd lnmp1.7 && ./install.sh lnmp |
| |
| |
| mysql passwd:v492p4!cK@CN |
| |
| Default enable,Enter your choice [Y/n]:Y |
| |
| |
| |
| |
| |
| Enter your choice (1, 2 or 3): 1 |
安装完成后基本配置信息
以下为Demo,实际情况按需调整
| +------------------------------------------------------------------------+ |
| | LNMP V1.7 for CentOS Linux Server, Written by Licess | |
| +------------------------------------------------------------------------+ |
| | For more information please visit https://lnmp.org | |
| +------------------------------------------------------------------------+ |
| | lnmp status manage: lnmp {start|stop|reload|restart|kill|status} | |
| +------------------------------------------------------------------------+ |
| | phpMyAdmin: http://IP/phpmyadmin/ | |
| | phpinfo: http://IP/phpinfo.php | |
| | Prober: http://IP/p.php | |
| +------------------------------------------------------------------------+ |
| | Add VirtualHost: lnmp vhost add | |
| +------------------------------------------------------------------------+ |
| | Default directory: /home/wwwroot/default | |
| +------------------------------------------------------------------------+ |
| | MySQL/MariaDB root password: v492p4!cK@CN | |
| +------------------------------------------------------------------------+ |
| +-------------------------------------------+ |
| | Manager for LNMP, Written by Licess | |
| +-------------------------------------------+ |
| | https://lnmp.org | |
| +-------------------------------------------+ |
| nginx (pid 15932) is running... |
| php-fpm is runing! |
| SUCCESS! MySQL running (16499) |
| State Recv-Q Send-Q Local Address:Port Peer Address:Port |
| LISTEN 0 128 *:80 *:* |
| LISTEN 0 128 *:80 *:* |
| LISTEN 0 128 *:22 *:* |
| LISTEN 0 128 [::]:3306 [::]:* |
| Install lnmp takes 40 minutes. |
安装后调整
以下为Demo,实际情况按需调整
| |
| |
| |
| vim /etc/passwd |
| 将www:/sbin/nologin改为/bin/bash |
| |
| cd /home/ |
| chown -R www:www wwwroot |
| cd /home/wwwroot/ |
| su www |
| chattr -i ./default/.user.ini |
| rm -rf ./default |
| |
| php -i | grep .ini |
| /usr/local/php/etc/php.ini |
| |
| cd /usr/local/php/etc/ |
| vim php.ini |
| |
| disable_functions = 去掉shell_exec,proc_open,proc_get_status |
| |
| cgi.fix_pathinfo=0 改为cgi.fix_pathinfo=1 |
| |
| ps aux | grep php-fpm | grep master | grep -v grep |
| kill -USR2 13225 |
| |
| cd /usr/local/nginx/conf/ |
| fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; |
| |
| sudo vim /etc/sudoers |
| nginx ALL=(ALL:ALL) ALL |
| www ALL=(ALL:ALL) ALL |
| |
添加公钥
以下为Demo,实际情况按需调整
| |
| authorized_keys cat <your_key >>~/.ssh/authorized_keys |
| |
| ssh -I 公钥名 root@地址 -p 端口号 |
| |
| ssh-keygen -t rsa -C "备注信息" |
| |
| |
| cd /home/wwwroot/default |
| |
| git init |
| git remote add origin git@e.coding.net:code-normcore/doTERRA_6th_anniversary_H5/doTERRA_2020_6y_h5_backend.git |
| |
| |
| git pull origin master && git checkout -b develop && git pull origin develop |
| |
| git pull origin master && git checkout -b pre-release && git pull origin pre-release |
| //查看当前分支命令:git branch |
授权项目文件
以下为Demo,实际情况按需调整
| |
| chown -R www:www ./deafult/ |
| |
| |
| [root@dt-6th-uat-app1 wwwroot] |
| ----i--------e-- ./default/.user.ini |
| |
| [root@dt-6th-uat-app1 wwwroot] |