Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

I made mistake - sudo chown /var/www/html/htaccess.txt www-data:www-data [closed]

Writer Sophia Terry

I made mistake when use Chown command. I write

sudo chown /var/www/html/htaccess.txt www-data:www-data

insted of

sudo chown www-data:www-data /var/www/html/htaccess.txt

The answer was -

enter image description here

So - All my stuff from /var/www/html disappeared, and my site

Forbidden
You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at Port 80
3

2 Answers

You need to reset the permissions on /var/www/html back to 0755:

sudo chmod 755 /var/www/html

Explanation: the execute bit in file permissions (x) determines whether the contents of the directory can be enumerated. Turning this bit off (0644) will prevent the web server from being able to see what is in the directory.

The 2 commands ABOVE the one you quoted in the questions messed your system up.

These 2 fix permissions for directories and files:

sudo find /var/www/html -type d -exec chmod 755 {} \;
sudo find /var/www/html -type f -exec chmod 644 {} \;

Your

sudo chmod 644 /var/www/html

removed execute permissions for your directories.

4