第一个SpringBoot开发及腾讯云服务器部署systemctl status firewalld.service

第一阶段【Linux的操作使用】04:防火墙相关操作命令 防火墙相关操作命令 阅读详情

前言

代码路径:https://github.com/Jackpy-node/springboot.git

遇到的问题解决:Linux下mysql经常自动停止挂掉重启的完美解决方式

新建项目

1、新建SpringBoot项目

2、项目类型默认Maven Project,包类型选择生成War或者Jar

3、选择Spring Web项目,并选择SpringBoot版本,点击【next】,完成新建项目

4、项目目录结构

5、pom.xml文件配置

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.kpy</groupId>
    <artifactId>springboot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <!-- 这里打成war包 若打jar,需将war改为jar -->
    <packaging>war</packaging>
    <name>springboot</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <!-- 使用logback记录日志时,必须导入slf4j-api、logback-core、logback-classic -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.26</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.2.3</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
        </dependency>
        <!-- Jpa数据Java持久层API时,需导入spring-boot-starter-data-jpa、commons-dbcp -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>2.1.7.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

6、日志配置文件logback.xml

<?xml version="1.0" encoding="utf-8" ?>
<!-- 从高到地低 OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL -->
<!-- 日志输出规则  根据当前ROOT 级别,日志输出时,级别高于root默认的级别时  会输出 -->
<!-- 以下  每个配置的 filter 是过滤掉输出文件里面,会出现高级别文件,依然出现低级别的日志信息,通过filter 过滤只记录本级别的日志-->

<!--属性描述:
    scan:性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true
    scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
    debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。
-->
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <!-- 定义日志文件 输入位置 -->
    <property name="logPath" value="./logs"/>
    <!-- 日志最大的历史 30天 -->
    <property name="maxHistory" value="30"/>

    <!-- 配置项, 通过此节点配置日志输出位置(控制台、文件、数据库)、输出格式等-->
    <!--
      name:标签名,为了让其他标签调用的唯一标示
      class:引用的类,从此类中可以看出该appender标签定义的是日志输出的位置
    -->

    <!-- 时间滚动输出 level为 CONSOLE 日志 -->
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <!-- 常用
                  %-数字xxx               分隔多少,不要和属性分开写,不挨着会报错
                  %d{HH……} | d           日期,分开会报错
                  %thread                线程
                  %level | p | le        显示级别
                  %logger{数字} | c | lo  类文件,虽然和class一样,但是如果包.类很长,这个可以获取简约长度展示
                  %class | c             输出同上
                  %file  | F             是哪个.java文件
                  %m | msg | message     输出信息
                  %M                     方法
                  %line  | L             错误的行号,少用
                  %caller{数字}           输出信息深度
            -->
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] [%-5level] %logger.%method:%L -%msg%n</pattern>
        </encoder>
    </appender>

    <!-- 时间滚动输出 level为 INFO 日志 -->
    <appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!-- 滚动记录文件,先将日志记录到指定文件,当符合某个条件时,将日志记录到其他文件 RollingFileAppender-->
        <!-- 滚动策略,它根据时间来制定滚动策略.既负责滚动也负责触发滚动 -->
        <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            &lt;!&ndash; 输出路径 &ndash;&gt;
            <fileNamePattern>${logPath}/info/%d{yyyy-MM-dd}.log</fileNamePattern>
            &lt;!&ndash; 日志文件保留天数 &ndash;&gt;
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>-->
        <!-- rollingPolicy按照固定窗口模式生成归档日志文件,当文件大于20MB时,生成新的日志文件。窗口大小是1到3,当保存了3个归档文件后,将覆盖最早的日志。
            同一个RollingFileAppender中,rollingPolicy只能存在一个有效的-->
        <!--<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${logPath}/%d{yyyy-MM-dd}/.log.%i.zip</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>3</maxIndex>
        </rollingPolicy>-->
        <!-- 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender触发当前活动文件滚动 -->
        <!--<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>-->

        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <!-- rollover daily -->
            <fileNamePattern>${logPath}/info/%d{yyyy-MM-dd}-%i.log</fileNamePattern>
            <!-- each file should be at most 5MB, keep 30 days worth of history, but at most 20GB -->
            <maxFileSize>5MB</maxFileSize>
            <maxHistory>${maxHistory}</maxHistory>
            <totalSizeCap>20GB</totalSizeCap>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger %method:%L -%msg%n</pattern>
        </encoder>
        <!-- 此日志文件只记录info级别的 -->
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>info</level>
        </filter>
    </appender>

    <!-- 时间滚动输出 level为 ERROR 日志 -->
    <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logPath}/error/%d{yyyy-MM-dd}.log</fileNamePattern>
            &lt;!&ndash; 日志文件保留天数 &ndash;&gt;
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        &lt;!&ndash; 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender触发当前活动文件滚动 &ndash;&gt;
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>-->

        <!-- 日志格式为${logPath}/error/%d{yyyy-MM-dd}.%i.log时,需要按照以下配置:-->
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <!-- rollover daily -->
            <fileNamePattern>${logPath}/error/%d{yyyy-MM-dd}.%i.log</fileNamePattern>
            <!-- each file should be at most 5MB, keep 30 days worth of history, but at most 20GB -->
            <maxFileSize>5MB</maxFileSize>
            <maxHistory>${maxHistory}</maxHistory>
            <totalSizeCap>20GB</totalSizeCap>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger %method:%L -%msg%n</pattern>
        </encoder>
        <!-- 此日志文件只记录error级别的 -->
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ERROR</level>
        </filter>
    </appender>

    <!-- 时间滚动输出 level为 DEBUG 日志 -->
    <appender name="DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logPath}/debug/%d{yyyy-MM-dd}.log</fileNamePattern>
            <!-- 日志文件保留天数 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <!-- 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender触发当前活动文件滚动 -->
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger %method:%L -%msg%n</pattern>
        </encoder>
        <!-- 此日志文件只记录debug级别的 -->
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>DEBUG</level>
        </filter>
    </appender>

    <!-- 时间滚动输出 level为 WARN 日志 -->
    <appender name="WARN" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logPath}/warn/%d{yyyy-MM-dd}.log</fileNamePattern>
            <!-- 日志文件保留天数 -->
            <maxHistory>${maxHistory}</maxHistory>
        </rollingPolicy>
        <!-- 查看当前活动文件的大小,如果超过指定大小会告知RollingFileAppender触发当前活动文件滚动 -->
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger %method:%L -%msg%n</pattern>
        </encoder>
        <!-- 此日志文件只记录debug级别的 -->
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>WARN</level>
        </filter>
    </appender>

    <!-- 根节点,表名基本的日志级别,里面可以由多个appender规则 -->
    <!-- level="info"代表基础日志级别为info -->
    <!-- 从高到地低 OFF 、 FATAL 、 ERROR 、 WARN 、 INFO 、 DEBUG 、 TRACE 、 ALL -->
    <root level="DEBUG">
        <!-- 引入控制台输出规则 -->
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="INFO" />
        <appender-ref ref="ERROR" />
        <appender-ref ref="DEBUG" />
        <appender-ref ref="WARN" />
    </root>
</configuration>

7、application.properties属性文件,在属性文件中指定数据库配置信息,服务器端口【重要】

设置服务器访问端口

# 服务器HTTP端口
server.port= 8080

设置数据库连接池信息

spring.datasource.max-active=50
#是否在自动回收超时连接的时候打印连接的超时错误
spring.datasource.log-abandoned=true
#是否自动回收超时连接
spring.datasource.remove-abandoned=true
##<!-- 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒 -->
spring.datasource.max-wait=1000
spring.datasource.test-while-idle=true
#检测数据库的查询语句
spring.datasource.validation-query=select 1 from dual
spring.datasource.test-on-borrow=true
#每隔五分钟检测空闲超过10分钟的连接
spring.datasource.min-evictable-idle-time-millis=600000
spring.datasource.time-between-eviction-runs-millis=300000
#服务器配置较低时,需要调整,连接池配置
#Hikari will use the above plus the following to setup connection pooling
spring.datasource.hikari.connection-timeout=20000
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=12
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.max-lifetime=1200000
spring.datasource.hikari.auto-commit=true

完整 application.properties

#Thymeleaf路径
spring.thymeleaf.prefix=classpath:/templates/
#Thymeleaf后缀
spring.thymeleaf.suffix=.html
#Thymeleaf编码
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML5

#JDBC数据库配置
spring.datasource.initialization-mode=never
spring.datasource.url=jdbc:mysql://49.235.145.140:3306/kpy
spring.datasource.username=root
spring.datasource.password=199489
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.datasource.max-active=50
#是否在自动回收超时连接的时候打印连接的超时错误
spring.datasource.log-abandoned=true
#是否自动回收超时连接
spring.datasource.remove-abandoned=true

##<!-- 超时等待时间以毫秒为单位 6000毫秒/1000等于60秒 -->
spring.datasource.max-wait=1000
spring.datasource.test-while-idle=true
#检测数据库的查询语句
spring.datasource.validation-query=select 1 from dual
spring.datasource.test-on-borrow=true
#每隔五分钟检测空闲超过10分钟的连接
spring.datasource.min-evictable-idle-time-millis=600000
spring.datasource.time-between-eviction-runs-millis=300000

#服务器配置较低时,需要调整,连接池配置
#Hikari will use the above plus the following to setup connection pooling
spring.datasource.hikari.connection-timeout=20000
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.maximum-pool-size=12
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.max-lifetime=1200000
spring.datasource.hikari.auto-commit=true

# 服务器HTTP端口
server.port= 8080

8、修改启动Application文件继承SpringBootServletInitializer,实现configure方法【重要】

package com.kpy.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
public class SpringbootApplication extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication.run(SpringbootApplication.class, args);
    }

    // SpringBootServletInitializer 实现configure 方便打war 外部服务器部署。
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SpringbootApplication.class);
    }
}

9、注意:修改pom.xml

10、可以直接到项目根目录下面:运行 maven package命令,打包;我个人直接使用Idea集成的打包工具

11、上传项目至服务器指定目录下

云服务器部署

1、进入安全组,配置安全组规则

2、配置安全组规则,访问的IP和端口

3、进入服务器,查看防火墙状态,确认防火墙已关闭

1、查看firewall服务状态
systemctl status firewalld
出现Active: active (running)切高亮显示则表示是启动状态。
出现 Active: inactive (dead)灰色表示停止,看单词也行。

2、查看firewall的状态
firewall-cmd --state

3、开启、重启、关闭、firewalld.service服务
# 开启
service firewalld start
# 重启
service firewalld restart
# 关闭
service firewalld stop

4、查看防火墙规则
firewall-cmd --list-all 

5、查询、开放、关闭端口
# 查询端口是否开放
firewall-cmd --query-port=8080/tcp
# 开放80端口
firewall-cmd --permanent --add-port=80/tcp
# 移除端口
firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload

4、进入服务器,项目war包所在路径下启动项目

nohup java -jar springboot-0.0.1-SNAPSHOT.war &    #将项目启动并且成为守护进程

 

启动:

启动成功:

启动完整之后查看8080端口是否被监听

#8080端口是否被监听

netstat -an | grep 8080

查看后台守护进程是否正常

#查看守护进程

ps -ef | grep java

页面访问:

总结

整个项目部署过程中,出现问题比较多的是项目启动过程中mysql数据库异常,具体【前言】部分的第二篇文章

 

 

 

 

 

 

量化交易python代码解析:从狙击手算法到最优限价算法 在金融市场的竞技场上,量化交易如同一位冷静的策略大师,它以数学模型为剑,以计算机程序为盾,精准出击,捕捉市场的微妙波动。本文将深入探讨五种核心量化交易算法:直接委托算法(DMA)、时间加权平均算法(TWAP)、冰山算法(Iceberg)、狙击手算法(Sniper)、条件委托算法(Stop)以及最优限价算法(BestLimit),揭开它们背后的运作机制与实战应用。 阅读详情

相关推荐

Ubuntu22.04中通过conda快速部署PyTorch开发环境(CPU/GPU双版本实战)

本文详细介绍了在Ubuntu22.04系统中,如何利用Conda高效部署PyTorch开发环境。文章分别提供了CPU与GPU双版本的实战教程,涵盖环境创建、镜像加速、版本匹配及深度验证等关键步骤,旨在帮助开发者快速搭建稳定、兼容的深度学习环境,从而专注于模型开发。

rose2的博客 558

别再复制粘贴了!手把手教你用腾讯云CentOS 7.5部署Spring Boot项目(含MySQL 5.7避坑指南)

本文详细介绍了在腾讯云CentOS 7.5服务器上部署Spring Boot项目的全流程,包括环境配置、MySQL 5.7安装避坑指南及性能优化技巧。特别针对腾讯云服务器配置环境中的常见问题提供解决方案,帮助开发者高效完成项目部署。

weixin_30443075的博客 353

Zephyr RTOS -- 学习笔记总述

文章目录摘要1. 开发基础部分2. 内核服务入门 本笔记基于 Zephyr 版本 2.6.0-rc2 摘要 1. 开发基础部分 2. 内核服务入门 2.1 线程简介 2.2 线程 2.3 工作队列线程 2.4 调度 2.5 中断 2.6 轮询 API 2.7 信号量

思想给了我们太多的自由,而我们拖累了思想...... 4826

bat 取得服务列表_在 Centos8 上使用 systemctl 防火墙服务

Centos8 systemctl 防火墙服务命令systemctl status firewalld.service // 查看防火墙状态systemctl start firewalld.service // 启动防火墙服务systemctl stop firewalld.service // 关闭防火墙服务systemctl restart firewalld.service // 重启防火...

weixin_39690391的博客 459

什么!!!寒假就要准备暑期实习

介绍暑期实习,从作用,时间线,投递渠道,技术准备,常见问题,经验教训几个方面介绍暑期实习

今天不coding的博客 1726

神经元细胞结构刨析(持续更新)

神经细胞的学习笔记

weixin_46596227的博客 2221

Centos 7 配置防火墙

1、查看firewall服务状态 systemctl status firewalld 2、查看firewall的状态 firewall-cmd --state 3、开启、重启、关闭、firewalld.service服务 # 开启 service firewalld start # 重启 service firewalld restart # 关闭 service firewalld sto...

会走路的蜗牛 3267

基于Pycatia的智能孔特征识别技术:无参模型圆心自动化提取方案

基于Pycatia的智能孔特征识别技术:无参模型圆心自动化提取方案

KE17RS的博客 2879

CentOS7关闭防火墙

4、然后再使用命令"systemctl status firewalld.service",在下方出现inavtive(dead),这样就说明防火墙已经关闭。5、再在命令行中输入命令"systemctl disable firewalld.service"命令,即可永久关闭防火墙。1、命令行界面输入命令"systemctl status firewalld.service"并按下回车键。3、在命令行中输入"systemctl stop firewalld.service"命令,进行关闭防火墙。

不积跬步无以至千里 1万+

软考「系统规划与管理师(第2版)」通关全攻略(2026年下半年)

它考的是一个IT管理者能不能用体系化的语言,把"我们为什么要建这个系统→怎么规划→怎么管好服务→怎么合规"讲圆。所以备考的核心策略也很明确——教材建框架 → 真题磨考点 → 案例练结构 → 论文备好真实项目素材 → 机考练打字。按计划走,不贪全、不盲刷、不死背,稳稳把三科都推过45分那条线。祝你通关 🎯。

软件行业技术文化交流。 3048

Go游戏服务器开发的一些思考(一):语言层面

Go是比C++更好用的高级语言使用Go作为服务器开发的主语言前,首先需要对Go语言做下定性。在接触Go前,可能给人的印象(至少是我),Go是一门脚本语言。看了 官方文档 ,才知道Go是一门高级语言。与C++相比,它有以下优势: 面向接口的编程没有C++复杂的面向对象语法,如类、继承、多态、虚函数等等。Go中只有结构与接口,从语言层面上,直接指导功能与功能间的解耦。直接且语法简单 提供语言反射机制提供

范安崇的博客 9560

firewalld防火墙命令行工具

firewall-cmd预定义信息主要包括三种:可用的区域、可用的服务以及可用的ICMP阻塞类型. 具体的查看命令如下所示。

m0_73258133的博客 3772

论文复现5:UMI Universal Manipulation Interface

UMI 采用手持式夹具,加上精心的界面设计,可实现便携式、低成本和信息丰富的数据收集,以进行具有挑战性的双手和动态操作演示。配备这些功能后,UMI 框架解锁了新的机器人操作功能,只需更改每个任务的训练数据,即可实现零样本可推广的动态、双手、精确和长视野行为。我们通过全面的现实世界实验展示了 UMI 的多功能性和有效性,其中通过 UMI Zeroshot 学习的策略在对不同的人类演示进行训练时可以推广到新的环境和对象。项目主页:https://umi-gripper.github.io/

github_38060285的博客 1979

CentOS 7关闭与开启防火墙方法以及systemctl命令的命名解读

文章目录1. 命令解读2. 关闭防火墙3. 开启防火墙4. 重启防火墙4.1. 方法 14.2. 方法2 1. 命令解读 命令解析:systemctl为system control的缩写,意为系统控制 2. 关闭防火墙 查看防火墙当前的状态systemctl status firewalld.service 防火墙默认为开启状态,如果自己之前没有关闭过,则会是active(running) 关闭防火墙systemctl stop firewalld.service 关闭防火墙之后再次查看状态,会看到

COCO56的博客 4534

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

银河麒麟服务器操作系统 V10 SP1 防火墙(firewalld)指令

systemctl status firewalld(或者:systemctl status firewalld.service,或者:systemctl is-active firewalld)active(running):表示防火墙已经开启。4、关闭端口:firewall-cmd --permanent --remove-port=[端口]/tcp,success表示关闭成功。1、查询全部已开放的端口:firewall-cmd --list-all。

weixin_43741718的博客 1万+

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Linux的systemctl命令详解、(永久)关闭SElinux和firewalld防火墙

本文详细介绍了Linux系统中服务管理的常用操作,包括:1.使用systemctl命令管理httpd服务(查看状态、启动/停止、开机自启、重启和重载配置);2.SElinux的关闭方法,包括临时关闭(setenforce 0)和永久修改配置文件;3.防火墙服务(firewalld)的关闭操作,包括临时关闭和永久禁用。文章通过具体命令示例展示了各项操作的实际执行过程和状态变化,为Linux系统管理员提供了实用的服务管理参考。

树下一少年的博客 2万+

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

centos7怎么永久关闭防火墙

1、命令行界面输入命令“systemctl status firewalld.service”并按下回车键。 2、然后在下方可度以查看得到“active(running)”,此时说明防火墙已经被打开了。 3、在命令行中输入systemctl stop firewalld.service命令,进行关闭防火墙。 4、然后再使用命令systemctl status firewalld.service,在下方出现disavtive(dead),这权样就说明防火墙已经关闭。 5、再在命令行中输入命令“syst

weixin_42290901的博客 6606

CentOS7使用firewalld打开关闭防火墙与端口

1、firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的

TStana的博客 1340

戏说防火墙

若需为某服务敞开大门,譬如那http服务,需通行于2100之端口,只需轻描淡写地输入“firewall-cmd --zone=public --add-port=2100/tcp --permanent”,防火墙便心领神会,为2100端口大开绿灯。更甚者,若想让防火墙永无再现之日,只需轻挥手指,键入“systemctl disable firewalld.service”,防火墙便再也无法随系统重启而复苏,彻底从生活中消失。先探其状,再撤其防,终禁其启,三步并作一步,防火墙便再难现身。

qq_38156015的博客 424

CentOS7 firewalld防火墙的基本使用

CentOS7 firewalld防火墙的基本使用

qq_24604781的博客 1610

在Linux7上配置防火墙

在Linux7上配置防火墙的操作步骤

山有山的高度,海有海的胸怀。 1379

systemctl / firewalld

查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0。查看所有打开的端口: firewall-cmd --zone=public --list-ports。查看区域信息: firewall-cmd --get-active-zones。查看是否拒绝: firewall-cmd --query-panic。取消拒绝状态: firewall-cmd --panic-off。拒绝所有包:firewall-cmd --panic-on。

Pterosaur 925

虚拟机CentOS7命令查看防火墙的状态以及开放端口

命令: systemctl status firewalld.service 查看防火墙状态 systemctl start firewalld.service 开启防护墙 systemctl stop firewalld.service 关闭防火墙 查看以及启动状态: 关闭状态: 查看已开放端口 firewall-cmd --list-all 防火墙开放端口:(开放端口后需重载防火墙) firewall-cmd --zone=public --add-port=80/tc

weixin_43862596的博客 2940

linux常用命令

1.关闭防火墙命令:systemctl stop iptables systemctl start iptables systemctl restart iptables 2.启动elasticsearch命令:切换tiger用户,进入elasticsearch/bin目录 cd /home/tiger/elasticsearch/bin 执行 ./elasticsearch 3.查看进程:ps -ef | grep nginx 重启命令网卡:service network restart 1. 启

qq_38736134的博客 920

linux centos 查看防火墙firewalld、iptables状态

firewalld是跟iptables.service一个层面上的东西。 iptables跟firewall的关系是firewall会使用到iptables命令。 CentOS6.5查看防火墙的状态: [linuxidc@localhost ~]$service iptable status CentOS 6.5关闭防火墙 [root@localhost ~]#servcie ...

667

linux防火墙开启和关闭

查看防火墙状态 systemctl status firewalld 关闭防火墙,重启后失效 systemctl stop firewalld 暂时关闭后,开启防火墙 systemctl start firewalld 关闭防火墙,重启后仍保持关闭 systemctl disable firewalld 开启防火墙 systemctl enable firewalld   fir...

qq_40006446的博客 1564
上一篇: centos7 由命令行模式改为图形界面模式
下一篇: 云服务器 mysql经常自动停止挂掉重启
Royal-Kpy
博客等级 码龄10年 2粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值