accessing apache httpd.conf permission denied

Issues related to applications and software problems
Post Reply
gentlemedia
Posts: 17
Joined: 2017/07/16 13:52:09

accessing apache httpd.conf permission denied

Post by gentlemedia » 2017/07/20 11:58:48

Hi,

I need to modify apache httpd.conf and while I'm logged in as root, I got the message 'permission denied'.
I'm checking the permissions on httpd.conf with

Code: Select all

ls -laZ /usr/local/apache/conf/httpd.conf
I see that I should have rwx permissions.
permission_httpd.config.jpg
permission_httpd.config.jpg (16.54 KiB) Viewed 10214 times
So why do I get the 'permission denied' message?

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: accessing apache httpd.conf permission denied

Post by avij » 2017/07/20 12:02:28

The permissions of /etc/apache2/conf/httpd.conf are what matter.

gentlemedia
Posts: 17
Joined: 2017/07/16 13:52:09

Re: accessing apache httpd.conf permission denied

Post by gentlemedia » 2017/07/20 12:13:12

Ah ok, thanks!

So i tried to access that one and I got also the 'permission denied' message and when I want to check the permissions, I get the message 'No such file or directory'
permission_apache2_httpd.config.jpg
permission_apache2_httpd.config.jpg (32.8 KiB) Viewed 10204 times

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: accessing apache httpd.conf permission denied

Post by avij » 2017/07/20 12:31:44

In your first command, you tried to execute a text file, the config file. That is not going to work. Try something like nano /usr/local/apache/conf/httpd.conf to launch a text editor (nano) to edit the file. If you don't have nano installed, try yum install nano.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: accessing apache httpd.conf permission denied

Post by TrevorH » 2017/07/20 13:00:54

Nothing that CentOS supplies installs under /usr/local so it sounds like you are running something like cpanel or another similar panel that replaces CentOS supplied software with its own. You'll need to seek support for that from the people that provide it. We cannot help as they have their own methods of managing that and any advice we might supply that would be applicable to a real CentOS system might break your panel supplied stuff more than it already is.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gentlemedia
Posts: 17
Joined: 2017/07/16 13:52:09

Re: accessing apache httpd.conf permission denied

Post by gentlemedia » 2017/07/20 13:04:26

Thanks, avij! I'm learning step by step here as you can see :)

I could open the file with the nano etc. command, but reading the comments it's not recommended to do so. I should create and then edit some include config files which is going to be another challenge for me.
nano_httpd.config.jpg
nano_httpd.config.jpg (154.1 KiB) Viewed 10191 times

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: accessing apache httpd.conf permission denied

Post by TrevorH » 2017/07/20 13:07:48

You need to ask cpanel. Your system is not supported here once you install cpanel on it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gentlemedia
Posts: 17
Joined: 2017/07/16 13:52:09

Re: accessing apache httpd.conf permission denied

Post by gentlemedia » 2017/07/20 13:13:25

Thanks, Trevor. As you can see from the screenshot, you're right about WHM/cPanel. Within WHM I only can edit some basic settings of the Apache config.
cPanel also doesn't recommend it to modify it directly, but I can test if WHM/cPanel will overwrite the config file, so that's why I was trying to do these steps directly via the command line.

https://documentation.cpanel.net/displa ... ledirectly

I will take your advise and go with this issue to the cPanel forum. Thanks!

Post Reply