I am using AWS Lamp apache
service. Here htdocs
folder is the default root directory. I have a folder named my-folder
inside htdocs
.
htdocs
my-folder
I want to set my-folder
as a root directory.
But How?
I have edited /opt/bitnami/apache/conf/httpd.conf
Here are the edited codes in httpd.conf
file.
# 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.
<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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.