Background Information
How do you enable .htaccess files for Apache? When you create the files in directories, they do not work.
Answer
You will need to modify the vhost configuration files found in /etc/httpd/rightscale.d
If the server is a load balancer and has HAProxy installed on it, you will need to modify: http-8000-www.yoursite.com.vhost.
If it is a standalone server (such as part of an auto-scaling array) you will need to modify: http-80-www.yoursite.com.vhost.
Change the line from AllowOverride None to AllowOveride All in order to password protect a directory that you can put the following into: /home/webabbs/yourappdir/current/dirtoprotect/.htaccess.
AuthType Basic AuthName "Password Required" AuthUserFile /www/passwords/password.file AuthGroupFile /www/passwords/group.file Require Group admins
You can automate this in a RightScript as follows. This script password protects the www root (you will need to modify the path if you need to protect a different directory):
#!/bin/bash if [-f /etc/httpd/rightscale.d/http-8000-$WEBSITE_DNS.vhost]; then sed -i "s/AllowOverride None/AllowOverride All/g" /etc/httpd/rightscale.d/http-8000-$WEBSITE_DNS.vhost fi if [-f /etc/httpd/rightscale.d/http-80-$WEBSITE_DNS.vhost]; then sed -i "s/AllowOverride None/AllowOverride All/g" /etc/httpd/rightscale.d/http-80-$WEBSITE_DNS.vhost fi cat > /home/webapps/$APPLICATION/current/.htaccess << EOF AuthType Basic AuthName "Password Required" AuthUserFile /www/passwords/password.file AuthGroupFile /www/passwords/group.file Require Group admins EOF service httpd restart
Related Articles
How do I use an AWS CloudFormation Templates or Azure Resource Manager Templates in a CAT? 3Number of Views Frequently Asked Questions: How do I gather log files and information for the Snow Support team? 180Number of Views How Do I Run a Suite Installer Silently? What Command Do I Use? 13Number of Views NT User Permissions for Installed Directories, Files, and Registry Keys 5Number of Views How do I generate my own signed certificate for use with Beacon Monitor? 19Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago