우분투 앰프 금지됨

우분투 앰프 금지됨

localhost에서 내 사이트에 액세스하려고 하는데 다음과 같은 메시지가 표시됩니다.

"금지된

이 서버의 /index.html에 액세스할 수 있는 권한이 없습니다. 로컬 호스트 포트 80의 Apache/2.2.14(Ubuntu) 서버"

내 error.log는 다음과 같이 말합니다.

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 08:51:51 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 08:51:57 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:51:57 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:52:00 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:52:17 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:54:15 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:54:17 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:55:19 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:55:23 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 08:56:40 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:00:10 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:02:05 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:02:07 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:05:04 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:06:50 2010] [notice] SIGHUP received.  Attempting to restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 09:06:50 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 09:06:57 2010] [crit] [client 127.0.0.1] (13)Permission denied: /var/www/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 20 09:08:46 2010] [error] [client 127.0.0.1] (13)Permission denied: file permissions deny server access: /var/www/index.html
[Sun Jun 20 09:08:59 2010] [error] [client 127.0.0.1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Sun Jun 20 09:08:59 2010] [error] [client 127.0.0.1] PHP Fatal error:  Unknown: Failed opening required '/var/www/test.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
[Sun Jun 20 09:09:47 2010] [error] [client 127.0.0.1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Sun Jun 20 09:09:47 2010] [error] [client 127.0.0.1] PHP Fatal error:  Unknown: Failed opening required '/var/www/test.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
[Sun Jun 20 09:09:54 2010] [notice] SIGHUP received.  Attempting to restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 09:09:54 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 09:09:55 2010] [error] [client 127.0.0.1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Sun Jun 20 09:09:55 2010] [error] [client 127.0.0.1] PHP Fatal error:  Unknown: Failed opening required '/var/www/test.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
[Sun Jun 20 09:15:28 2010] [notice] Graceful restart requested, doing restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 09:15:28 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 09:16:51 2010] [notice] Graceful restart requested, doing restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 09:16:51 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 09:16:52 2010] [notice] Graceful restart requested, doing restart
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Sun Jun 20 09:16:52 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations
[Sun Jun 20 09:17:04 2010] [error] [client 127.0.0.1] (13)Permission denied: file permissions deny server access: /var/www/index.html
[Sun Jun 20 09:17:07 2010] [error] [client 127.0.0.1] (13)Permission denied: cannot read directory for multi: /var/www/
[Sun Jun 20 09:17:15 2010] [error] [client 127.0.0.1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Sun Jun 20 09:17:15 2010] [error] [client 127.0.0.1] PHP Fatal error:  Unknown: Failed opening required '/var/www/test.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0
[Sun Jun 20 09:18:38 2010] [error] [client 127.0.0.1] (13)Permission denied: file permissions deny server access: /var/www/index.html

myusername:myusername /var 및 /var/www를 chown하고 711 /var 및 751 /var/www로 chmoded하고 /var에서 재귀 chowning을 시도하고 /var/www에서 재귀 chmoding을 시도했지만 여전히 아무 것도 없습니다.

내 사이트에 어떻게 접속하나요?

업데이트:

var 및 www는 www-data:deltrem으로 chowned이고 var는 chmoded 711, www 751이지만 여전히 작동하지 않습니다. :-(

var에 대한 재귀적 chowning(다행히도)이 작동하지 않은 것 같습니다.

답변1

/varchmod 755 및 root:root를 유지해야 합니다. /var를 변경할 이유가 없습니다.

을 위한/var/www노력하다:

chown -R myusername:www-data /var/www
chmod -R 755 /var/www

파일을 생성할 때 이 권한을 유지해야 합니다. 그리고 apache2에서 작성해야 하는 파일의 일부 파일을 775로 변경해야 할 수도 있습니다.

중요한:이 방법을 사용하면 귀하의 사용자 계정에 접근할 수 있는 사람은 누구나 웹사이트 파일을 수정할 수 있습니다.

답변2

/var/www는 Apache 사용자가 읽을 수 있어야 합니다. 내 Ubuntu 9.04에서 Apache는 www-data.

/var의 모든 소유권과 권한을 변경하는 것은 좋은 일이 아니므로 원래대로 되돌려 놓아야 합니다.

답변3

Apache는 어떤 사용자로 실행됩니까? 일반적으로 'httpd' 또는 'apache'(iirc) 사용자로 실행되므로 해당 사용자에게 /var/www를 다시 chowning해 보세요. chown -r /var를 사용하면 안 됩니다. 거기에는 읽고 쓰고 싶은 다른 것들이 곧 여러분에게 슬픔을 안겨줄 것입니다.

관련 정보