侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

CentOS7 最小化安装后笔记

2023-11-10 星期五 / 0 评论 / 0 点赞 / 44 阅读 / 6925 字

1、切换到阿里云镜像 帮助手册:https://opsx.alibaba.com/mirror 2、make yum install kernel-headers kernel-devel gcc 3

1、切换到阿里云镜像

帮助手册:https://opsx.alibaba.com/mirror

2、make

yum install kernel-headers kernel-devel gcc

3、缺少kernal源码

make报错:make: *** /lib/modules/3.10.0-514.el7.x86_64/build: 没有那个文件或目录。 停止。

解决:

yum install kernel-devel-$(uname -r)

4、WIFI安装设置(EL7.3 ,其他需要参考源文,步骤不太一样)

 a、没有 iw 命令

yum -y install epel-releaseyum -y install wireless-tools

b、没有ifconfig

使用“ip addr”和“ip link”命令来查找网卡详情。要知道统计数据,可以使用“ip -s link

安装使用:

yum install net-tools

c、安装驱动

参考原文:

https://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom

[root@htpc ~]# lspci|grep -i network01:00.0 Network controller: Broadcom Limited BCM43142 802.11b/g/n (rev 01)

可以看到我的网卡类型为 BCM43142 

到官网找驱动,我的是Broadcom的:

https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure

# 下载找到的驱动wget https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz# 解压tar xzvf hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz -C ./source# 直接下载的驱动不能使用#  先打补丁我是EL7.3的,其他的参考原文#  这个补丁是解决IEEE80211_BAND_2GHZ 未定义的问题patch -p1 < ../wl-kmod-kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch# 修改部分编译问题,这里是EL7的#  EL 7.1 (i.e. kernel-3.10.0-229.X) require the first two,#  EL 7.2 (i.e. kernel-3.10.0-327.X), require first four 'sed' commands#  EL 7.3 requires all 6 executed sed -i 's/ >= KERNEL_VERSION(3, 11, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.csed -i 's/ >= KERNEL_VERSION(3, 15, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.csed -i 's/ < KERNEL_VERSION(3, 18, 0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.csed -i 's/ >= KERNEL_VERSION(4, 0, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.csed -i 's/ < KERNEL_VERSION(4,2,0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.csed -i 's/ >= KERNEL_VERSION(4, 7, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c# 按照原文,这个补丁也要打,我第一次没打也可以编译过的patch -p1 < ../wl-kmod-fix-ioctl-handling.patch# 编译make -C /lib/modules/`uname -r`/build/ M=`pwd`strip --strip-debug wl.ko#  卸载冲突的驱动modprobe -r bcm43xxmodprobe -r b43modprobe -r b43legacymodprobe -r ssbmodprobe -r bcmamodprobe -r brcmsmacmodprobe -r ndiswrapper# 如果有卸载成功的,加下黑名单vi /etc/modprobe.d/blacklist.conf # 增加blacklist bcm43xxblacklist b43blacklist b43legacyblacklist bcmablacklist brcmsmacblacklist ssbblacklist ndiswrapper# 加载新的驱动程序cp -vi /usr/local/src/hybrid-wl/source/wl.ko /lib/modules/`uname -r`/extra/depmod $(uname -r)modprobe wllsmod|grep wl# 启动加载顺序vi /etc/sysconfig/modules/kmod-wl.modules# 增加#!/bin/bashfor M in lib80211 cfg80211 wl; do    modprobe $M &>/dev/nulldone# 连接wifi,我的是enp1s0#wpa_supplicant -B -i wlp1s0-c <(wpa_passphrase "ssid" "password")# 网上说了很多方法,都不行,最后还是用nmtui成功连接上了,密码要多输入几次,之前试过iw ip等命令的重启一次再来吧

 

5、挂载samba

安装cifs

yum install cifs-utils

创建本地挂载目录

mkdir /data/

设置开机挂载(我的共享没有密码,用户和密码都是随便输入的)

# vi /etc/fstab 增加//192.168.31.1/share/data       /data           cifs    defaults,username=root,password=root 0 2

测试配置是否正确

mount -a

6、安装NGINX

参考:http://www.linuxidc.com/Linux/2016-09/134907.htm

下载需要的版本:https://nginx.org/en/download.html

cd /usr/local/srcwget https://nginx.org/download/nginx-1.10.3.tar.gz

安装必须的组件

# nginx 的 http 模块使用 pcre 来解析正则表达式yum install -y pcre pcre-devel# nginx 使用 zlib 对 http 包的内容进行 gzipyum install -y zlib zlib-devel# httpsyum install -y openssl openssl-devel
tar -zxvf nginx-1.10.1.tar.gzcd nginx-1.10.1

配置

#使用默认配置./configure#自定义配置(不推荐)./configure /--prefix=/usr/local/nginx /--conf-path=/usr/local/nginx/conf/nginx.conf /--pid-path=/usr/local/nginx/conf/nginx.pid /--lock-path=/var/lock/nginx.lock /--error-log-path=/var/log/nginx/error.log /--http-log-path=/var/log/nginx/access.log /--with-http_gzip_static_module /--http-client-body-temp-path=/var/temp/nginx/client /--http-proxy-temp-path=/var/temp/nginx/proxy /--http-fastcgi-temp-path=/var/temp/nginx/fastcgi /--http-uwsgi-temp-path=/var/temp/nginx/uwsgi /--http-scgi-temp-path=/var/temp/nginx/scgi

安装

#编译安装makemake install#查找安装路径:whereis nginx#启动、停止nginxcd /usr/local/nginx/sbin/./nginx ./nginx -s stop./nginx -s quit./nginx -s reload

7、禁用firewall

#停止firewallsystemctl stop firewalld.service #禁止firewall开机启动systemctl disable firewalld.service #查看默认防火墙状态(关闭后显示not running,开启后显示running)firewall-cmd --state

8、安装iptables

#配置iptables,首先需要安装iptables服务yum install iptables-services#编辑防火墙配置文件vi /etc/sysconfig/iptables#在22后增加http,https#-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT#-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT#最后重启防火墙使配置生效systemctl restart iptables.service#设置防火墙开机启动systemctl enable iptables.service

 

广告 广告

评论区