热门标签 | 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 显示安装细节

 



推荐阅读
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 使用Vultr云服务器和Namesilo域名搭建个人网站
    本文详细介绍了如何通过Vultr云服务器和Namesilo域名搭建一个功能齐全的个人网站,包括购买、配置服务器以及绑定域名的具体步骤。文章还提供了详细的命令行操作指南,帮助读者顺利完成建站过程。 ... [详细]
  • 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. ... [详细]
  • 优化ListView性能
    本文深入探讨了如何通过多种技术手段优化ListView的性能,包括视图复用、ViewHolder模式、分批加载数据、图片优化及内存管理等。这些方法能够显著提升应用的响应速度和用户体验。 ... [详细]
  • MySQL 数据库迁移指南:从本地到远程及磁盘间迁移
    本文详细介绍了如何在不同场景下进行 MySQL 数据库的迁移,包括从一个硬盘迁移到另一个硬盘、从一台计算机迁移到另一台计算机,以及解决迁移过程中可能遇到的问题。 ... [详细]
  • golang常用库:配置文件解析库/管理工具viper使用
    golang常用库:配置文件解析库管理工具-viper使用-一、viper简介viper配置管理解析库,是由大神SteveFrancia开发,他在google领导着golang的 ... [详细]
  • 2023 ARM嵌入式系统全国技术巡讲旨在分享ARM公司在半导体知识产权(IP)领域的最新进展。作为全球领先的IP提供商,ARM在嵌入式处理器市场占据主导地位,其产品广泛应用于90%以上的嵌入式设备中。此次巡讲将邀请来自ARM、飞思卡尔以及华清远见教育集团的行业专家,共同探讨当前嵌入式系统的前沿技术和应用。 ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍如何使用Python进行配置文件的读写操作,涵盖常见的配置文件格式(如INI、JSON、TOML和YAML),并提供具体的代码示例。 ... [详细]
  • 本文介绍了如何使用JQuery实现省市二级联动和表单验证。首先,通过change事件监听用户选择的省份,并动态加载对应的城市列表。其次,详细讲解了使用Validation插件进行表单验证的方法,包括内置规则、自定义规则及实时验证功能。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • MQTT技术周报:硬件连接与协议解析
    本周开发笔记重点介绍了在新项目中使用MQTT协议进行硬件连接的技术细节,涵盖其特性、原理及实现步骤。 ... [详细]
  • 如何在窗口右下角添加调整大小的手柄
    本文探讨了如何在传统MFC/Win32 API编程中实现类似C# WinForms中的SizeGrip功能,即在窗口的右下角显示一个用于调整窗口大小的手柄。我们将介绍具体的实现方法和相关API。 ... [详细]
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社区 版权所有