EasyApache4 - "/etc/apache2/" and "/etc/httpd/" - why do BOTH directories exist? (CentOS)

httpd_user

Registered
May 15, 2023
4
1
3
U. S. A.
cPanel Access Level
Root Administrator
Hi. I am just curious and trying to understand cPanel's webserver configuration better....

I know that, normally, Apache configuration is located in /etc/httpd/ on CentOS.

However, I see that EasyApache 4 sets the httpd root to /etc/apache2/ instead (as it would be in Debian, et cetera), which is fine.

The thing is, I am looking at my server and I see BOTH directories. /etc/apache2/ contains all the EA config, while /etc/httpd/ seems to just contain some default config that is not even used.

My question is: is the /etc/httpd/ directory being used for anything? And, if not, then why was it created? May I remove it?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,558
2,610
363
cPanel Access Level
Root Administrator
Hey there! On a default cPanel installation (I checked an AlmaLinux 8 machine) I do not see the /etc/httpd directory. You could always run this command to see what, if anything, created it, or if it was included by your hosts OS image:

rpm -qf /etc/httpd/some_file_in_there

That will check the RPM database and see if it that file is linked with any package that was installed.
 

httpd_user

Registered
May 15, 2023
4
1
3
U. S. A.
cPanel Access Level
Root Administrator
Thank you!

Yeah, this folder doesn't have any symlinks other than the usual ones, so it doesn't seem to be there for legacy's sake.

Interestingly enough, it says:

file /etc/httpd/conf/httpd.conf is not owned by any package

I wonder how it got there?

I won't remove it, but I guess it would be safe to do so.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,558
2,610
363
cPanel Access Level
Root Administrator
Whenever I want to delete a file, I don't. I rename it to current_filename.bak and then see if anything breaks so I can easily put it back if necessary. As long as it isn't some huge logfile that is causing space issues, that usually is a good method.
 

httpd_user

Registered
May 15, 2023
4
1
3
U. S. A.
cPanel Access Level
Root Administrator
For reference, here's the contents of the (apparently unused) httpd folder:

.:
conf/
conf.d/
conf.modules.d/
logs -> ../../var/log/httpd/
modules -> ../../usr/lib64/httpd/modules/
run -> /run/httpd/

./conf:
httpd.conf
magic

./conf.d:
autoindex.conf
mpm_prefork.conf
README
userdir.conf
welcome.conf

./conf.modules.d:
00-base.conf
00-dav.conf
00-lua.conf
00-mpm.conf
00-proxy.conf
00-systemd.conf
01-cgi.conf
 

httpd_user

Registered
May 15, 2023
4
1
3
U. S. A.
cPanel Access Level
Root Administrator
Whenever I want to delete a file, I don't. I rename it to current_filename.bak and then see if anything breaks so I can easily put it back if necessary. As long as it isn't some huge logfile that is causing space issues, that usually is a good method.
You are right, of course, that's what I meant to say...;)
 
  • Like
Reactions: cPRex