前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >日志服务器(4)

日志服务器(4)

作者头像
franket
发布2021-10-19 19:50:46
5490
发布2021-10-19 19:50:46
举报
文章被收录于专栏:技术杂记技术杂记

测试 php 运行环境

代码语言:javascript
复制
[root@h105 mysql]# cd /var/www/html/
[root@h105 html]# cat >index.php  <<EOF
> <?php
> phpinfo();
> ?>
> EOF
[root@h105 html]# cat index.php 
<?php
phpinfo();
?>
[root@h105 html]# getenforce 
Enforcing
[root@h105 html]# setenforce 0 
[root@h105 html]# getenforce 
Permissive
[root@h105 html]#

要关掉 SElinux ,否则它会捣乱

加载新环境,重启httpd 服务

代码语言:javascript
复制
[root@h105 html]# su - root 
[root@h105 ~]# /etc/init.d/httpd restart 
Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.100.105 for ServerName
                                                           [  OK  ]
[root@h105 ~]# 

再次访问主页

php_test.png
php_test.png

安装 rsyslog

其实系统已经自带了

代码语言:javascript
复制
[root@h105 ~]# rpm -qa | grep rsyslog
rsyslog-5.8.10-8.el6.x86_64
[root@h105 ~]#

安装 rsyslog 连接 mysql 数据库的模块

因为数据最后是写到 mysql 里,所以要安装 rsyslog 操作 mysql 的模块

代码语言:javascript
复制
[root@h105 ~]# yum -y install rsyslog-mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Repository base is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.bit.edu.cn
 * updates: mirrors.pubyun.com
Resolving Dependencies
--> Running transaction check
---> Package rsyslog-mysql.x86_64 0:5.8.10-8.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================
 Package                            Arch                        Version                             Repository                 Size
====================================================================================================================================
Installing:
 rsyslog-mysql                      x86_64                      5.8.10-8.el6                        base                       21 k

Transaction Summary
====================================================================================================================================
Install       1 Package(s)

Total download size: 21 k
Installed size: 15 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : rsyslog-mysql-5.8.10-8.el6.x86_64                                                                                1/1 
  Verifying  : rsyslog-mysql-5.8.10-8.el6.x86_64                                                                                1/1 

Installed:
  rsyslog-mysql.x86_64 0:5.8.10-8.el6                                                                                               

Complete!
[root@h105 ~]# 

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 测试 php 运行环境
  • 安装 rsyslog
    • 安装 rsyslog 连接 mysql 数据库的模块
    相关产品与服务
    云数据库 SQL Server
    腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档