Answer the question
In order to leave comments, you need to log in
How to specify a root for a project outside the apache2 global root?
mkdir /home/test/projects/Site2
nano /home/test/projects/Site2/index.html
sudo chmod -R 755 /home/test/projects
sudo chown -R test:test /home/test/projects
sudo cp -P /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/Site2.conf
sudo nano /etc/apache2/sites-available/Site2.conf
<VirtualHost *:8080>
ServerName Site2.local
ServerAdmin [email protected]
DocumentRoot /home/test/projects/Site2
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo nano /etc/apache2/ports.conf
Listen 80
Listen 8080
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /home/test/projects/Site2>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
sudo a2ensite Site2.conf
sudo service apache2 restart
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question