Explanation of the preinstalled apache:: Where is httpd.conf?




I managed to upgrade php to php7.0.7 using the instructions from this post: How to upgrade to PHP7

I come from windows where I installed apache and pointed it to a htdocs folder which is the root http://localhost/ location, set the PHP location and everything in httpd.conf.

Since I am able to write and execute a simple phpinfo() site (result is 5.5.9.), I assume there is an apache pre-installed.

I found several apache folders e.g. such as /etc/apache2/conf.d/.* containing a phppgadmin but even tough it syntactically looks simillar to my httpd.conf, the contents are a lot different.

So the question would be: Where are the configuration files for apache?

A subquestion that could help: Has anyone managed to install Laravels Lumen on c9?

(I am really sorry for the form of the question, this is only my second day with Linux and C9 and Im a bit overwhelmed)


(No expert here, just another user)

Ubuntu Linux is a branch (fork?) of Debian, which has made a few changes to how some programs are installed. I think they’re well thought out but they can be confusing.

To answer your question: Under Ubuntu, httpd.conf is apache2.conf, and it’s in /etc/apache2, as you’ve already found. The confusing part is that there’s hardly anything going on in apache2.conf - most of what it does is to include files from conf.d. Basically, the configuration has been broken up into a number of different files.

The configuration as such is essentially the union of all the files in conf-enabled/, with individual sites being the union of all the files in sites-enabled/. On my (untouched) installation, there’s a 000-default site and a 001-cloud9 site. The C9 site configuration sees to it that your Apache serves on port 8080, which can be accessed from the outside through C9’s proxy. If you have directories and stuff to set up for your application, I’m guessing this would be the place. I’ve done this before and got it all working the way I wanted to, but it’s been a while so -sorry!- I’ve forgotten the details.

The files in conf-enabled/ and sites-enabled/ are all symlinks to actual files of the same name in directories conf-available/ and sites-available/, respectively. The reason for this seemingly baroque setup is that you can enable or disable certain bits of configuration simply by fiddling with the symlinks. This is sometimes very handy. All the file names start with a 3 digit number so they’ll be sorted (and included) in the order of those numbers, which is helpful when certain stuff needs to be done in a certain order.

Hope this helps!



Thank you. I managed to create my Lumen installation in AWS, once it becomes the production version, I will update my c9 account to be able to work remotely on the project.

Even tough I find out how to do it, your explanation is really great and helped me understand the issue more deeply and I think it will, help any other struggling user :slight_smile: