mount.nfs: Protocol not supported

公司项目新上了NAS系统,也不晓得是个什么破烂玩艺,反正进去一通配置就搞行了,下面是挂载遇到的问题:
OS:CentOS7.9
NAS NFS:/pool/data
OS的NFS客户端安装就不说了,一大堆,直接YUM就行了。
问题出在挂载的时候,直接mount -t nfs的时候提示mount.nfs: Protocol not supported,意思就是不支持的协议,既然这样就指定协议好了:
mount -t nfs -o rw,nfsvers=3 remote:/pool/data /localdirectory
当然还有nfsvers=2和1的,反正自己测好了,我这里是用3就可以正确挂载了。

nginx lua waf部署

刚处理完服务器安全问题。

到新公司来接手一堆烂服务器,第一次看到用宝塔管理业务服务器的,无奈。

首先说说nginx lua waf的部署环境,centos 6,nginx 1.12.1,跑的php。lnmp编译安装。

服务器上还部了个安全狗,这是个什么鬼?

开干吧,nginx -V,查看nginx编译参数,这些参数要记下来,后面有用。

#nginx -V
nginx version: nginx/1.12.2
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
safedog ......
configure arguments: --prefix=/opt/programs/nginx_1.12.2 --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-threads --with-http_v2_module --with-http_addition_module --with-http_dav_module --with-file-aio --with-http_gunzip_module --add-module=nginx_upstream_check_module-master

去nginx.org下载对应版本的源码回来,因为需要增加lua模块。

阅读更多

Centos 7 使用key登陆SSH

首先,你要新建一个用户,权限可以最小,用来ssh登陆系统。

useradd

1、ssh-keygen -t rsa

使用新建的用户执行这条命令。

会让你输入密码,根据个人需要,我是没填密码,因为使用方便。

然后会在你当前用户的home目录下生成.ssh,里面有id_rsa,id_rsa.pub,id_rsa.pub就是公钥:

2、cat id_rsa.pub >> authorized_keys

因为ssh默认是会去读取authorized_keys里面的数据。

id_rsa是私钥,拖回本地来。

3、修改/etc/ssh/sshd_config

PermitRootLogin no

PubkeyAuthentication yes

PasswordAuthentication no

systemctl restart sshd

4、vi /etc/sudoers

在%wheel ALL=(ALL) NOPASSWD: ALL这一行上添加:

youruser ALL=(ALL) NOPASSWD:ALL

至此,就可以用新建的用户加id_rsa来登陆系统了。需要root权限直接sudo -s就可以。

PS:在实施过程中因为偷懒,直接使用ssh-copy-id来把key分发到其它服务器上,其中一台始终无法登陆,提示:

Authentication refused: bad ownership or modes

后来发现是.ssh目录权限问题,直接给700,问题解决。

nginx提示host not found in upstream错误

今天重启nginx,发现nginx报错,看了一下systemd的错误提示,journalctl -xe,原来报错了:

host not found in upstream

看了下配置文件,原来是proxy_pass后面跟的是域名,但以前的时候都没有出现过这个问题啊,今天才刚出现的。

后来看到有人在location段加dns,才想起来原来nginx的服务器配的dns服务器停了,那就来更新一下dns服务器吧:

vi /etc/resolv.conf

改成阿里云的DNS吧,223.5.5.5.

再重启nginx,好,一切正常。

centos7安装oracle11gR2

最近频繁在centos7下安装oracle11gR2,网上各种文章,找到了这篇比较靠谱,其中有在安装过程中遇到的两个问题,比如error in invoking target install of makefile和error in invoking target agent nmhs,这篇里面都提到了解决办法。

地址: https://www.jianshu.com/p/2fda26a7edf1

图文安装地址: https://blog.csdn.net/qq_32786873/article/details/82110235