LinuxQuestions.org
Review your favorite Linux distribution.
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 02-20-2007, 04:06 PM   #1
quilop
LQ Newbie
 
Registered: Jun 2004
Location: Chicago IL
Distribution: SuSe 10
Posts: 7

Rep: Reputation: 0
Add folder access to Apache conf


Hi, I have a Nagios installation on my server running with Apache 2.0 and I have tried to install and configure NagiosGrapher on it. My problem is that I am having problems with the graphics, and it seems that the issue relays on Apache having problems to access a font. What I want to know is how to add an apache readable folder in .httpd.conf

I want Apache to be able to read /usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf

I am not using .htaccess and I have tried the following without success:

<Directory "/usr/share/rrdtool/fonts/">
Options All
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I am getting an error on apache error log that says:

"Can't find font /usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf"

Any advice or tips are most welcome.
Thanks
 
Old 02-21-2007, 01:05 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
You can use the Alias directive:
Code:
Alias /fonts /usr/share/rrdtool/fonts
Also change the <Directory "/usr/share/rrdtool/fonts/"> to <Directory "/fonts">
This way when you give the URL: http://www.domain.com/fonts/DejaVuSansMono-Roman.ttf, apache will use the correct path to show the font. If your URL is different change the first part of the Alias directive accordingly.

Last edited by bathory; 02-21-2007 at 01:07 PM.
 
Old 02-22-2007, 03:29 PM   #3
quilop
LQ Newbie
 
Registered: Jun 2004
Location: Chicago IL
Distribution: SuSe 10
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for the reply. Actually I am not trying to view the font from any WEB client. I am trying to use an auto grapher, and this autographer uses rrdtool to create the graphics. At some point when I click a link on my site, that link execute a CGI and the CGI is making a call to /usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf It is here where Apache complains telling that the file can not be found, even when it is there, and all the folder access are available to the world.

That is why Im looking to giving apache the rights to read a folder outside the "htdocs" where my WEB page is located in.

Any ideas?

Thanks
 
Old 02-22-2007, 04:05 PM   #4
quilop
LQ Newbie
 
Registered: Jun 2004
Location: Chicago IL
Distribution: SuSe 10
Posts: 7

Original Poster
Rep: Reputation: 0
I tried adding the Alias like this:

Alias /nagios/fonts/ /usr/share/rrdtool/fonts/
<Directory "/usr/share/rrdtool/fonts/">
AllowOverride AuthConfig
Options MultiViews
Order allow,deny
Allow from all
</Directory>

Reloading apache, and when I try to access localhost/nagios/fonts y get a "You dont have permission to access /nagios/fonts" error message.

Maybe is just an easy config setting in httpd.conf file that I am not aware of. Any suggestions?
 
Old 02-23-2007, 02:11 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
You can try a few things:
1. Make sure the that folder /usr/share/rrdtool/fonts is world executable, to avoid the ""You dont have permission to access /nagios/fonts" error message.
2. If the cgi is a perl script you can edit it and change the path to the font to DocumentRoot. Then copy the font inside the DocumentRoot.
3. Create a symlink to /usr/share/rrdtool/fonts somewhere inside DocumentRoot:
Code:
ln -s /usr/share/rrdtool/fonts /var/www/html/fonts
and use "Options FollowSymlins" for that directory:
Code:
<Directory "/var/www/html/fonts/">
Options FollowSymlinks
AllowOverride Options
Order allow,deny
Allow from all
</Directory>
 
Old 02-23-2007, 03:07 PM   #6
quilop
LQ Newbie
 
Registered: Jun 2004
Location: Chicago IL
Distribution: SuSe 10
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

Ok, I have alerady tried the first option, it has full access (chmod 777) and still nothing. The second one, sadly, I am not sure what CGI is the one who is calling for the font, I thought it was my NagiosGrapher, but I changed the settings, recompiled the app with the new settings, there is a place where "supposedly" you can enter a different font path, but apache is still looking for the font on the path we are talking about, so I guess this is not a good one.

And I tried the third one, this one looked that was going to solve my drama

3. Create a symlink to /usr/share/rrdtool/fonts somewhere inside DocumentRoot:
Code:

ln -s /usr/share/rrdtool/fonts /var/www/html/fonts

and use "Options FollowSymlins" for that directory:
Code:

<Directory "/var/www/html/fonts/"> Options FollowSymlinks AllowOverride Options Order allow,deny Allow from all </Directory>

But Apache is still sending the error message.

I made a little test, if I put the following alias:

Code:
Alias /nagios/fonts/ /usr/local/typo3/htdocs/nagios/fonts/
<Directory "/usr/local/typo3/htdocs/nagios/fonts/">
AllowOverride AuthConfig
Options MultiViews
Order allow,deny
Allow from all
</Directory>

I can access the folder /nagios/fonts without problems, but, if I put the following alias:

Code:
Alias /nagios/fonts/ /usr/share/rrdtool/fonts/
<Directory "/usr/share/rrdtool/fonts/">
AllowOverride AuthConfig
Options MultiViews
Order allow,deny
Allow from all
</Directory>

I get the "403 Forbidden, you dont have permission to access /nagios/fonts/ on this server" message on the WEB browser.

This is why I am thinking that Apache does not have permission to access any path outside its server route. The server route is /usr/local/typo3/htdocs/
Any doc inside here can be accessed, any other outside this rouse cant, no matter if I change folder permissions, alias, create links, etc.

Is there a way to tell Apache to access a folder no matter if it is outside of its server path? Is there something else I can try??
 
Old 02-24-2007, 07:49 AM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Using symlink should have worked as the Alias option too. You can read http://httpd.apache.org/docs/2.0/urlmapping.html how you can access pages outside DocumentRoot.
Perhaps your distro uses SELinux and that is the reason you cannot access anything outside DocumentRoot. If that's the case change SELinux settings, or disable it to see if apache works as expected.
 
  


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
How do you list enabled Apache modules without access to httpd.conf? mattie_linux Linux - Software 1 05-15-2006 10:32 PM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
how to add pwd to access folder in http maginotjr Slackware 3 11-10-2005 05:38 AM
PHP - What to add to Apache httpd.conf file? maktos Linux - Software 9 04-17-2004 08:18 PM
kdevelop add folder and add new class is slow edwardt Programming 0 03-03-2004 06:04 PM


All times are GMT -5. The time now is 08:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration