selinux

How to debug an issue of cron's not executing a given script — or other?

冷暖自知 提交于 2019-12-04 10:52:27
I have a Rails script that I would like to run daily. I know there are many approaches, and that a cron'd script/runner approach is frowned upon by some, but it seems to meet my needs. However, my script is not getting executed as scheduled. My application lives at /data/myapp/current , and the script is in script/myscript.rb . I can run it manually without problem as root with: /data/myapp/current/script/runner -e production /data/myapp/current/script/myscript.rb When I do that, the special log file ( log/myscript.log ) gets logged to as expected: Tue Mar 03 13:16:00 -0500 2009 Starting to

proxy_pass isn't working when SELinux is enabled, why?

好久不见. 提交于 2019-12-04 10:11:49
问题 I'm having an application listening on port 8081 and Nginx running on port 8080. The proxy pass statement looks like: $ cat /var/etc/opt/lj/output/services/abc.servicemanager.conf location /api/abc.servicemanager/1.0 { proxy_pass http://localhost:8081;} In nginx.conf , I include this file as: include /etc/nginx/conf.d/services/*.conf; The /etc/nginx/conf.d/service is a symlink: # ll /etc/nginx/conf.d/ lrwxrwxrwx. 1 root root 39 Dec 10 00:19 services -> ../../../var/etc/opt/lj/output/services

6

别等时光非礼了梦想. 提交于 2019-12-04 09:45:42
Linux-day06 打包压缩 压缩包工具 .zip #zip压缩工具 .bz2 #bzip2压缩工具,只能压缩文件,会删除源文件 .gz #gzip压缩工具,只能压缩文件,会删除源文件 tar.gz #gzip压缩,使用tar打包 tar.bz2 #使用bzip2压缩,使用tar打包 zip zip #打包压缩 选项: -r #递归压缩 -q #静默输出 -T #检查压缩包是完整 unzip #解压zip格式的压缩包 选项: -d #指定解压的目录 -l #查看压缩包的内容 -t #检查压缩包里面的内容是否完整 -q #静默输出 #下载安装 [root@qls ~]# yum install -y zip unzip [root@qls ~]# cp /etc/services ./ [root@qls ~]# ll total 656 -rw-r--r--. 1 root root 670293 Aug 20 08:46 services [root@qls ~]# zip ser.zip services adding: services (deflated 80%) [root@qls ~]# ll total 792 -rw-r--r--. 1 root root 670293 Aug 20 08:46 services -rw-r--r--. 1 root root

My custom selinux policies seem to be ignored by android system

亡梦爱人 提交于 2019-12-04 09:31:06
问题 I have some trouble on getting custom selinux policies running properly on an AOSP based Android 7.1.2 (more precisely based on sony open devices tree). My problem is that the audit logs keep telling me about missing file access rules that I actually added. I also copied rules that audit2allow has created to my policy files, but even those do not properly work. So, let's dig into the details: I created a custom domain called vendor_app . This domain is assigned to an app based on its

Samba共享文件

守給你的承諾、 提交于 2019-12-04 08:26:45
1 安装samba yum install -y samba* 2 添加用户 useradd smbuser 3 设置共享文件用户的密码 smbpasswd -a smbuser 4 创建公共共享文件 mkdir /home/share chmod 777 /home/share 5 修改smb的配置文件 vim /etc/samba/smb.conf # max protocol = used to define the supported protocol. The default is NT1. # can set it to SMB2 if you want experimental SMB2 support. workgroup = MYGROUP server string = Samba Server Version %v ; netbios name = MYSERVER ; interfaces = lo eth0 ens160 192.168.12.2/24 192.168.13.2/24 192.168.0.108 ; hosts allow = 127. 192.168.12. 192.168.13. 192.168.0. ; max protocol = SMB2 [global] workgroup = SAMBA security = user

Nginx出现403 forbidden

