zoukankan      html  css  js  c++  java
  • CentOS-6.5下portal连接mysql失败,报permission denied

    (1)查看httpd日志

    [root@xiaofeibao ~]# cd /etc/httpd
    [root@xiaofeibao httpd]# ll
    总用量 8
    drwxr-xr-x. 2 root root 4096 8月 30 11:14 conf
    drwxr-xr-x. 2 root root 4096 8月 22 15:08 conf.d
    lrwxrwxrwx. 1 root root 19 8月 22 15:04 logs -> ../../var/log/httpd
    lrwxrwxrwx. 1 root root 29 8月 22 15:04 modules -> ../../usr/lib64/httpd/modules
    lrwxrwxrwx. 1 root root 19 8月 22 15:04 run -> ../../var/run/httpd
    [root@xiaofeibao httpd]#
    [root@xiaofeibao httpd]#
    [root@xiaofeibao httpd]# cd logs
    [root@xiaofeibao logs]# ll
    总用量 1036
    -rw-r--r--. 1 root root 126671 8月 30 11:44 access_log
    -rw-r--r--. 1 root root 900651 8月 30 11:40 error_log
    -rw-r--r--. 1 root root 0 7月 26 01:00 ssl_access_log
    -rw-r--r--. 1 root root 19197 8月 30 11:37 ssl_error_log
    -rw-r--r--. 1 root root 0 7月 26 01:00 ssl_request_log

    (2)查看用户、组

    [root@xiaofeibao logs]# cat /etc/passwd

    [root@xiaofeibao html]# cat /etc/group

    (3)更改文件的所有者

    [root@xiaofeibao html]# chown -R apache:apache portal/
    [root@xiaofeibao html]# ll
    总用量 20
    -rw-r--r--. 1 root root 31 7月 26 01:33 phpinfo.php
    drwxr-xr-x. 12 root root 4096 7月 27 01:00 phpmyadmin
    drwxrwxrwx. 10 apache apache 4096 8月 30 10:42 portal
    -rw-r--r--. 1 root root 334 8月 24 15:25 redis.php
    drwxrwxrwx. 13 root root 4096 8月 25 14:11 test

    (4)查看portal日志

    [root@xiaofeibao log]# tail -f 20170830.txt
    2017-08-30 11:20:50 /portal/index.php/BaseAppIndexServiceTr/testBbc SQLSTATE[HY000] [2002] Permission denied

    参考连接:

    http://blog.csdn.net/eclothy/article/details/48265445

    (5)selinux关闭

    [root@xiaofeibao logs]# vim /etc/selinux/config

    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    # enforcing - SELinux security policy is enforced.
    # permissive - SELinux prints warnings instead of enforcing.
    # disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of these two values:
    # targeted - Targeted processes are protected,
    # mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    修改完成后,保存重启,重启后状态如下:

    [root@xiaofeibao ~]# sestatus
    SELinux status: disabled

  • 相关阅读:
    光学字符识别OCR-6 光学识别
    光学字符识别OCR-5 文本切割
    光学字符识别OCR-4
    光学字符识别OCR-3
    leetcode 7 Reverse Integer(水题)
    leetcode 1 Two Sum(查找)
    DFS的简单应用(zoj2110,poj1562)
    Havel-Hakimi定理(握手定理)
    zoj1360/poj1328 Radar Installation(贪心)
    饶毅:做自己尊重的人
  • 原文地址:https://www.cnblogs.com/choucat/p/7452450.html
Copyright © 2011-2022 走看看