Httpd Error Log Permission Denied
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or
Permission Denied: Ah00091: Httpd: Could Not Open Error Log File
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss could not open error log file /etc/httpd/logs/error_log. Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Ah00015: Unable To Open Logs
takes a minute: Sign up Apache Server: Editing httpd.conf file (permission denied) up vote 2 down vote favorite So I just recently downloaded Apache server with all of its files (httpd, apr, apr-util, pcre) following the instructions dictated here: http://httpd.apache.org/docs/2.4/install.html apache unable to open logs However, after set-up, when I tried to start my Apache server, which is located in my usr/local/bin/, I was prompted with this message: [allen@allen-lnx ~]$ /usr/local/bin/apachectl start (13)Permission denied: AH00091: httpd: could not open error log file /usr/local/logs/error_log. AH00015: Unable to open logs After some research, I have found that I need to edit my httpd.conf file, which I did so earlier to allow for the correct ServerName and Listen options. However, I am unsure as to how to edit my turn off selinux conf file to allow for access to the "logs" directory. Notably, the command will run when I use the "sudo" command, but I would prefer to not always use that since it seems like a work around. Any help would appreciated. Thanks! Edit: I've actually noticed that I may have two httpd.conf files, which is proving to be a little troublesome. The other one is located in my root /etc/ directory (etc/httpd/conf/httpd.conf). I think my modified question now is... which one should I be keeping? Is the /etc/ version the one that is built in, as indicated by faff's comment below? Current Solution: I figured I would just accept the fact that I need to use sudo when editing this file since I need to be root. I might change it later so that I'm always running as root, but for now, sudo will suffice. apache logging permissions config share|improve this question edited Jun 19 '13 at 21:10 asked Jun 15 '13 at 20:21 Zhouster 4261918 Which Linux distribution is this? It's usually much easier to install apache via the package manager for your OS. It'll keep you updated on security patches, and it will be properly integrated with the rest of the system to ensure it's configured correctly for your setup. –faffaffaff Jun 15 '13 at 20:23 I'm running Oracle Linux 6.4. Does that help? –Zhouster Jun 16 '13 at 6:34 Why can't y
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the
Centos 7 Selinux Disable
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions ah01630: client denied by server configuration Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million
Setenforce
programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Permission denied: httpd: could not open error log file /etc/httpd/logs/error_log up vote 1 down vote favorite When I want to http://stackoverflow.com/questions/17127553/apache-server-editing-httpd-conf-file-permission-denied restart the httpd searvice on centOS 6.7 I have the following error: /etc/init.d/httpd restart Stopping httpd: [FAILED] Starting httpd: (13)Permission denied: httpd: could not open error log file /etc/httpd/logs/error_log. Unable to open logs [FAILED] This is error_log: ls -Z /etc/httpd/logs/error_log -rw-r--r--. root root unconfined_u:object_r:var_t:s0 /etc/httpd/logs/error_log I disabled selinux also. What is the problem? php apache httpd.conf selinux share|improve this question asked Mar 8 at 7:44 MLSC 2,80211447 add a comment| 2 Answers 2 active http://stackoverflow.com/questions/35861728/permission-denied-httpd-could-not-open-error-log-file-etc-httpd-logs-error-lo oldest votes up vote 2 down vote httpd runs probably as user apache of user httpd. Your log is owned and only writable by root. Change ownership of your logfile to make this work. This should do the trick: ~# chown apache.apache /etc/httpd/logs/error_log share|improve this answer edited Mar 8 at 8:51 answered Mar 8 at 8:01 Bart Friederichs 20.1k54387 add a comment| up vote 1 down vote Probably you should change the group of that forder to apache, it's not recommended to have root as owner of server stuff. Anyway apache should change that on his own after http starts... From httpd Wiki: Before we start, we need to be aware that the Apache HTTP server (httpd) runs as a particular user and group. On Linux as well as most other Unix-like systems, httpd is started as the "root" user; UID=root, GID=root. This is necessary because only this user can bind to port 80 and 443 (anything below 1024 in fact). After http starts and binds to its ports (defined by the Listen statments in httpd.conf), it changes user to that specified in httpd.conf. Typically: User: apache Group: apache Note that Debian based systems, including Ubuntu, use "www-data" instead. As a possible solution you should add yourself into the group apache usermod -a -G apache (username) Then: chgr
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://serverfault.com/questions/590012/why-cant-apache-create-log-files the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up error log Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Why can't apache create log files? up vote 1 down vote favorite I have a simple LAMP stack on CentOS setup. Apache is setup with vhosts and each developer has their web files inside their user could not open folder. The directory structure is like so (for the user test): /home/test |_ apache |_ domain1.com |_ backups |_ conf |_ vhost.conf |_ logs |_ errors.log |_ images.log |_ web.log |_ private |_ public The vhost config is in the vhost.conf file. The log files in logs don't exist when the config is first setup, and this throws an error with apache when I run service httpd restart: (13)Permission denied: httpd: could not open error log file /home/test/apache/domain1.com/logs/error.log. Unable to open logs I tried running httpd -X as root and it created the log files (with root ownership/group). I thought it would be a case of making sure that the files are there, with group set as apache and writeable (so I don't have to make the whole directory belong to apache group and writeable), but this confuses me: [root@dev logs]# ls -al total 16 drwxr-xr-x. 2 test developers 4096 Apr 18 21:02 . drwxr-xr-x. 8 test developers 4096 Apr 18 20:25 .. -rw-r--r--. 1 test developers 1818 Apr 18 21:02 error.log -rw-r--r--. 1 test de