扶醉桌前 提交于 2019-12-04 08:01:29
nginx访问时报403, 于是查看nginx日志,路径为/var/log/nginx/error.log。打开日志发现报错Permission denied,详细报错如下: 1. open() "/data/www/1.txt" failed (13: Permission denied), client: 192.168.1.194, server: www.web1.com, request: "GET /1.txt HTTP/1.1", host: "www.web1.com" 没有权限?于是找了不少资料,可以通过下面四步排查解决此问题。你可能只是其中之前配置有问题,不一定四个步骤都用上。 一、由于启动用户和nginx工作用户不一致所致 1.1查看nginx的启动用户,发现是nobody,而为是用root启动的 命令:ps aux | grep "nginx: worker process" | awk'{print $1}' 1.2将nginx.config的user改为和启动用户一致, 命令:vi conf/nginx.conf 二、缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。 1. server { 2. listen 80; 3. server_name localhost

解决Nginx出现403 forbidden (13: Permission denied)报错的四种方法

我的未来我决定 提交于 2019-12-04 08:00:00
我是在在本地用虚拟机中通过 yum 安装nginx的,安装一切正常,但是访问时报403, 于是查看 nginx 日志,路径为 /var/log/nginx/error.log 。打开日志发现报错 Permission denied ,详细报错如下: 1. open () "/data/www/1.txt" failed ( 13 : Permission denied ), client : 192.168 . 1.194 , server : www . web1 . com , request : "GET /1.txt HTTP/1.1" , host : "www.web1.com" 没有权限?于是找了不少资料,可以通过下面四步排查解决此问题。你可能只是其中之前配置有问题,不一定四个步骤都用上。 一、由于启动用户和nginx工作用户不一致所致 1.1查看nginx的启动用户,发现是nobody,而为是用root启动的 命令:ps aux | grep "nginx: worker process" | awk'{print $1}' 1.2将nginx.config的user改为和启动用户一致, 命令:vi conf/nginx.conf 二、缺少 index.html 或者 index.php 文件,就是配置文件中 index index.html index.htm

Docker 容器中配置nginx后报403 Forbidden 解决办法

旧时模样 提交于 2019-12-04 07:59:43
1、 Docker 挂载主机目录,访问相应的文件出现Premission denied的权限访问问题 问题原因及解决办法 原因是CentOS7中的安全模块selinux把权限禁掉了,主要是挂载的目录没有权限的问题 2、 添加selinux规则,改变要挂载的目录的安全性文本 chcon -Rt svirt_sandbox_file_t /home/hct/sample/ 来源: CSDN 作者: 椰汁菠萝 链接: https://blog.csdn.net/suo082407128/article/details/83348639

nginx访问报错403 is forbidden

好久不见. 提交于 2019-12-04 07:54:34
由于开发需要,在本地环境中配置了nginx环境,使用的是Centos 6.5 的yum安装,安装一切正常,于是把网站文件用mv命令移动到了新的目录,并相应修改了配置文件,并重启Nginx。 重启就报个“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目录的读写权限,或者是把nginx的启动用户改成目录的所属用户,重启Nginx即可解决 chmod -R 755 / var

查看 SELinux状态及关闭SELinux

时光毁灭记忆、已成空白 提交于 2019-12-04 07:54:05
本文出自 “ 孤星雨 ” 博客,请务必保留此出处 http://bguncle.blog.51cto.com/3184079/957315 查看SELinux状态: 1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态 SELinux status: enabled 2、getenforce ##也可以用这个命令检查 关闭SELinux: 1、临时关闭(不用重启机器): setenforce 0 ##设置SELinux 成为permissive模式 ##setenforce 1 设置SELinux 成为enforcing模式 2、修改配置文件需要重启机器: 修改/etc/selinux/config 文件 将SELINUX=enforcing改为SELINUX=disabled 重启机器即可 来源: CSDN 作者: 若闻 链接: https://blog.csdn.net/wang1144/article/details/8434728