欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

linux 常用命令

程序员文章站 2022-06-04 19:21:07
...
useradd 用户名称
passwd huxupan 密码

chmod 修改文件权限
chown 修改文件用户

(1)禁止root用户登录
修改vim /etc/ssh/sshd_config 文件
1、修改默认端口:默认Port为22,并且已经注释掉了;修改是把注释去掉,并修改成其它的端口。
2、禁止root用户远程登陆:修改PermitRootLogin,默认为yes且注释掉了;修改是把注释去掉,并改成no。并重启sshd-- /bin/systemctl restart sshd.service
3、PermitEmptyPasswords    no不允许空密码用户login


(2)在php.ini中,找到disable_functions选项
删除symlink就可以使用php artisan storage:link



redis报错:
(3)Could not connect to Redis at 127.0.0.1:6379: Connection refused
修改配置文件:redis.conf,把 daemonize no 为 daemonize yes
开启客户端要确保服务端启动:redis-server ./redis.conf

设置密码:config set requirepass 密码

./redis-cli -h 127.0.0.1 -p 6379 -a myPasswor登录命令



(4)redis快照报错:
(error) MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

启动客户 redis-cli
然后输入
config set stop-writes-on-bgsave-error no



(5)no input file specified.报错
1. 更改php.ini
首先php.ini的配置中把
;cgi.fix_pathinfo=0   改为
cgi.fix_pathinfo=1


2. 在nginx/conf/nginx.conf   找到: 
fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;  改为: 
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;


(6)No input file specified 的问题解决
1、vim php-fpm-conf添加或者修改
listen = /tmp/php-cgi.sock为 listen = /tmp/php-fpm.sock

2、cd php-fpm.d
vim www.conf.default
修改
;listen = 127.0.0.1:9000
listen = /tmp/php-fpm.sock

3、nginx配置文件
fastcgi_pass   unix:/tmp/php-cgi.sock; 改为 unix:/tmp/php-fpm.sock;

备份:/tmp/php-cgi.sock


(7)lnmp无法删除.user.ini
chattr -i .user.ini

(8)修改mysql密码
UPDATE user SET Password=PASSWORD('a26954481fde43be') where USER='root';//修改mysql密码


flush privileges;执行命令立即生效

/bin/systemctl stop  iptables.service

(9)mysql开启远程连接
mysql -u root -p //登录mysql: 提示输入密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'a26954481fde43be' WITH GRANT OPTION;//允许mysql远程连接
flush privileges;执行命令立即生效

如果不成功则是防火墙没设置
1.FirewallD防火墙开放3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
2.重启防火墙
systemctl restart firewalld.service

(10)git
git reset --hard origin/master













相关标签: linxu