使用augeas修改默认的ss指令



我试图修改目录指令apache文件使用augeas在傀儡清单:

Apache file extract:

   <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
   </Directory>

现在我可以使用sudo augtool运行下面的代码,它可以很好地修改"Indexes"参数:

set/files/etc/apache2/sites-enabled/default/VirtualHost/Directory[4]/directive[1]/arg[1] "-Indexes"

但是如果我添加它来显示没有运气!!

清单:

    augeas{ 'default':
    context =>  "/files/etc/apache2/sites-enabled/default",
    notify => Service["apache2"],
    changes =>  [
    "set /VirtualHost/Directory[4]/directive[1]/arg[1] -Indexes",
    ],
   }

i have try to the set command but no luck

任何想法?

感谢

流浪者

Ok修复了删除上下文并执行以下操作的问题:

    augeas{ 'default':
    #context =>  "/files/etc/apache2/sites-enabled/default",
    notify => Service["apache2"],
           changes =>  [
    "set /files/etc/apache2/sites-enabled/default/VirtualHost/Directory[4]/directive[1]/arg[1] -Indexes",
    ],
   }

相关内容

  • 没有找到相关文章

最新更新