I don´t know why but it didn´t work. Can anybody explain this part:
Edit the /opt/bitnami/apps/APPNAME/conf/httpd-app.conf file and add the following lines. You also need to comment the Require all granted line as shown below:
However, in reference to the code you’re referring to - You need to swap out
<Directory "/opt/bitnami/apps/APPNAME/htdocs">
with your actual web directory where you have Magento install. So, if you’ve been following along with my guides/tutorials then this would be /var/www/html/`, so the line would be:
<Directory "/var/www/html">
And then this next line will vary depending on the apache configuration locations (whatever you ahve it set as:
AuthUserFile "/opt/bitnami/apache2/APPNAME_users"
Note: The instructions refer to a very specific type of setup. Probably One-Click Install in either a Shared Environment of one where something like cPanel/Plesk is installed? I don’t work on these environments so my knowledge is lacking on troubleshooting them.
I sat up my server on AWS Lightsail. The documentation from bitnami about " Password-Protect Access To An Application With Apache" should match with one click server configuration.
The first step is:
At the console, type the following commands. Remember to replace APPNAME, USERNAME and PASSWORD with your application name, desired username and desired password respectively.
cd /opt/bitnami
apache2/bin/htpasswd -cb apache2/APPNAME_users USERNAME PASSWORD
–> that worked out.
The second step:
Edit the /opt/bitnami/apps/APPNAME/conf/httpd-app.conf file and add the following lines. You also need to comment the Require all granted line as shown below:
I am not sure what “You also need to comment the Require all granted line as shown below” mean?
<IfDefine USE_PHP_FPM>
<Proxy "unix:/opt/bitnami/php/var/run/magento.sock|fcgi://magento-fpm" timeout=300>
</Proxy>
</IfDefine>
<Directory "/opt/bitnami/apps/magento/htdocs">
Options -MultiViews
AllowOverride None
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfDefine USE_PHP_FPM>
<FilesMatch \.php$>
SetHandler "proxy:fcgi://magento-fpm"
</FilesMatch>
</IfDefine>
<IfModule pagespeed_module>
ModPagespeedDisallow "*"
</IfModule>
Include "/opt/bitnami/apps/magento/conf/banner.conf"
</Directory>
Include "/opt/bitnami/apps/magento/conf/htaccess.conf"
I am not sure where to add these lines in the original file. Additionally I am not sure how to understand the second step of the Bitnami documentation. Maybe you can help me out?
Sorry to hear that. A complete stab in the dark would be to move# Require all granted directly underneath Require valid-user. As I guess that would apply to everything under the web directory rather than anything in the IFVersion rule. For example: