0

I install apache2 package and i run this command line from terminal and it getting me error like this

user@user:~$ sudo /etc/init.d/apache2 restart 
sudo: /etc/sudoers.d is world writable
/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars
/etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars
ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars

can anyone help me for this.

  • It seems the file /etc/apache2/envvars is missing which is part of the apache2 package. Did you get any error messages during install or did you manually remove/move something? Btw. you should run chmod 0440 /etc/sudoers. – Thomas Oct 01 '16 at 14:36
  • possible duplicate http://askubuntu.com/questions/304212/how-to-solve-sudo-etc-sudoers-d-is-world-writable – denny Oct 01 '16 at 15:50

1 Answers1

0

Did you accidentally changed permissions and/or ownership on the files envvars and sudoers.d? Because apache is not able to open the envvars file. Also the sudoers.d directory seems to have different permissions than when it was installed. Use the commands below to change permissions and ownership of the file and directory.

sudo chmod 755 /etc/sudoers.d

User and group should be root - change like this:

sudo chown root: /etc/sudoers.d 

And for the envvars files

sudo chmod 644 /etc/apache2/envvars

sudo chown root: /etc/apache2/envvars
kimda
  • 421