如何更改AWS Lamp Apache根目录?

kr98yfug  于 2022-11-16  发布在  Apache
关注(0)|答案(1)|浏览(137)

我正在使用AWS Lamp apache服务。这里htdocs文件夹是默认的根目录。我在htdocs中有一个名为my-folder的文件夹。

htdocs
  my-folder

我想将my-folder设置为根目录。
"但是怎么做“
我编辑了/opt/bitnami/apache/conf/httpd.conf这里是httpd.conf文件中的编辑代码。

# DocumentRoot "/opt/bitnami/apache/htdocs"
# <Directory "/opt/bitnami/apache/htdocs">

DocumentRoot "/opt/bitnami/apache/htdocs/my-folder"
<Directory "/opt/bitnami/apache/htdocs/my-folder">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

"但这没用"

请纠正我

kiayqfof

kiayqfof1#

问题已解决

我只是修改了/opt/bitnami/apache/conf/vhosts/00_status-vhost.conf如下。

<VirtualHost 127.0.0.1:80 _default_:80>
    ServerAlias *
    DocumentRoot /opt/bitnami/apache/htdocs/my-folder
    <Directory "/opt/bitnami/apache/htdocs/my-folder">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

   #for https
  <VirtualHost 127.0.0.1:443 _default_:443>
    ServerAlias *
    DocumentRoot /opt/bitnami/apache/htdocs/my-folder
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/bitnami/certs/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/bitnami/certs/server.key"
   <Directory "/opt/bitnami/apache/htdocs/my-folder">
      Options -Indexes +FollowSymLinks -MultiViews
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

"而且成功了"
文档由AWSCreate A Virtual Host For A Custom Application提供

相关问题