selinux

Nginx报错403 forbidden (13: Permission denied)的解决办法

半腔热情 提交于 2019-11-29 07:35:40
由于开发需要,在本地环境中配置了LNMP环境,使用的是Centos 6.5 的yum安装,安装一切正常,但是由于默认网站文件夹比较奇葩,于是把网站文件用mv命令移动到了新的目录,并相应修改了配置文件,并重启Nginx。 那么好,问题来了!本以为重启就OK了。居然报个“403 is forbidden“的错误。。查看/var/log/nginx/error.log日志显示:xxx 403 forbidden (13: Permission denied)错误。我勒个去~ 引起nginx 403 forbidden通常是三种情况:一是缺少索引文件,二是权限问题,三是SELinux状态。 一、缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。 server { listen 80; server_name localhost; index index.php index.html; root / var/www; } 如果在/ var/www下面没有index.php,index.html的时候,直接访问域名,找不到文件,会报403 forbidden。 二、权限问题,如果nginx没有web目录的操作权限,也会出现403错误。 解决办法:修改web目录的读写权限

Linux中关于samba的几个问题

泪湿孤枕 提交于 2019-11-29 03:14:59
一、用smbclient命令登录成功但看不了文件   原因:SELinux的阻挡   解决:1、关闭SELinux : setenforce 0 (临时生效,重启后失效)               或vi /etc/sysconfig/selinux将SELINUX=enforcing改为SELINUX=disabled(永久生效)           2、更改共享目录的context值: chcon -t samba_share_t /share/(share为共享文件夹) 二、用put上传文件时提示NT_STATUS_OBJECT_PATH_NOT_FOUND opening remote file \/etc/passwd   原因:文件目标远   解决:切换到文件所在目录下,再用smbclient命令登录并用put命令上传,不用绝对路径 三、登录成功但是显示tree connect failed: NT_STATUS_ACCESS_DENIED   原因:用户在配置文件中没被生效   解决:在/etc/samba/smb.conf文件中的valid users = u1,u3中加入对应用户 来源: https://www.cnblogs.com/gchen-frank/p/11441656.html

centos7下安装zabbix

旧时模样 提交于 2019-11-29 03:01:53
(1)环境 [root@localhost ~]# cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) [zabbix@localhost ~]$ id uid=1000(zabbix) gid=1000(zabbix) 组=1000(zabbix) 环境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 (2)安装 (2.1)安装源码库配置部署包。这个部署包包含了yum配置文件。 # sudo rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 获取http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64//zabbix-release-3.2-1.el7.noarch.rpm 警告:/var/tmp/rpm-tmp.xvLHq6: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:zabbix-release-3.2

Configure SELinux access so that Apache can access mounted directories

