Jacek Francuz
Jacek Francuz

Reputation: 2498

Apache2: Password protected directory - website cannot connect to its own server

I have protected a directory where my website is placed with password (.htaccess + .htpasswd). The protection works like a charm. However, there is one problem. On the same domain I have SOLR server set up and my website uses remote connections to retrieve data from it (ie. PHP's file_get_contents). Unfortunately this does not work as it is password protected as well.

What do I do to allow my server to connect to itself without HTTP authentication? Is it possible?

Thanks a lot!

Upvotes: 0

Views: 179

Answers (1)

mabarroso
mabarroso

Reputation: 659

Add the line

Allow from 192.168.0.1/24

to the Auth definition. After Require valid-user is a good place. Change the ip number if necesary.

Upvotes: 1

Related Questions