admin管理员组

文章数量:1345448

I have created a new Lightsail LAMP server with a virtual host, which I created by adding a VirtualHost entry to the conf file /opt/bitnami/apache/conf/extra/httpd-vhosts.conf. The virtual host is one level down from htdocs. Here is the entry (edited for anonymity):

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot "/opt/bitnami/apache/htdocs/example"
   ServerName example-test  
   <Directory "/opt/bitnami/apache/htdocs/example">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>

I also un-commented the line in /opt/bitnami/apache/conf/httpd.conf which includes the extra/httpd-vhosts.conf file. All I have in htdocs/example is the default index.html page which i moved from the htdocs folder. I have also used /opt/bitnami/bncert-tool to generate an SSL certificate.

The problem is, when I use the browser to display the startup page, i get an index.

Things I've tried:

  • changing the options line to Options -Indexes +MultiViews +FollowSymLinks. This didn't change anything.
  • not using the extra/httpd-vhosts.conf file but instead putting everything into the /opt/bitnami/apache/conf/httpd.conf file. This didn't change anything.
  • adding an .htaccess file with giberish in it in the htdocs/example folder. This caused an error, which showed me that it was trying to get to the htdocs/example folder.
  • removing the two example virtual hosts that are in the extra/httpd-vhosts.conf file. This didn't change anything.
  • adding a VirtualHost listening on port 443 instead of 80. This didn't work.

After each change I restarted the server using sudo /opt/bitnami/ctlscript.sh restart

I've spent hours and hours on this. I have looked at many similar problems reported here, but none of the solutions have worked. I have double- and triple-checked spellings, they all look good.

本文标签: amazon web serviceswhy is apache bitnami config not handling virtual hosts correctlyStack Overflow