以编程方式更改<Directory / var / www />的AllowOverride
我怎么能(从BASH)改变AllowOverride的<Directory /var/www/>从'None'到'All'? 而不必手动编辑/etc/apache2/sites-enabled/000-default 通常我可以使用sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/sites-enabled/000-default 但是,我的000-默认文件有其他的AllowOverride指令,我不想改变: NameVirtualHost * <VirtualHost *> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all […]