I was working through these instructions to get my web server working again and needed to change the /etc/apache2/httpd.conf file.

I needed to change the permission on httpd.conf file and did. Next I attempted to edit /etc/apache2/httpd.conf. I could not because I didn't have permission to change things in the /etc/apache2 directory. So I tried a chmod 666 on the /etc/apache2 directory. Now I cannot see any contents in finder in the /etc/apache2/ directory. The permissions I can see on the directory are: drw-rw-rw-. In Finder it shows as a custom permissions.

I need to change the permissions on /etc/apache2 but to what?

  • Welcome to Ask Different :) Kindly edit your question to clearly state your query. This will help in getting quick and relevant answers. – Nimesh Neema Aug 13 '18 at 0:27
  • Did you use sudo when running chmod 666 on /etc/apache2. What does the output of ls -ld /etc/apache2 says? – Nimesh Neema Aug 13 '18 at 1:41
  • drw-rw-rw- 11 root wheel 352 Apr 30 18:33 /etc/apache2 – Pam Aug 13 '18 at 1:46
  • yes I did use sudo – Pam Aug 13 '18 at 1:47

I didn't have permission to change things in the apache2 directory.

Because the directory is owned by root user and not the logged-in user.

Now I cannot see any contents in finder in the apache2 directory.

Because the current permission is on apache2 directory is drw-rw-rw-, hence you cannot change (cd) into that directory, as you are missing the execute (x) permission bit. Add the execute permission to be able to change to apache2 directory. Execute the following command-line:

sudo chmod a+x /etc/apache2

To edit the httpd.conf (or any other file), use sudo, like:

sudo vim /etc/apache2/httpd.conf

  • Perfect. No points because I am newbie but it is exactly what is needed. – Pam Aug 13 '18 at 11:48
  • Great. Did it work for you? – Nimesh Neema Aug 13 '18 at 11:49
  • It worked perfectly. – Pam Aug 13 '18 at 21:15
  • @Pam Good to hear. Kindly accept the answer so that others having similar problem will know it’s helpful. – Nimesh Neema Aug 13 '18 at 21:16
  • Really am a newbie... I have tried clicking the checkmark. – Pam Aug 13 '18 at 21:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .