All websites are down

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Permissions

bnsupport ID: 14c5b4ff-bb34-172f-09ec-42543a97234d

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/bch/apps/moodle/troubleshooting/deny-connections-bots-apache/

bndiagnostic failure reason: I do not know how to perform the changes explained in the documentation

Description:
Hi,

All my websites are down. Kindly help.

Hello @huzanforbes,

Are you referring to the 403 Forbidden error accessing your site? Apache is throwing the following error:

[Wed Jul 14 18:25:21.895482 2021] [autoindex:error] [pid 3753:tid 140360932124416] [client **ip_address**:38486] AH01276: Cannot serve directory /opt/bitnami/anugrah/: No matching DirectoryIndex (index.html,index.html,index.htm,index.php) found, and server-generated directory index forbidden by Options directive

Could you check if your directory /opt/bitnami/anugrah/ contains and index file?

Regards,
Francisco de Paz

Hi @fdepaz

No. I have deleted the index file. Is that the reason of the issue?

Hi @fdepaz

Now when I added the index.html file all the websites show the same file. Kindly support.

Hi @fdepaz

Basis this document I went ahead with Approach A and created a new folder. However, these files were causing an issue:

  • Create and edit the /opt/bitnami/apache2/conf/vhosts/myapp-vhost.conf file and add the configuration block shown below:
  <VirtualHost 127.0.0.1:80 _default_:80>
    ServerAlias *
    DocumentRoot /opt/bitnami/myapp
    <Directory "/opt/bitnami/myapp">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

NOTE: If your application uses .htaccess files, you should change the AllowOverride None option to AllowOverride All. Find out how to move the .htaccess file content to the main server configuration file.

  • Create and edit the /opt/bitnami/apache2/conf/vhosts/myapp-https-vhost.conf file and add the configuration block shown below:
  <VirtualHost 127.0.0.1:443 _default_:443>
    ServerAlias *
    DocumentRoot /opt/bitnami/myapp
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/bitnami/certs/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/bitnami/certs/server.key"
    <Directory "/opt/bitnami/myapp">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

I deleted these files and it is working fine again. Was there something wrong that I was doing? Kindly support.

Hello @huzanforbes,

In the bnsupport code you shared, I’m only seeing the required configuration for one of your apps, the one at /opt/bitnami/anugrah/, I understand that you have other folders containing the files to be served for your other sites? You would need a vhost configuration for each of your sites.

I have checked again a couple of your sites and they are up and running so it seems you were able to debug this. Did you manage to configure them using vhosts or were you still encountering issues with them?

Regards,
Francisco de Paz

Yes. I would require for each of my websites.

This is because I have deleted the vhosts for anugrah.

Hi @huzanforbes,

If you follow the guide you posted several times, you will have several virtual hosts inside the /opt/bitnami/apache2/conf/vhosts/ folder with the following configuration

  <VirtualHost 127.0.0.1:443 _default_:443>
    ServerAlias *
...

The ServerAlias parameter configures the domain to use to access that app, so if you use *, all domains and IPs will use that virtual host. That means that if you have many ServerAlias *, just the first one will be use to serve the request. For example:

  • If you use yourdomain.com -> it will use the first virtual host it finds. If that virtual host is for anugrah, it’ll serve the anugrah files
  • if you use public_ip -> it will use the first virtual host it finds (the same one that it used before)
  • if you use public_ip/app -> it will use the first virtual host it finds (the same one that it used before)

You have 2 options:

  • Configure different domains for each of your apps
  • or you can configure new aliases to access the apps using subdirectories (domain/app1, domain/app2, …). To do so, you will need to edit remove the new files you created under the vhosts folder and edit the default virtual host (/opt/bitnami/apache/conf/bitnami/bitnami.conf) and add the following code for each of your apps
Alias /myapp/ "/opt/bitnami/myapp"
Alias /myapp "/opt/bitnami/myapp/"
<Directory "/opt/bitnami/myapp">
  Options -Indexes +FollowSymLinks -MultiViews
  AllowOverride All
  Require all granted
</Directory>

Happy to help!


Was my answer helpful? Click on :heart: