I'm looking for modify a line in my apache2.conf file thanks to bash script. It's the first time I'm using bash script and I need help.
In my apache2.conf file, I have :
DocumentRoot /var/www/html/
And I would like to change this by :
DocumentRoot /var/www/html/erp/htdocs/
I have to write something like this into my bash script ?
sed -i 's/"old word"/"new word"/g' apache2.conf
So :
sed -i 's/DocumentRoot /var/www/html//DocumentRoot /var/www/html/erp/htdocs//g' apache2.conf
Thank you for your help !
EDIT :
#Apache2
cd /etc/apache2/sites-available/
sudo sed -i 's,/var/www/html/,/var/www/html/erp/htdocs/,g' 000-default.conf
echo -e "\033[31m Modification chemin accès dolibarr : ok"