Ludwig Diehl
asked on
Apache Location Directive
Hello everyone!.
I am trying to configure my apache server so only some locations have authentication. Currently I have this:
However every locations needs authentication. I want something like this:
Any ideas?. Is it possible to do this using .htaccess?
I am trying to configure my apache server so only some locations have authentication. Currently I have this:
<VirtualHost *:443>
Header set Access-Control-Allow-Origin "*"
ServerName mydomain
DocumentRoot /var/www/ws
<Directory /var/www/ws/>
AllowOverride All
Allow from all
Options all
Require all granted
</Directory>
<Location "/">
AuthType Basic
require valid-user
AuthUserFile /var/www/.htpasswd
AuthName "Authorization Required"
satisfy any
deny from all
allow from 192.168.10
allow from 172.16.10
</Location>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache.crt
SSLCertificateKeyFile /etc/ssl/certs/apache.key
SSLCertificateChainFile /etc/ssl/certs/apache.crt
LogLevel debug
ErrorLog /var/www/ws/logs/error.log
TransferLog /var/www/ws/logs/access.log
php_value include_path .:/usr/share/pear:/var/www/ws
Alias /ws /var/www/ws
</VirtualHost>
However every locations needs authentication. I want something like this:
<VirtualHost *:443>
Header set Access-Control-Allow-Origin "*"
ServerName mydomain
DocumentRoot /var/www/ws
<Directory /var/www/ws/>
AllowOverride All
Allow from all
Options all
Require all granted
</Directory>
<Location "/">
AuthType Basic
require valid-user
AuthUserFile /var/www/.htpasswd
AuthName "Authorization Required"
satisfy any
deny from all
allow from 192.168.10
allow from 172.16.10
</Location>
<Location "/services/location1/*">
satisfy any
Allow From All
</Location>
<Location "/services/location2/*">
satisfy any
Allow From All
</Location>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache.crt
SSLCertificateKeyFile /etc/ssl/certs/apache.key
SSLCertificateChainFile /etc/ssl/certs/apache.crt
LogLevel debug
ErrorLog /var/www/ws/logs/error.log
TransferLog /var/www/ws/logs/access.log
php_value include_path .:/usr/share/pear:/var/www/ws
Alias /ws /var/www/ws
</VirtualHost>
Any ideas?. Is it possible to do this using .htaccess?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Poster seems to have stopped posting.