热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

文本处理与软件管理

1、自建yum仓库,分别为网络源和本地源本地源:       网络源:[root@openvpn~]#catetcyum.repos.dCentOS-Base.repo#CentO

1、自建yum仓库,分别为网络源和本地源

本地源:

 

 

 

 

 

 

 

网络源:

[root@openvpn ~]# cat /etc/yum.repos.d/CentOS-Base.repo
# 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-6.8 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/os/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.8/os/$basearch/
http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6.8 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/updates/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.8/updates/$basearch/
http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6.8 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/extras/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.8/extras/$basearch/
http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centos-vaultplus]
name=CentOS-6.8 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/centos-vaultplus/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.8/centos-vaultplus/$basearch/
http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/centos-vaultplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.8 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.8/contrib/$basearch/
http://mirrors.aliyuncs.com/centos-vault/6.8/contrib/$basearch/
http://mirrors.cloud.aliyuncs.com/centos-vault/6.8/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

 

2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。

cat /etc/redhat-release 

dnf -y install lrzsz

136 rz -be
137 tar -xf httpd-2.4.49.tar.gz
138 yum install gcc openssl-devel pcre-devel apr-devel apr-util-devel -y
139 cd httpd-2.4.49/
140 ./configure
141 make && make install
142 ll
143 make
144 yum -y install gcc automake autoconf libtool make
145 make && make install
146 #dnf install gcc make autoconf apr-devel apr-util-devel pcrdevel openssl-devel redhat-rpm-confige
147 dnf install gcc make autoconf apr-devel apr-util-devel pcrdevel openssl-devel redhat-rpm-confige
148 cd
149 tar -xvf httpd-2.4.49.tar.gz -C /usr/local/src/
150 cd /usr/local/src/
151 ll
152 cd httpd-2.4.49/
153 mkdir -vp /apps/httpd
154 ./configure --prefix=/apps/httpd/ --syscOnfdir=/etc/httpd --enable-ssl
155 make -j 4 && make install
156 dnf install gcc make autoconf apr-devel apr-util-devel pcrdevel openssl-devel redhat-rpm-confie
157 dnf install redhat-rpm-confie
158 dnf install redhat-rpm-config
159 make -j 4 && make install
160 echo `PATH=/apps/httpd/bin:$PATH` > /etc/profile.d/httpd.sh
161 . /etc/profile.d/httpd.sh
162 cd
163*
164 ./etc/profile.d/httpd.sh
165 . /etc/profile.d/httpd.sh
166 echo `PATH=/apps/httpd/bin:$PATH` > /etc/profile.d/httpd.sh
167 . /etc/profile.d/httpd.sh
168 /apps/httpd/bin/apachectl start
169 useradd -r -s /sbin/nologin -d /var/www -c Apache -u 48 apache
170 /apps/httpd/bin/apachectl restart
171 ps aux
172 netstat -antlp

 

3、利用sed 取出ifconfig命令中本机的IPv4地址

[root@10-100-13-200 ~]# ifconfig eth0 | sed -nr "2s/[^0-9]+([0-9.]+).*/\1/p"
10.100.13.200

4、删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符

 

[root@10-100-13-200 ~]# sed -nr 's/^#[[:space:]]+(.*)/\1/p' /etc/fstab
/etc/fstab
Created by anaconda on Fri Jun 5 04:06:04 2020
Accessible filesystems, by reference, are maintained under '/dev/disk/'.
See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
After editing this file, run 'systemctl daemon-reload' to update systemd
units generated from this file.

5、处理/etc/fstab路径,使用sed命令取出其目录名和基名

 [root@10-100-14-129 ~]# echo /etc/fstab | sed -nr 's#(.*)/.*$#\1#p'

/etc
[root@10-100-14-129 ~]# echo /etc/fstab | sed -nr 's#.*/([^/]+)/?$#\1#p'
fstab

 

6、列出ubuntu软件管理工具apt的一些用法(自由总结)

