你应该在/ etc / apache2 / enabled-sites / 000-default中使用哪些设置来使内容在给定的文件夹中只能执行和读取?
我有以下/ etc / apache2 / sites-enabled / 000-default
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www // I put here /var/www/codes unsuccessfully // I get this error when restarting Apache // waiting apache2: Could not reliably determine // the server's fully qualified domain name, // using 127.0.1.1 for ServerName --- cut ---- <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny,allow allow from all // not sure about this </Directory> --- cut ---
我的权限在/ var / www / codes
4 drwxr-sr-x 3 root www 4096 2009-08-21 00:16 forms 4 drwxr-sr-x 7 root www 4096 2009-08-21 00:16 handlers 8 -rw-r--r-- 1 root www 5403 2009-08-22 00:43 index.php
如果你只希望人们能够访问Apache,没有别的,那么你需要使用防火墙。 你可以使用ufw – 不复杂的防火墙 ,只允许80端口。
但是,如果你在linux上没有防火墙,这并不是什么大问题,因为默认情况下是非常安全的。