LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Can I get a second set of eyes. VHost error logs cause error (https://www.linuxquestions.org/questions/linux-server-73/can-i-get-a-second-set-of-eyes-vhost-error-logs-cause-error-4175532347/)

kb2tfa 01-28-2015 09:10 PM

Can I get a second set of eyes. VHost error logs cause error
 
I am running
CentOS Linux release 7.0.1406 (Core)

I created a Virtualhost, and when I restart httpd, it fails. I used journalctl -l to see error. I lost it in my history, the only way is to regenerate the problem. If I have to I will, but it was not specific at all. Journal just told me what I knew, it tried to start and failed.

After triple checking the paths, I started commenting out sections like the <Directory>, etc. Once I commented out the error logs, the server started and is running. Uncommenting the error section, httpd fails to start.
Code:

#LOG FILES
# ErrorLog /var/www/html/mysite.net/logs/error.log
# CustomLog /var/www/html/mysite.net/logs/access.log combined

I would like to have logs though.

Here is the complete VirtualHost. Any Ideas?
Code:

<VirtualHost *:80>
   
    ServerAdmin myemail@gmail.com
    ServerName  mysite.net
    ServerAlias www.mysite.net *.mysite.net
   
    #Indexes + Directory Root
    DocumentRoot  /var/www/html/mysite.net/
    <Directory "/var/www/html/mysite.net/">
          Options Indexes FollowSymLinks Multiviews
          AllowOverride All
          Order allow,deny
          Allow from all
    </Directory>
   
    #LOG FILES
    # ErrorLog /var/www/html/mysite.net/logs/error.log
    # CustomLog /var/www/html/mysite.net/logs/access.log combined
</VirtualHost>


bathory 01-29-2015 12:40 AM

Quote:

Once I commented out the error logs, the server started and is running. Uncommenting the error section, httpd fails to start.

#LOG FILES
# ErrorLog /var/www/html/mysite.net/logs/error.log
# CustomLog /var/www/html/mysite.net/logs/access.log combined
Is there any specific reason to use this path for logs, instead of the default /var/log/httpd? Besides that, it's also a bad idea to put logs in the DocumentRoot of your site.
Anyways, if you insist on that, then I guess it's SELinux that's not allowing apache to write it logs into docroot

Regards

kb2tfa 01-29-2015 12:16 PM

Quote:

Originally Posted by bathory (Post 5308112)
Is there any specific reason to use this path for logs, instead of the default /var/log/httpd? Besides that, it's also a bad idea to put logs in the DocumentRoot of your site.
Anyways, if you insist on that, then I guess it's SELinux that's not allowing apache to write it logs into docroot

Regards

No, no reason, just an example I read online. thank you for the feedback.

kb2tfa 01-29-2015 08:19 PM

I change the logs to /var/log/httpd/mysite_error.log, and it worked. thank you again.


All times are GMT -5. The time now is 12:22 AM.