zoukankan      html  css  js  c++  java
  • 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 300
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       5
        MaxSpareServers      10
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    <IfModule mpm_worker_module>
        StartServers          2
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadLimit          64
        ThreadsPerChild      25
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
    <IfModule mpm_event_module>
        StartServers          2
        MaxClients          150
        MinSpareThreads      25
        MaxSpareThreads      75
        ThreadLimit          64
        ThreadsPerChild      25
        MaxRequestsPerChild   0
    </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
  • 相关阅读:
    window10-jmeter安装
    软件开发模型
    软件测试的原则和流程
    手机APP测试
    优秀的软件测试工程师
    自动化测试
    测试用例
    软件测试功能分类
    ios-prefix文件最全
    催收策略及催收评分卡搭建
  • 原文地址:https://www.cnblogs.com/gange111/p/9582637.html
Copyright © 2011-2022 走看看