简体   繁体   English

如何更改 AWS Lamp apache 根目录?

[英]How to change AWS Lamp apache root directory?

I am using AWS Lamp apache service.我正在使用AWS Lamp apache服务。 Here htdocs folder is the default root directory.这里的htdocs文件夹是默认的根目录。 I have a folder named my-folder inside htdocs .我在htdocs中有一个名为my-folder

htdocs
  my-folder

I want to set my-folder as a root directory.我想将my-folder设置为根目录。

But How?但是如何?

I have edited /opt/bitnami/apache/conf/httpd.conf Here are the edited codes in httpd.conf file.我已编辑/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>

But it doesn't work!但它不起作用!

Please correct me.请纠正我。

Problem Solved问题解决了

I just modified /opt/bitnami/apache/conf/vhosts/00_status-vhost.conf as below.我刚刚修改/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>

and it's working!它正在工作!

Documention provided by AWS Create A Virtual Host For A Custom Application AWS提供的文档为自定义应用程序创建虚拟主机

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM