/var/www/ does not exist despite placeholder website and apache2 working normally

Posted April 20, 2020 5.3k views
ApacheLAMP Stack

Newbie question, thanks for your patience. I’m in a mac environment

Neither can I find the directory /etc/apache2/sites-available

I set up droplet web hosting with LAMP, followed one of the tutorials I found on the Digital Ocean forum. The status of the placeholder website hasn’t changed since I set it up successfully, but I can’t find the path now that I wanna change the html file.

I did a basic “index.html” search on all the files, but didn’t manage to find the one that’s hosted.

Would it be at a different place? What am I missing?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

If you can find the httpd.conf file you can search it for the DocumentRoot setting and it will tell you where your default files are located. On Mac I believe it is in /etc/apache2/httpd.conf. If I remember correctly the default web directory on Mac is actually /Library/WebServer/Documents.

Hello, @Boopoopo

I believe the location of the Apache files will be different depending from the install method you’ve used. You might have install it from source or using any package manager brew

You can also share the exact steps/commands you’ve used to install Apache on your machine.

Could you please let me know what is the output of the following commands:

sudo apachectl start
httpd -v

Let me know how it goes.


  • jadas:~ jx$ sudo apachectl start
    /System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded
    jadas:~ jx$ httpd -v
    Server version: Apache/2.4.34 (Unix)
    Server built: Feb 22 2019 20:20:11
    jadas:~ jx$

    I think the problem was that I didn’t log into ssh.. (sigh..) I found it after I actually accessed the droplet

    • Hey, @Boopoopo

      Thanks for getting back to me and for the provided output as well.

      Now we can see that Apache/httpd is running and that the installed/running version is 2.4 as well. May I ask if you’re still finding issues whenever you try to locate the apache’s root directory - /etc/apache2 and also if you’re experiencing any other issues at the moment?

      Let me know how it goes.