Problem
I need to properly configure my httpd.conf
on apache2 server to change it from one project (http://localhost/) to three projects. Would you be so kind and check the following codes and descriptions and help me to make a correct reconfiguration?
Current one project directory model:
Library
+++ WebServer
+++ +++ Documents
+++ +++ database
Desired three-project directory model:
Library
+++ WebServer
+++ +++ project_1
+++ +++ +++ public_html
+++ +++ +++ database
+++ +++ project_2
+++ +++ +++ public_html
+++ +++ +++ database
+++ +++ project_3
+++ +++ +++ public_html
+++ +++ +++ database
Accessibility
One project:
Three projects:
Relevant portion of httpd.conf
for one project (currently works for one project):
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
Suggested portion of httpd.conf
for multiple projects:
<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_1/public_html"
ServerName localhost
</VirtualHost>
<Directory "/Library/WebServer/project_1/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_2/public_html"
ServerName localhost
</VirtualHost>
<Directory "/Library/WebServer/project_2/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
<VirtualHost>
ServerAdmin localhost
DocumentRoot "/Library/WebServer/project_3/public_html"
ServerName localhost
</VirtualHost>
<Directory "/Library/WebServer/project_3/public_html">
Options Indexes FollowSymLinks MultiViews
MultiviewsMatch Any
AllowOverride All
Require all granted
</Directory>
Server version: Apache/2.4.28 (Unix)