F
F
fokin_nikolay19892022-02-12 06:24:59
linux
fokin_nikolay1989, 2022-02-12 06:24:59

How to change DOCUMENT_ROOT in HTTPD?

In Linux, the httpd service is installed
in it, I want to change the home directory /var/www/html to /home/data
when the page is opened, it looks and displays files where index.php itself is located, 620728849179c930303465.png
when I try to change the document_root parameter in the konyagi file,
/etc/httpd/conf/httpd.conf
after restarting the service
/bin/systemctl restart httpd.service
, an error occurs

forbidden you don't have permission to access this resource.

How to change directory?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Yuriev, 2022-02-12
@fokin_nikolay1989

open filemanager.php and see the variable declaration:

// Root path for file manager
$root_path = $_SERVER['DOCUMENT_ROOT'];

you just need to change /home/data to your path :
// Root path for file manager
$root_path = '/home/data';

And then you will probably have to resolve possible conflicts with the rights to files and directories.
The question is not about httpd at all, but about php
PS: https://github.com/alexantr/filemanager - judging by the screen, the author is trying to start this "file manager"

V
Victor Taran, 2022-02-14
@shambler81

HTTPD by default supports html markup PHP is interpreted
either by a module to it or by a separate daemon, in general you need to select a php interpreter and connect it . Install the aapanel or vestacp admin panel, they are installed in 1 click
aapanel73.png
BtiwHmQCQAAqh65.png:large

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question