安装FedoraServer26之后需要做的一些操作

2017-08-19 2253点热度 0人点赞 0条评论

普通用户权限问题

首先建立了一个普通用户wangxianfeng,但是默认没有添加sudo权限,以下方法添加sudo权限:

sudo的配置文件位于/etc/sudoers,需要root权限才可以读写。
找到root ALL=(ALL) ALL这一行,在后面再加上一行就可以了(不用引号):
wangxianfeng ALL=(ALL) ALL
其中wangxianfeng为指定的使用sudo的用户,引号内的空格为tab

每次使用sudo命令时提示你输入根密码,移动到这一行:
#%wheel ALL=(ALL) ALL
解除#号注释

每次使用sudo命令的时候都提示你输入跟密码,移动到下面这一行:
#%wheel ALL=(ALL)NOPASSWD:ALL
解除#号注释
保存后退出

添加用户名到wheel用户组:
usermod -G wheel username

 

也可以直接添加如下一行:

wangxianfeng ALL=(ALL) NOPASSWD:ALL

dnf update报错问题

报错信息如下:

错误:同步仓库 'updates' 缓存失败

Error:Failed to synchronize cache for repo 'updates'

解决方法:

首先更新dns:

编辑/etc/resolv.conf文件,添加如下内容:

nameserver 223.5.5.5
nameserver 223.6.6.6
这里使用阿里云的DNS。

然后修改/etc/dnf/dnf.conf文件,添加如下内容:
fastestmirror=true

然后再执行dnf update就可以了。
[XXXXXX]# dnf update
正在查找最快的镜像(21 个主机)done.

 

编译安装nginx

./configure  --prefix=/usr/local/nginx  --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/error.log  --http-log-path=/usr/local/nginx/access.log  --pid-path=/usr/local/nginx/nginx.pid --lock-path=/usr/local/nginx/nginx.lock  --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/usr/local/nginx/client/ --http-proxy-temp-path=/usr/local/nginx/proxy/ --http-fastcgi-temp-path=/usr/local/nginx/fcgi/ --http-uwsgi-temp-path=/usr/local/nginx/uwsgi --http-scgi-temp-path=/usr/local/nginx/scgi --with-pcre --with-http_v2_module

防火墙设置

启动:

systemctl start  firewalld

查看状态:

systemctl status firewalld

禁用:

systemctl disable firewalld

停止:

systemctl stop firewalld

王显锋

激情工作,快乐生活!

文章评论