H
H
Herman Martin2019-12-23 14:46:28
Apache HTTP Server
Herman Martin, 2019-12-23 14:46:28

How to change apache document_root from /var/www/html to /var/www/test/html/public?

There is a vps with apache and php on it.
from various articles tried different solutions but didn't work in the end, can't go beyond the default config.
added my folder to /var/www/, created a new config in /etc/apache/sites-available/*.conf, deactivated the old config from 000-*-.conf, activated the new one (a2dissite 000-default.conf, a2ensite example. com.conf), checked for errors and rebooted (apache2ctl configtest, systemctl restart apache2 )
How can I change paths?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Herman Martin, 2019-12-23
@dklight

Solution - added to /etc/apache2/apache2.conf a line with the DocumentRoot in the desired path
If there is a solution without editing this config, please share

V
Viktor Taran, 2019-12-23
@shambler81

do you need to change the docuement root for the secondary site or for the default?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question