I am trying to modify an
httpd.conf file, allowing override in the
/var/www/html directory. For simplicity's sake, let's say it looks like this:
<Directory "/var/www/html"> # Comment AllowOverride none # Comment </Directory>
Trying to replace
AllowOverride none with
I tried something like this:
sed -i 's/\(Directory \"\/var\/www\/html\">.*?\)AllowOverride none\(.*?<\/Directory>\)/\1AllowOverride all\2/' httpd.conf
It doesn't look like it catches multiple lines, so I tried some other things, such as RegEx modifiers and this: https://www.gnu.org/software/sed/manual/html_node/Text-search-across-multiple-lines.html but was unable to match the desired string.
How would one go about doing this? Solutions outside of sed are welcome as well.