apt-get 是常用的命令行工具,
apt install 安装软件包
apt remove 移除软件包
apt purge 移除软件包及配置文件
apt update 刷新存储库索引
apt upgrade 升级所有可升级的软件包
apt autoremove 自动删除不需要的包
apt full-upgrade 在升级软件中自动处理依赖关系
apt search 搜索应用程序
apt show 显示安装细节

 



推荐阅读
  • CentOS7源码编译安装MySQL5.6
    2019独角兽企业重金招聘Python工程师标准一、先在cmake官网下个最新的cmake源码包cmake官网:https:www.cmake.org如此时最新 ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 在Ubuntu 16.04 LTS上配置Qt Creator开发环境
    本文详细介绍了如何在Ubuntu 16.04 LTS系统中安装和配置Qt Creator,涵盖了从下载到安装的全过程,并提供了常见问题的解决方案。 ... [详细]
  • 使用Vultr云服务器和Namesilo域名搭建个人网站
    本文详细介绍了如何通过Vultr云服务器和Namesilo域名搭建一个功能齐全的个人网站,包括购买、配置服务器以及绑定域名的具体步骤。文章还提供了详细的命令行操作指南,帮助读者顺利完成建站过程。 ... [详细]
  • 解决JAX-WS动态客户端工厂弃用问题并迁移到XFire
    在处理Java项目中的JAR包冲突时,我们遇到了JaxWsDynamicClientFactory被弃用的问题,并成功将其迁移到org.codehaus.xfire.client。本文详细介绍了这一过程及解决方案。 ... [详细]
  • This guide provides a comprehensive step-by-step approach to successfully installing the MongoDB PHP driver on XAMPP for macOS, ensuring a smooth and efficient setup process. ... [详细]
  • 本文详细介绍了 Dockerfile 的编写方法及其在网络配置中的应用,涵盖基础指令、镜像构建与发布流程,并深入探讨了 Docker 的默认网络、容器互联及自定义网络的实现。 ... [详细]
  • 本文深入探讨了Linux系统中网卡绑定(bonding)的七种工作模式。网卡绑定技术通过将多个物理网卡组合成一个逻辑网卡,实现网络冗余、带宽聚合和负载均衡,在生产环境中广泛应用。文章详细介绍了每种模式的特点、适用场景及配置方法。 ... [详细]
  • MySQL 数据库迁移指南:从本地到远程及磁盘间迁移
    本文详细介绍了如何在不同场景下进行 MySQL 数据库的迁移,包括从一个硬盘迁移到另一个硬盘、从一台计算机迁移到另一台计算机,以及解决迁移过程中可能遇到的问题。 ... [详细]
  • 本文详细介绍了Linux系统中init进程的作用及其启动过程,解释了运行级别的概念,并提供了调整服务启动顺序的具体步骤和实例。通过了解这些内容,用户可以更好地管理系统的启动流程和服务配置。 ... [详细]
  • 本文介绍如何在现有网络中部署基于Linux系统的透明防火墙(网桥模式),以实现灵活的时间段控制、流量限制等功能。通过详细的步骤和配置说明,确保内部网络的安全性和稳定性。 ... [详细]
  • 优化局域网SSH连接延迟问题的解决方案
    本文介绍了解决局域网内SSH连接到服务器时出现长时间等待问题的方法。通过调整配置和优化网络设置,可以显著缩短SSH连接的时间。 ... [详细]
  • 通过Web界面管理Linux日志的解决方案
    本指南介绍了一种利用rsyslog、MariaDB和LogAnalyzer搭建集中式日志管理平台的方法,使用户可以通过Web界面查看和分析Linux系统的日志记录。此方案不仅适用于服务器环境,还提供了详细的步骤来确保系统的稳定性和安全性。 ... [详细]
  • 20100423:Fixes:更新批处理,以兼容WIN7。第一次系统地玩QT,于是诞生了此预备式:【QT版本4.6.0&#x ... [详细]
author-avatar
,,,,,,,,,,,,,,,
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有