Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

It's been a while since I've worked with Apache so please be kind - I'm also aware of this question but it hasn't been much help to me.

I'd like to set up a simple vHost w/ Apache for my Icinga instance. Icinga is up and running and I can access it from x.x.x.x/icinga, however would like to be able to access it externally as well as internally.

I have set up the /etc/hosts file and the following is my barebones vhost statement in httpd.conf

<VirtualHost *:80>
    ServerAdmin me@mydomain.com
    DocumentRoot /usr/share/icinga
    ServerName icinga.domain.com
    ErrorLog logs/icinga.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

I also have the following in my .htaccess file

<Directory>
        Allow From All
        Satisfy Any
</Directory>

An entry has been made for the instance in the Windows DNS server on my network, however when I try to access the site by URL I am greeted with Internal Server Error.

Reviewing the /var/log/icinga.com-error_log I see the following entry.

[Thu Dec 13 16:04:39 2012] [alert] [client 10.0.0.1] /usr/share/icinga/.htaccess: <Directory not allowed here

Can someone help me spot the error of my ways?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Just remove the <Directory> stuff in the .htaccess file.

Apache knows to what directory it applies to - hence, it's the directory the .htaccess file is in! You can't override configuration of other directories in .htaccess files (security feature). Besides, your <Directory> start tag misses the directory itself if you would put it in the main configuration; it should be e.g. <Directory /path/to/dir>.

share|improve this answer

Apache is telling you exactly what's wrong: <Directory> is not allowed here (in your .htaccess file).

If you look at the Apache documentation you'll see that <Directory> is only allowed in two contexts: server config and virtual host.

(The contents of a .htaccess file are implicitly applied to the filesystem directory containing it, so you don't need the <Directory> directive.)


You will also find a tutorial on how to write .htaccess files in the Apache documentation which may be helpful.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.