不羁的心 提交于 2019-11-29 02:45:22
I have a mounted directory from home in /var/www/html/ict. Allow user permissions are fine but still through the web browser I get 403 error. SELinux I suspect does not allow files and directories coming from other locations. Can you help me add the relevant permission so that this can fixed. The error log from the audit file: type=AVC msg=audit(1395610534.041:179195): avc: denied { search } for pid=18370 comm="httpd" name="upload" dev=dm-0 ino=2506938 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir type=SYSCALL msg=audit(1395610534.041:179195

PHP unable to create a directory with mkdir

久未见 提交于 2019-11-29 00:51:13
问题 I have a previously working PHP script that is able to create a directory with mkdir : $webfolder = "/var/www/html/images/user"; mkdir($webfolder, 0770); I made some changes to the permission setting of the folder /var/www/html/images which is now: drwxrwx---. myself apache system_u:object_r:httpd_sys_content_t:s0 images I think previously this folder was owned by apache . But since apache has the full privileges of read, write and execute as a user group, I wonder why it can't create a

OpenStack之二: 安装OpenStack的yum源及相关组件

血红的双手。 提交于 2019-11-28 22:54:20
#: 在所有节点执行 [root@localhost ~]# yum install centos-release-openstack-stein -y #: 安装相关组件(只在管理端和计算几点安装) [root@localhost ~]# yum install python-openstackclient openstack-selinux -y #:注意:所有几点不要安装epel源 来源: https://www.cnblogs.com/maxuebin/p/11432136.html

asm createdisk时提示没有权限

一个人想着一个人 提交于 2019-11-28 22:52:38
[root@linux Packages]# /etc/init.d/oracleasm createdisk asm1 /dev/sdg1 Marking disk "asm1" as an ASM disk: [FAILED] [root@linux Packages]# /etc/init.d/oracleasm enable Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ] [root@linux Packages]# /etc/init.d/oracleasm createdisk asm1 /dev/sdg1 Marking disk "asm1" as an ASM disk: [FAILED] [root@linux Packages]# cd /var/log/ [root@linux log]# cat oracleasm Creating /dev/oracleasm mount point: /dev/oracleasm Loading module "oracleasm": oracleasm

How to solve “Kernel panic - not syncing - Attempted to kill init” — without erasing any user data [closed]

拈花ヽ惹草 提交于 2019-11-28 20:15:27
I was trying to update libc in our Ubuntu server but it failed and now when I reboot the server I get a error message: Kernel panic - not syncing - Attempted to kill init! and it just hangs. What is the solution to this problem? The server is used by 10 people so I don't want to reinstall erasing their data. if the full message is: kernel panic - not syncing: Attempted to kill inint ! PId: 1, comm: init not tainted 2.6.32.-279-5.2.e16.x86_64 #1 then you should have disabled selinux and after that you have rebooted the system. The easier is to use a live OS and re-enable it vim /etc/selinux

基础知识

邮差的信 提交于 2019-11-28 18:49:25
配置网络 远程登录 密钥认证登录Linux 重置密码 单用户模式 救援模式 1. 配置网络 配置网络目的: 1)远程登录它 2)可以使用yum安装其它的包 配置网络步骤: 1)执行dhclient命令,自动获取IP地址(NAT模式,它可以自动生成一个IP地址) 查看IP地址的命令: ip addr 快捷键 ctrl L 清屏 2)配置IP地址,你需要知道:IP地址,子网掩码,网关,DNS 查看网关的命令 ip route 公共的DNS:119.29.29.29 (dnspod) 114.114.114.114 202.106.0.20 8.8.8.8 3)编辑配置文件 按Tab键自动补全命令或者文件路径名字 vi /etc/sysconfig/network-scripts/ifcfg-ens33 直接回车,进入到配置文件里面 按i,进入编辑模式,用方向键把光标挪到最下面,另起一行添加如下内容: IPADDR=xxxxx PREFIX=24 GATEWAY=xxxx DNS1=119.29.29.29 编辑好后,按ESC,再输入 :wq 4) 重启网络服务 systemctl restart network 其它: cat 查看文件内容 如果遇到一个很长的文件,cat之后就看不到最前面的内容了,此时可以用管道符和less命令结合起来查看。 管道符 | 作用是

AWS EC 主机无法通过 PHP 连接 RDS MySQL

房东的猫 提交于 2019-11-28 17:40:54
问题描述 解决方案 一、确认自己的安全组权限 在 RDS 中需要为自己的数据库配置安全组权限,也即 3306 端口需要向 EC 主机开放: 其中,选择类型为 MYSQL/Aurora ,这样可以开启 3306 端口,把来源定义为我的 IP 以及 EC 主机所在安全组。(只需要键入主机名,AWS 可以自动适配) 二、关闭安全增强式 Linux(SELinux) AWS EC 默认开启了 SELinux 是使得 PHP 服务器不能访问外部 MySQL 的元凶。使用 root 用户修改 EC 主机 /etc/selinux/config 文档中: 1 SELinux = disabled 重启 EC 主机,重新开启 httpd 服务即可。 原文链接 大专栏 https://www.dazhuanlan.com/2019/08/15/5d551400cb323/ 来源: https://www.cnblogs.com/chinatrump/p/11416977.html