当前位置: 首页 > Linux

liunx在数据库防火墙nginx上的基本命令操作

时间:2023-04-07 00:23:10 Linux

1.数据库操作打开数据库:systemctlstartmariadb重启数据库:systemctlrestartmariadb关闭数据库:systemctlstopmariadb数据库初始化操作:mysql_secure_installation刷新数据库权限:flushprivileges2。防火墙操作查看防火墙状态:firewall-cmd--state重启防火墙:firewall-cmd--reload手动关闭防火墙:systemctlstopfirewalld.service手动开启防火墙:systemctlstartfirewalld.service设置防火墙不开机后启动:systemctldisablefirewall.servicesystemctlstartfirewall.service查看防火墙开放端口:firewall-cmd--list-ports查看防火墙端口是否开放:firewall-cmd--query-portport)/tcp防火墙设置开放端口:firewall-cmd--zone=public--add-port=portnumber/tcp--peranent防火墙删除开放端口:firewall-cmd--zone=public--remove-port=portnumber/tcp--permanent–zone#Scope–add-port=80/tcp#添加端口,格式为:端口/通信协议–remove-port=80/tcp#移除端口,格式为:端口/通信协议–permanent#永久有效,不带此参数,重启后会失效3.命令检查所有java服务jps检索任意服务命令ps-ef|grep"服务名"杀进程命令kill-9(强制杀)PID号(端口号)kill-15(gentlekill)PID号(端口号)让tomcat程序后台运行:nohupjava-jar8081.war->8081.log&8081.war项目名运行8081。logrun程序产生的日志名称查看文件commandcatfilename4.linuxoperationnginxcommanddownloadnginxwgetinlinux下载文件的路径startnginx./nginxrestartnginx./nginx-sreloadclosenginx./nginx-sstop项目所在目录编写脚本多启动war包运行脚本文件sh脚本文件名.sh