selinux

file_put_contents not creating txt file

别等时光非礼了梦想. 提交于 2019-11-28 03:24:37
问题 I currently have a php script that is running when a browser browser browses to the webpage. What I'm trying to do is write a text file when the script runs that stores a variable. The owner of the folder is apache, but everyone has read write, strictly for testing purposes. (I thought it might be a permissions issue) SELINUX is enabled on the server, and when I run the script from console it creates the text file just fine, and in the right directory. file_put_contents("My working file

MySQL 端口修改

邮差的信 提交于 2019-11-28 02:33:43
修改文件/etc/my.cnf 在[client]和[mysqld]下的port属性都需要修改。 重启MySQL 如果你开启了selinux,MySQL会无法启动,你会在日志中看到以下错误 [ERROR] Can't start server: Bind on TCP/IP port: Permission denied [ERROR] Do you already have another mysqld server running on port: 3308 那么,你需要关掉selinux,不想重启服务器,而关掉selinux,使用以下命令: /usr/sbin/setenforce 0 转载于:https://www.cnblogs.com/kuili/p/4285226.html 来源: https://blog.csdn.net/weixin_30722589/article/details/99926611

selinux

为君一笑 提交于 2019-11-28 01:47:56
man semanage-fcontext 除了fcontext 还有端口也要开通,比如 semanage port -a -t http_port_t -p tcp 8309 方法1:chcon -R -t httpd_sys_rw_content_t /var/www/qin/ 方法2:chcon --reference=/etc /local -R 方法3(推荐,写到系统内核): EXAMPLE remember to run restorecon after you set the file context Add file-context for everything under /web # semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?" # restorecon -R -v /web Substitute /home1 with /home when setting file context # semanage fcontext -a -e /home /home1 # restorecon -R -v /home1 For home directories under top level directory, for example /disk6/home, execute the

手机重启问题 Log 抓取方法

冷暖自知 提交于 2019-11-27 23:09:04
极力推荐文章:欢迎收藏 Android 干货分享 阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android 本篇文章主要介绍展讯平台手机开发中的部分重启问题知识点,通过阅读本篇文章,您将收获以下内容: 一、 User 版本 默认开启 sysdump 方法 二、插入SD卡 抓取Sysdump log 三、 sysdump log 分析 四、展讯平台抓取重启 串口log的方案 五、展讯平台判断重启类型 六、展讯平台关闭 sysdump 与watchdog关联 七、展讯平台手动触发sysdump 方法 一、 User 版本 默认开启 sysdump 方法 首先,为什么要这么干? 主要原因是,展讯平台部分重启问题,同样的代码, userdebug 版本无法复现, User 版本 可以复现,这样才有此默认开启 sysdump 的方案。 那么展讯平台 user 版本默认开启 sysdump 方案 修改一下代码 device\sprd\xxxx\common\rootdir\root\init.common.rc 在 on post-fs-data 下添加: // 设置 Ylog 默认开启开关 1 开启,0或不写 关闭 setprop persist.ylog.enabled 1 start ylog // 设置sysdump 默认开关属性值 开启为true 关闭 false

mod_wsgi: ImportError: No module named 'encodings'

限于喜欢 提交于 2019-11-27 22:54:22
I'm using Apache 2.2.15 on CentOS 6.5. I'm trying to set up a Django app using mod_wsgi. I'm using a virtual environment, and mod_wsgi was configured with --with-python=/path/to/virtualenv/bin/python3.4 . I've added this to my httpd.conf : WSGIPythonPath /srv/myproject:/path/to/virtualenv/lib/python3.4/site-packages WSGIPythonHome /path/to/virtualenv <VirtualHost *:80> WSGIScriptAlias / /srv/myproject/myproject/wsgi.py ... </VirtualHost> In wsgi.py , I added sys.path.insert(1, "/path/to/virtualenv/lib/python3.4/site-packages") The problem is that when I try to open the app in my browser, it

启动nginx 提示:nginx: [emerg] bind() to 0.0.0.0:8082 failed (13: Permission denied)

只谈情不闲聊 提交于 2019-11-27 20:44:19
原因: selinux 开启导致 输入:getenforce 命令可以查看当前是否开启selinux 输出 disabled 或 permissive 那就是关闭了 输出 enforcing 则是开启了 selinux 解决: 1 临时关闭 setenforce 0 ##设置SELinux 成为permissive模式 setenforce 1 ##设置SELinux 成为enforcing模式 2 永久关闭 vi /etc/selinux/config SELINUX=enforcing改为 SELINUX=disabled 重启机器即可 参考: https://blog.csdn.net/lzm198707/article/details/50130615 来源: https://www.cnblogs.com/amy720/p/11375784.html

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

北城余情 提交于 2019-11-27 20:41:10
问题 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. 回答1: 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

CentOS6.x 下 LNMP环境搭建(准备篇)

戏子无情 提交于 2019-11-27 20:02:58
CentOS6.x 下 LNMP环境搭建(准备篇) CentOS6.x 下 LNMP环境搭建(一、安装 MySQL) CentOS6.x 下 LNMP环境搭建(二、安装 Nginx) CentOS6.x 下 LNMP环境搭建(三、安装 PHP) LNMP 服务安装目录 # mkdir -p /lnmp/server /lnmp/www /lnmp/log/mysql /lnmp/log/nginx /lnmp/log/php 注:安装好的目录结构类似如下 /lnmp/ ├── log │ ├── mysql │ ├── nginx │ └── php ├── server │ ├── mysql -> /lnmp/server/mysql-5.x.xx │ ├── mysql-5.x.xx │ ├── nginx -> /lnmp/server/nginx-1.4.4 │ ├── nginx-1.4.4 │ ├── php -> /lnmp/server/php-5.x.xx │ └── php-5.x.xx ├── info.log └── www # chown -R www:www /lnmp/log # chmod -R 755 /lnmp/log # chown -R www:www /lnmp/www # chmod -R 755 /lnmp/www 下载软件包 #

Linux学习-防火墙-Selinux-配置本地YUM源

拥有回忆 提交于 2019-11-27 18:59:44
关闭防火墙并设置开机不启动 systemctl status firewalld.service #查看firewalld状态 systemctl stop firewalld #关闭 systemctl start firewalld #开启 systemctl disable firewalld #开机自动关闭 //RHLE7 chkconfig --list|grep network #查看开机是否启动 //RHLE6 systemctl enable firewalld #开机自动启动 临时和永久关闭Selinux 安全增强型 Linux(Security-Enhanced Linux)简称 SELinux,它是一个 Linux 内核模块,也是 Linux 的一个安全子系统。 SELinux 主要由美国国家安全局开发。2.6 及以上版本的 Linux 内核都已经集成了 SELinux 模块。 SELinux 的结构及配置非常复杂,而且有大量概念性的东西,要学精难度较大。很多 Linux 系统管理员嫌麻烦都把 SELinux 关闭了。 如果可以熟练掌握 SELinux 并正确运用,我觉得整个系统基本上可以到达"坚不可摧"的地步了(请永远记住没有绝对的安全)。 掌握 SELinux 的基本概念以及简单的配置方法是每个 Linux 系统管理员的必修课。 https://blog

linux系统破解密码。

杀马特。学长 韩版系。学妹 提交于 2019-11-27 18:57:31
Linux系统Centos7及RedHat7破解密码 步骤如下: 1.开机之后按"e"键 2.找到以linux16的开头的行在行尾添加 rd.break console=tty0 3.按 Ctrl+x 进入救援模式 4.重新挂载根目录 mount -o remount,rw /sysroot 5.切换至根目录 chroot /sysroot 6.修改root密码 echo 123456 |passwd --stdin root # ' | ' 管道符:把管道前面命令的输出交由管道后面处理 7.关闭selinux vim /etc/selinux/config SELINUX=disabled    #把selinux永久改为禁用模式,系统默认为强制模式(enforcing) :wq                #保存并退出 8.重启测试 exit reboot #注意:破解密码时也可以不用修改selinux模式。 使用更新selinux安全上下文: touch /.autorelabel 然后依照按照上面步骤退出重启即可。 #6.5版本破解密码:进入单用户模式后修改密码重启即可。 2019-08-18 17:57:45 来源: https://www.cnblogs.com/jrjs/p/11373281.html