LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-22-2011, 02:02 PM   #1
cleibesouza
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Rep: Reputation: Disabled
Aliases


Hi all,
I'm trying to make it possible to see my logfiles on a browser.
For instance, I want to browse to http://www.mysite.com/logfiles and see a listing of all my logfiles.
Because the logfiles reside outside of the web content directory, I'm trying to set up an Alias (sorry if my terminology isn't correct, but it's a newbie forum anyway). Here's how I'm doing it:

Code:
Alias /logfiles /path/to/my/logfiles
<Directory /path/to/my/logfiles>
   Order allow,deny
   Allow from all
</Directory>
Then I restart apache /etc/init.d/httpd restart

When I browse to http://www/mysite.com/logfiles I get a 404.

I've been online all morning looking for a solution and all I find is what I've already done.

BTW, this is a RHEL 5 on a LAMP stack.

Any ideas would be appreciated.
 
Old 07-22-2011, 02:11 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,319

Rep: Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470
Quote:
Originally Posted by cleibesouza View Post
Hi all,
I'm trying to make it possible to see my logfiles on a browser. For instance, I want to browse to http://www.mysite.com/logfiles and see a listing of all my logfiles. Because the logfiles reside outside of the web content directory, I'm trying to set up an Alias (sorry if my terminology isn't correct, but it's a newbie forum anyway). Here's how I'm doing it:
Code:
Alias /logfiles /path/to/my/logfiles
<Directory /path/to/my/logfiles>
   Order allow,deny
   Allow from all
</Directory>
Then I restart apache /etc/init.d/httpd restart When I browse to http://www/mysite.com/logfiles I get a 404. I've been online all morning looking for a solution and all I find is what I've already done. BTW, this is a RHEL 5 on a LAMP stack.
Check your apache configuration, usually in /etc/apache2. In your .conf file, add the "Options FollowSymLinks" directive. Should be in the default .conf file in the DocumentRoot section. There are other options, but FollowSymLinks lets Apache traverse an 'alias' like a symbolic link.

On another note...that's a VERY insecure thing to do. Any potential attacker can just browse your logs, and from those, get a picture of your internal network, user ID's, etc.
 
Old 07-22-2011, 02:23 PM   #3
cleibesouza
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
hmm.. interesting.
I actually don't HAVE to see the log files in a browser, but I'd like to see them easier than using VI. What I need to look at are the access files once in a while. Do you have a recommendation of a better way to look at the log files?

Thanks.
 
Old 07-22-2011, 02:28 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,319

Rep: Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470
Quote:
Originally Posted by cleibesouza View Post
hmm.. interesting.
I actually don't HAVE to see the log files in a browser, but I'd like to see them easier than using VI. What I need to look at are the access files once in a while. Do you have a recommendation of a better way to look at the log files?

Thanks.
Two ways come to mind. I'd install and configure logwatch, and have it email you on a regular basis, or just log in via secure shell (SSH) and look at them manually. If you've got one server, that's the way to go, in my opinion, since it's more secure.

If you've got multiple servers, consider installing something like Nagios, that will watch log files for patters, and give you a web-page with lots of other stats too. You can secure the login on that page, and kill multiple birds with one stone.
 
Old 07-22-2011, 02:47 PM   #5
cleibesouza
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you for the suggestions. I'm already seeing the log files using SSH. I was just looking for a better way to read them since vi is a pain. Logwatch is an option too and I'll check Nagios.

Your help is greatly appreciated.
 
Old 07-22-2011, 04:38 PM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
You can choose other editor than "vi", for example I am using viewer from "Midnight Commander".
 
Old 07-23-2011, 12:31 PM   #7
jdix123
LQ Newbie
 
Registered: Feb 2008
Posts: 17

Rep: Reputation: 0
Check out this howto.

http://linuxcommand.org/writing_shell_scripts.php

He goes over creating a script which puts information about your machine into html formatting. With a few tweaks, you can put your log file information into the script instead, and view the logs in a browser without actually publishing the information to the web.

I'm not sure if this completely solves your security issue, but you can easily just delete the file once you viewed the necessary info. And its easier than scrolling through vi
 
  


Reply


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
aliases issue using /etc/aliases lensem Linux - Software 3 04-14-2009 01:48 PM
wrap lines at 80 for long aliases in .aliases.csh jhwilliams Linux - Software 0 07-26-2007 08:49 AM
sendmail and NIS databases (aliases, mail.aliases) - what kind of databases? cotton213 Linux - Software 0 03-14-2006 06:57 PM
using aliases after doing su? NonSumPisces Linux - Newbie 2 08-15-2004 03:19 PM
See aliases gubak Linux - Newbie 0 08-04-2004 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration