
DocumentRoot의 기본값은 Apache 서버의 설치 폴더 내의 `htdocs` 폴더입니다. 예를 들어, Apache 서버가 `/usr/local/apache2` 폴더에 설치되어 있다면, DocumentRoot의 기본값은 `/usr/local/apache2/htdocs` 폴더입니다.
Apache 서버에서 DocumentRoot를 변경하는 방법은 다음과 같습니다.
1. Apache 서버의 구성 파일인 `httpd.conf` 또는 `apache2.conf`를 열어줍니다. 일반적으로 이 파일은 `/etc/apache2` 폴더 내에 있습니다.
2. `DocumentRoot` 지시문을 찾고, 변경하고 싶은 경로로 수정합니다.
3. Apache 서버를 재시작하여 변경된 DocumentRoot를 적용합니다. 일반적으로 `service apache2 restart` 또는 `sudo systemctl restart apache2` 명령어를 사용합니다.
예를 들어, DocumentRoot를 `/var/www/html` 폴더로 변경하고 싶다면, `httpd.conf` 파일을 열어 `DocumentRoot` 지시문을 다음과 같이 수정합니다.
#hostingforum.kr
DocumentRoot /var/www/html
이러한 변경을 적용하려면 Apache 서버를 재시작해야 합니다.
2025-04-10 20:28