Inserting configuration into Apache's httpd.conf


#1

Hello everyone,
I was wondering where exactly should I insert the configuration for Apache in the httpd.conf file. Should I put it at the end of the file? or should I start right after the :ScriptAlias /cgi-bin/ β€œ/usr/local/apache2/cgi-bin/” line? should I even keep that line there?

Thank you veyr much for your time :slight_smile:


#2

Well, I like it like this.
vi /etc/httpd/conf/httpd.conf and make sure you have this in there:

Load config files from the config directory β€œ/etc/httpd/conf.d”.

Include conf.d/*.conf

It’s towards the top, and if not, then put that include in there and restart apache. What that does is this.
Now any file in the /etc/httpd/conf.d name whatever.conf will be read. So you could then put a file in that directory named maybe nagios.conf and put the directives, alias, etc in that file. It makes your apache setup nice and pretty. To remove nagios from your apache setup, just rename the file to nagios.old or something, restart apache and your in. Oh yea, restart apache after you make that nagios.conf file in there too ok?


#3

makes sense. thank you very much