<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>Eric&#039;s Blog - centos 7</title>
<link>https://eblog.ink/category/centos-7/</link>
<atom:link href="https://eblog.ink/feed/category/centos-7/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Fri, 13 May 2022 09:31:27 +0000</lastBuildDate>
<pubDate>Fri, 13 May 2022 09:31:27 +0000</pubDate>
<item>
<title>Linux 下载Bt或者磁力连接文件</title>
<link>https://eblog.ink/archives/316/</link>
<guid>https://eblog.ink/archives/316/</guid>
<pubDate>Fri, 13 May 2022 09:31:27 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[安装npmapt install -y npm安装tget：npm install -g t-get迅雷torrent种子文件的下载：wgethttp://releases.ubuntu.com...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>安装npm</p><pre><code>apt install -y npm

</code></pre><p>安装tget：</p><pre><code>npm install -g t-get

</code></pre><p>迅雷torrent种子文件的下载：</p><pre><code>wgethttp://releases.ubuntu.com/16.04/ubuntu-16.04.1-desktop-amd64.iso.torrent $ tgetubuntu-16.04.1-desktop-amd64.iso.torrent 

</code></pre><p>tget-用于BT种子/磁力链接下载的wget</p><p>磁力链接的下载</p><pre><code>tget &#039;magnet:?xt=urn:btih:0403fb4728bd788fbcb67e87d6feb241ef38c75a&#039;

</code></pre><p>如果是大文件，下载会很费时间，占用连接的终端，断开连接就会导致下载失败。<br>我们可以将下载命令写入到脚本中，然后后台运行即可。当top中搜索不到node程序就是下载完成了。</p><p>后台执行脚本或者screen下载文件</p><p>原文链接：<a href="https://blog.csdn.net/weixin_44578029/article/details/120620017">原文</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/316/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos7 更换国内yum源</title>
<link>https://eblog.ink/archives/303/</link>
<guid>https://eblog.ink/archives/303/</guid>
<pubDate>Wed, 13 Oct 2021 05:18:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[一、阿里云源1、备份mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup2、下载新的Cent...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>一、阿里云源<br>1、备份</p><pre><code>mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
</code></pre><p>2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/</p><pre><code>wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

</code></pre><p>3、生成缓存</p><pre><code>yum makecache

</code></pre><p>二、清华大学源【推荐】<br>（1）、首先备份 CentOS-Base.repo</p><pre><code>mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
</code></pre><p>1<br>（2）、之后启用 TUNA 软件仓库， 将清华大学镜像仓库信息写入 /etc/yum.repos.d/CentOS-Base.repo</p><pre><code>vim /etc/yum.repos.d/CentOS-Base.repo
</code></pre><p>1<br>将 CentOS-Base.repo 中的内容 更新为 下面的内容：</p><pre><code># CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;arch=$basearch&amp;repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;arch=$basearch&amp;repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;arch=$basearch&amp;repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;arch=$basearch&amp;repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
</code></pre><p>（3）、清除缓存</p><p><code>yum clean all</code>     # 清除系统所有的yum缓存<br><code>yum makecache</code>     # 生成yum缓存</p><p><a href="https://blog.csdn.net/VariatioZbw/article/details/108698712">原文</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/303/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>CentOS7.4 上部署 Cisco AnyConnect</title>
<link>https://eblog.ink/archives/286/</link>
<guid>https://eblog.ink/archives/286/</guid>
<pubDate>Fri, 25 Jun 2021 06:29:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[部署 - 证书现有的教程多半使用编译方式来安装 ocserv，实际上 EPEL 源中已经包含了这个包，而且还是最新的，因此只需要安装 EPEL 在安装 ocserv 即可执行以下命令即可：yum...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>部署 - 证书<br>现有的教程多半使用编译方式来安装 ocserv，实际上 EPEL 源中已经包含了这个包，而且还是最新的，因此只需要安装 EPEL 在安装 ocserv 即可<br>执行以下命令即可：</p><pre><code>yum install epel-release -y
yum install ocserv -y
</code></pre><p>现有的教程还有另一个坑，都是教你使用 certtool 生成自签名证书来使用的；如果你不想被中间人攻击的话，最好别这么干<br>事实上有效的证书很容易获得，以前介绍过的 Let's Encrypt 就是很可靠的一个签发机构<br>如果你还不知道如何获取 Let's Encrypt 的证书，你可以参考此文章：<a href="https://e2c.net/2019/08/24/160.html">https://e2c.net/2019/08/24/160.html</a></p><p>获取到证书后，你需要将证书复制进 /etc/ocserv/ssl 这个文件夹(其他文件夹也可以，记得改配置文件就行)，没有的话用以下命令创建</p><pre><code>mkdir -p /etc/ocserv/ssl
cd /etc/ocserv/ssl
</code></pre><p>完成后的 /etc/ocserv/ssl 目录应该是这样的：</p><p>部署 - 配置文件<br>完成证书配置之后，下一步就是对配置文件进行修改<br>默认情况下，配置文件位于 <code>/etc/ocserv/ocserv.conf</code>，以下的配置字段需要重点关注</p><p>*# 将验证方式设为用户名+密码</p><pre><code>auth = &quot;plain[passwd=/etc/ocserv/ocpasswd]&quot;
</code></pre><p>*# TCP/UDP端口，默认为443</p><pre><code>tcp-port = 443
udp-port = 443
</code></pre><p>*# 在上一步中添加的证书，请根据实际情况自行修改</p><pre><code>server-cert = /etc/ocserv/ssl/server-cert.pem
server-key = /etc/ocserv/ssl/server-key.pem
</code></pre><p>*# 最大连接数</p><pre><code>max-clients = 20
</code></pre><p>*# 每个用户的最大设备数</p><pre><code>max-same-clients = 3
</code></pre><p>*# MTU自动配置，不是True的话会奇慢无比</p><pre><code>try-mtu-discovery = true
</code></pre><p>*# 很多教程没有提及的点，默认是会启用TLS1.0的<br>*# 还有RSA类无前向保密的算法，为了安全起见<br>*# 此配置只启用了TLS1.2和128位以上具有前向保密的算法</p><pre><code>tls-priorities = &quot;SECURE128:+SECURE256:-VERS-ALL:+VERS-TLS1.2&quot;
</code></pre><p>*# 默认域名，建议设置位前一步中证书签发的域名</p><pre><code>default-domain = ocserv.xxx.com
</code></pre><p>*# 网段信息：建议修改以避免域现有网段冲突</p><pre><code>ipv4-network = 172.31.0.0
ipv4-netmask = 255.255.255.0
</code></pre><p>*# 路由信息：此配置位绕过局域网</p><pre><code>route = 0.0.0.0/192.0.0.0
route = 64.0.0.0/192.0.0.0
route = 128.0.0.0/192.0.0.0
route = 192.0.0.0/192.0.0.0
no-route = 192.168.0.0/255.255.0.0
</code></pre><p>之后需要创建一个新用户，使用以下命令</p><pre><code>ocpasswd -c /etc/ocserv/ocpasswd iclart
</code></pre><p>输入两遍密码即可，此时 /etc/ocserv 目录结构应该如下图：</p><p>部署 - 系统配置<br>完成 ocserv 的配置文件编辑后，我们需要对系统进行一些配置<br>首先，需要开启 IPv4 转发</p><pre><code>vim /etc/sysctl.conf

net.ipv4.ip_forward = 1
</code></pre><h1>使配置生效</h1><pre><code>sysctl -p
</code></pre><p>其次需要对转发进行配置</p><p>*# 启动 firewalld</p><pre><code>systemctl start firewalld
</code></pre><p>*# 放通端口，注意修改</p><pre><code>firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --permanent --zone=public --add-port=443/udp
</code></pre><p>*# 转发配置，注意将 eth0 修改位你的网卡接口</p><pre><code>firewall-cmd --permanent --add-masquerade
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -o eth0 -j MASQUERADE
</code></pre><p>*# 使配置生效</p><pre><code>firewall-cmd --reload
</code></pre><p>确定没有问题之后，就可以启动 ocserv 了</p><pre><code>systemctl enable ocserv
systemctl start ocserv
</code></pre><p>启动后执行此命令，应该得到类似输出</p><pre><code>netstat -tunlp | grep 443

</code></pre><p>至此，服务端配置已全部完成，在配置客户端时，注意服务器应该填写域名</p><p>原文链接:<a href="https://e2c.net/2019/08/24/159.html">原文</a> <a href="https://blog.csdn.net/qq_40907977/article/details/109312303?utm_medium=distribute.pc_feed_404.none-task-blog-2~default~BlogCommendFromBaidu~default-2.nonecase&depth_1-utm_source=distribute.pc_feed_404.none-task-blog-2~default~BlogCommendFromBaidu~default-2.nonecas">原文2</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/286/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos安装lrzsz遇到的问题</title>
<link>https://eblog.ink/archives/210/</link>
<guid>https://eblog.ink/archives/210/</guid>
<pubDate>Tue, 17 Dec 2019 05:36:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[cd /var/lib/rpm     # rpmdb所在目录rm -f __db.*     # 清除原rpmdb文件rpm --rebuilddb     # 重建rpm数据库yum cle...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<pre><code>cd /var/lib/rpm 
</code></pre><p>    # rpmdb所在目录</p><pre><code>rm -f __db.*
</code></pre><p>     # 清除原rpmdb文件</p><pre><code>rpm --rebuilddb 
</code></pre><p>    # 重建rpm数据库</p><pre><code>yum clean all 
</code></pre><p>    # 清除所有yum的缓存</p><pre><code>yum -y install lrzsz

</code></pre>
]]></content:encoded>
<slash:comments>3</slash:comments>
<comments>https://eblog.ink/archives/210/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos 7 Python2.x升级3.x</title>
<link>https://eblog.ink/archives/206/</link>
<guid>https://eblog.ink/archives/206/</guid>
<pubDate>Tue, 12 Mar 2019 04:06:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[1.安装支持文件：yum install gcc gcc-c++ -y2.下载python3.7.4程序wget https://www.python.org/ftp/python/3.7.4/...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>1.安装支持文件：</p><pre><code>yum install gcc gcc-c++ -y</code></pre><p>2.下载python3.7.4程序</p><pre><code>wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz</code></pre><p>3.解压</p><pre><code>tar zxvf Python-3.7.4.tgz
</code></pre><p>4.进入程序安装目录</p><pre><code>cd Python-3.7.4
</code></pre><p>5.编译</p><pre><code>./configure
</code></pre><p>6.安装</p><pre><code>make &amp;&amp; make install
</code></pre><p>7.查看 Python 的路径</p><pre><code>ls -al /usr/bin | grep python
</code></pre><p>8.备份原来的链接</p><pre><code>mv /usr/bin/python /usr/bin/python.bak
</code></pre><p>9.创建python3链接</p><pre><code>ln -s /usr/local/bin/python3 /usr/bin/python
</code></pre><p>10.yum报错问题解决</p><p>升级 Python 之后，由于将默认的 python 指向了 python3，yum 不能正常使用，需要编辑 yum 的配置文件，此时：</p><pre><code> yum list
  File &quot;/usr/bin/yum&quot;, line 30
    except KeyboardInterrupt, e:

SyntaxError: invalid syntax</code></pre><p>修改/usr/bin/yum和/usr/libexec/urlgrabber-ext-down，将 #!/usr/bin/python 改为 #!/usr/bin/python2.7，保存退出即可。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/206/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Linux Centos更新内核版本&amp;amp;&amp;amp;删除多余的内核</title>
<link>https://eblog.ink/archives/151/</link>
<guid>https://eblog.ink/archives/151/</guid>
<pubDate>Tue, 22 Jan 2019 09:08:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[方法一：更新至最新主线版本1.启用 ELRepo 仓库# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org# rpm -Uvh...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>方法一：<br>更新至最新主线版本<br>1.启用 ELRepo 仓库</p><pre><code># rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
</code></pre><p>2.列出可用的内核相关包</p><pre><code>yum --disablerepo=&quot;*&quot; --enablerepo=&quot;elrepo-kernel&quot; list available
</code></pre><p>3.安装最新的主线稳定内核<br>yum --enablerepo=elrepo-kernel install kernel-ml</p><p>4.设置 GRUB 默认的内核版本</p><pre><code>打开并编辑 /etc/default/grub 并设置 GRUB_DEFAULT=0。意思是 GRUB 初始化页面的第一个内核将作为默认内核。
GRUB_TIMEOUT=5
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=&quot;console&quot;
GRUB_CMDLINE_LINUX=&quot;rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet&quot;
GRUB_DISABLE_RECOVERY=&quot;true&quot;
</code></pre><p>5.重新创建内核配置</p><pre><code>grub2-mkconfig -o /boot/grub2/grub.cfg
</code></pre><p>6.查找已安装的内核</p><pre><code>rpm -qa | grep kernel
</code></pre><p>7.查看正在使用的内核版本</p><pre><code>uname -a
</code></pre><p>7.删除内核（删除时候不要删除到正在使用的内核）</p><pre><code>yum remove kernelxxxx




</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/151/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>如何在CentOS 7上安装Nginx</title>
<link>https://eblog.ink/archives/119/</link>
<guid>https://eblog.ink/archives/119/</guid>
<pubDate>Thu, 21 Jun 2018 12:01:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[第一步 - 添加Nginx存储库要添加CentOS 7 EPEL仓库，请打开终端并使用以下命令：sudo yum install epel-release第二步 - 安装Nginx现在Nginx...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>第一步 - 添加Nginx存储库<br>要添加CentOS 7 EPEL仓库，请打开终端并使用以下命令：</p><p>sudo yum install epel-release<br>第二步 - 安装Nginx<br>现在Nginx存储库已经安装在您的服务器上，使用以下yum命令安装Nginx ：</p><p>sudo yum install nginx<br>在对提示回答yes后，Nginx将在服务器上完成安装。</p><p>第三步 - 启动Nginx<br>Nginx不会自行启动。要运行Nginx，请输入：</p><p>sudo systemctl start nginx</p><p>原文链接<a href="https://blog.csdn.net/oldguncm/article/details/78855000">https://blog.csdn.net/oldguncm/article/details/78855000</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/119/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos 7 编译安装Apache2.4.33</title>
<link>https://eblog.ink/archives/117/</link>
<guid>https://eblog.ink/archives/117/</guid>
<pubDate>Thu, 21 Jun 2018 07:41:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[yum install zlib-devel    #error: mod_deflate yum install openssl-devel    #error: mod_ssl1.安装前期编...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<pre><code>yum install zlib-devel    #error: mod_deflate 
yum install openssl-devel    #error: mod_ssl
</code></pre><p>1.安装前期编译准备</p><pre><code>wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-1.6.3.tar.gz
tar -zxvf apr-1.6.3.tar.gz
cd apr-1.6.3
./configure --prefix=/usr/local/apr
make &amp;&amp; make install

cd ..
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-iconv-1.2.2.tar.gz
tar -zxvf apr-iconv-1.2.2.tar.gz
cd apr-iconv-1.2.2  
./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr  
make &amp;&amp; make install

cd ..
wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.1.tar.gz  
tar -zxvf apr-util-1.6.1.tar.gz  
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make &amp;&amp; make install

cd ..
wget https://ftp.pcre.org/pub/pcre/pcre-8.33.tar.gz
tar -zxvf pcre-8.33.tar.gz
cd pcre-8.33
./configure --prefix=/usr/local/pcre
make &amp;&amp; make install

</code></pre><p>下载Apache2.4.33</p><pre><code>wget http://www.apache.org/dist/httpd/httpd-2.4.33.tar.gz
tar -zxvf httpd-2.4.33.tar.gz
cd httpd-2.4.33
 ./configure --prefix=/usr/local/apache --enable-rewrite --enable-so --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre/ --enable-ssl --enable-deflate --enable-expires --with-mpm=event 
make &amp;&amp; make install

cd ..
yum -y install epel-release   #安装源文件支持包
yum install libnghttp2-devel   #安装mod_http2模块

cd httpd-2.4.33
./configure --enable-http2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre/
./configure --with-nghttp2=/var/www/html  --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre/
./configure  --enable-nghttp2-staticlib-deps --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre/
make &amp;&amp; make install 
</code></pre><p>编译OpenSSL</p><pre><code>wget http://www.openssl.org/source/openssl-1.0.2j.tar.gz
tar -xzf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j
./config --prefix=/usr/local/openssl
./config -t
make &amp;&amp; make install

</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/117/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos7 防火墙开启端口</title>
<link>https://eblog.ink/archives/105/</link>
<guid>https://eblog.ink/archives/105/</guid>
<pubDate>Thu, 14 Jun 2018 03:16:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[方法一：1：查看firewall防火墙状态                       firewall-cmd --state                    或者           ...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>方法一：</p><p>1：查看firewall防火墙状态                <br>       </p><pre><code>firewall-cmd --state

            </code></pre><p>        或者                <br>       </p><pre><code>systemctl status firewalld

            </code></pre><p>2：打开防火墙                <br>       </p><pre><code>systemctl start firewalld

            </code></pre><p>3：关闭防火墙                <br>       </p><pre><code>systemctl stop firewalld

            </code></pre><p>4：重启防火墙                <br>       </p><pre><code>firewall-cmd --relaod

            </code></pre><p>        或者                <br>       </p><pre><code>systemctl reload firewalld

            </code></pre><p>5：开机自启动防火墙</p><pre><code>systemctl enable firewalld

        </code></pre><p>6：禁止开机启动防火墙                <br>       </p><pre><code>systemctl disable firewalld

            </code></pre><p>6：查看已打开的端口                <br>       </p><pre><code>firewall-cmd --list-ports

            </code></pre><p>7：打开端口                <br>       </p><pre><code>firewall-cmd --permanent --zone=public --add-port=8080/tcp

            </code></pre><p>        其中permanent表示永久生效，public表示作用域，8080/tcp表示端口和类型                <br>8：关闭端口<br> </p><pre><code>firewall-cmd --permanent --zone=public --remove-port=8080/tcp
</code></pre><p>方法二：</p><pre><code>            
1.查看某个端口的状态            


firewall-cmd --query-port=9998/udp

        
            
2.开启端口            


firewall-cmd --add-port=9998/udp --permanent

        
`--permanent`表示永久生效，重启不会丢失配置。            
            
3.关闭端口            


firewall-cmd --remove-port=9998/udp --permanent

        
            
4.重新加载配置            


firewall-cmd --reload            

</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/105/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
<item>
<title>Centos 删除自带的 Apache</title>
<link>https://eblog.ink/archives/103/</link>
<guid>https://eblog.ink/archives/103/</guid>
<pubDate>Tue, 12 Jun 2018 07:33:00 +0000</pubDate>
<dc:creator>eric</dc:creator>
<description><![CDATA[1.rpm -qa|grep httpd查看与httpd相关软件包。httpd-tools-2.2.15-15.el6.centos.i686httpd-2.2.15-15.el6.centos...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>1.<code>rpm -qa|grep httpd</code><br>查看与httpd相关软件包。</p><pre><code>httpd-tools-2.2.15-15.el6.centos.i686
httpd-2.2.15-15.el6.centos.i686
</code></pre><p>2.然后删除httpd</p><pre><code>rpm -e httpd
</code></pre><p>（如果有报错就先执行 rpm -e gnome-user-share 后在执行删除httpd）</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://eblog.ink/archives/103/#comments</comments>
<wfw:commentRss>https://eblog.ink/feed/category/centos-7/</wfw:commentRss>
</item>
</channel>
</rss>