Linux查看配置文件中未被注释的有效配置行
grep 命令示例——去掉注释
$ grep -v "^#" /path/to/config/file
$ grep -v "^#" /etc/apache2/apache2.conf
示例输出:
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout
KeepAlive On
MaxKeepAliveRequests
KeepAliveTimeout
<IfModule mpm_prefork_module>
StartServers
MinSpareServers
MaxSpareServers
MaxClients
MaxRequestsPerChild
</IfModule>
<IfModule mpm_worker_module>
StartServers
MinSpareThreads
MaxSpareThreads
ThreadLimit
ThreadsPerChild
MaxClients
MaxRequestsPerChild
</IfModule>
<IfModule mpm_event_module>
StartServers
MaxClients
MinSpareThreads
MaxSpareThreads
ThreadLimit
ThreadsPerChild
MaxRequestsPerChild
</IfModule>
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>
DefaultType text/plain
HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel warn
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/apache2/httpd.conf
Include /etc/apache2/ports.conf
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
Include /etc/apache2/conf.d/
Include /etc/apache2/sites-enabled/
想要跳过其中的空行,可以使用 egrep 命令
egrep -v "^#|^$" /etc/apache2/apache2.conf
Linux查看配置文件中未被注释的有效配置行的更多相关文章
- Spring配置文件中未引入dubbo命名空间头部配置而引起的错误案例
问题描述: Spring配置文件中未引入dubbo命名空间的头部配置而引起项目启动时报出如下错误信息: org.springframework.beans.factory.xml.XmlBeanDef ...
- Linux查看系统中的每个进程
Linux查看系统中的每个进程 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ps -A PID TTY TIME CMD 1 ? 00:00:01 init ...
- Linux查看目录中的文件
Linux查看目录中的文件 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ls examples.desktop jdk 公共的 视频 文档 音乐 java ...
- mysql linux查看配置文件my.cnf位置
原文:mysql linux查看配置文件my.cnf位置 命令: mysql --help | grep 'Default options' -A 1
- Linux查看系统中socket状态
当我们打开的socket数量很多时,netstat就会变得慢了,有什么办法可以快速查看系统中socket状态? IPv4: $ cat /proc/net/sockstat sockets: used ...
- Linux 查看运行中进程的 umask
线上某台虚机因为故障重装了系统(基线 CentOS 6.9 内核 2.6.x),重新部署了应用.这个应用会生成一个文件,到NFS挂载目录. 而这个 NFS 挂载目录是一个 FTP 服务器的目录.另一台 ...
- linux查看日志中特定字符串以及前后信息内容命令
在项目实施过程中,我们经常会查看日志,更是经常会根据某些特地字符串去查找日志内容. 下面就是日志查找命令: 1.查询字符串命令: cat fileName|grep '要查找的字符串' 实例:cat ...
- struts中如何查看配置文件中是否存在某个返回值
ActionConfig config = ActionContext.getContext() .getActionInvocation().getProxy().getConfig(); Resu ...
- Linux 查看.so中导出函数
方法一 nm -D **.so 但这样能看到所有的导出,乱七八糟的很多,筛选用: nm **.so | grep XX 方法二objdump -tT **.so
随机推荐
- linux 问题二 查看系统是32位还是64位
方法: 1.uname -a 2.uname -m 3.file /sbin/init 4.arch 5.Settings -> Details 说明: 1. i386 适用于intel和AMD ...
- bzoj 3998: [TJOI2015]弦论【SA+二分||SAM】
SA的话t==0直接预处理出每个后缀的不同串贡献二分即可,然后t==1就按字典序枚举后缀,然后跳右端点计算和当前后缀的前缀相同的子串个数,直到第k个 不过bzoj上会T #include<ios ...
- windows虚拟机下 安装docker 踩过的坑
首先,你的是win7.8还是win10 windows对docker兼容也是最近的事,所以win7.8的话,安装docker是要用工具箱的,不过官方给了下载. 国内话的可以通过,阿里镜像,或者清华镜像 ...
- 51Nod 1021 石子归并(动态规划)
#include <iostream> #include <algorithm> #include <string> #include <iostream&g ...
- 贪心 Codeforces Round #303 (Div. 2) B. Equidistant String
题目传送门 /* 题意:找到一个字符串p,使得它和s,t的不同的总个数相同 贪心:假设p与s相同,奇偶变换赋值,当是偶数,则有答案 */ #include <cstdio> #includ ...
- 1-1-Java的特点
Java语言平台 JavaSE(Java Platform Standard Edition)标准版 以前叫做J2SE,5.0版本后改名叫做JAVASE,主要用于桌面应用程序的开发,该技术体系是后两者 ...
- Suricata的Reputation
见官网 https://suricata.readthedocs.io/en/latest/reputation/index.html Docs » 9. Reputation Edit on Git ...
- mySQL 从删库到跑路
问题: 使用python实现load data infile ...向mySQL中导入数据.虽然成功执行但是数据库中没增加记录. 解决: zz的我execute之后没有commit.
- VS2013编译libjpeg库
第一步:找到刚刚解压出来的“jpeg-9a”文件夹下面的“makefile.vc”文件,用记事本或Notepad++等编辑工具打开,然后找到里面的“!include <win32.mak> ...
- 5款好用的mysql客户端
1. EMS SQL Manager for MySQL 是一款高性能MySQL数据库服务器系统的管理和开发工具.它支持从MySQL 3.23到6.0的任一版本,并支持最新版本的MySQL的特点,包括 ...