ubuntu学习笔记

lnmp安装

apt install -y php7.2 php7.2-fpm php7.2-dev php-pear composer 
apt install nginx

nginx配置文件
/etc/nginx/sites-enabled/default

方式1:推荐使用
location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
    include fastcgi_params;    
}
方式2:需要修改/etc/php/7.2/fpm/pool.d/www.conf
location ~ .php$ {  
   fastcgi_pass 127.0.0.1:9000;  
   fastcgi_index index.php;  
   fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;  
   include fastcgi_params;  
}
//需修改/etc/php/7.2/fpm/pool.d/www.conf
;listen = /run/php/php7.2-fpm.sock
listen = 127.0.0.1:9000

相关命令

service php7.2-fpm stop
service php7.2-fpm start
service php7.2-fpm restart
service php7.2-fpm status

service nginx stop
service nginx start
service nginx restart
service nginx status

nginx
nginx -s quit
nginx -s stop
nginx -t -c /etc/nginx/nginx.conf
nginx -t
nginx -s reload
nginx -s reopen

安装ssh

apt install openssh-server 
/etc/init.d/ssh start
ps –e | grep ssh

挂载远程文件到本地

apt install openssh-server 
/etc/init.d/ssh start
ps –e | grep ssh

你可能感兴趣的:(linux)