LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-28-2015, 09:10 PM   #1
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Rep: Reputation: 18
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>
 
Old 01-29-2015, 12:40 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,754

Rep: Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839Reputation: 1839
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
 
1 members found this post helpful.
Old 01-29-2015, 12:16 PM   #3
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by bathory View Post
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.
 
Old 01-29-2015, 08:19 PM   #4
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Original Poster
Rep: Reputation: 18
I change the logs to /var/log/httpd/mysite_error.log, and it worked. thank you again.
 
  


Reply

Tags
apache, centos7, httpd, vhosts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[CentOS 5.8] 403 Error when accessing vhost directive (permission problems) Ortix Linux - Server 8 10-22-2012 12:04 AM
forbidden error apache vhost sunlinux Linux - Server 6 04-11-2011 06:57 AM
Fedora 10 iwconfig error: Error for wireless request "Set Encode" (8B2A) :SET failed mishkind Linux - Laptop and Netbook 2 05-10-2009 02:43 PM
I am just not seeing this error kinda need an extra pair of eyes please (C++) jus71n742 Programming 3 03-01-2009 04:24 PM
Firefox logs user out? Where are error logs? case1984 Linux - General 0 10-09-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration