Ravindra BagaleCourses & study guides

Chapter 7: Static Website Hosting (3 OSes × 2 Web Servers)

7.5 Step 3 (common): copy files and set permissions

sudo mkdir -p /var/www/mysite
sudo cp -r ~/mysite/* /var/www/mysite/
sudo find /var/www/mysite -type d -exec chmod 755 {} \;
sudo find /var/www/mysite -type f -exec chmod 644 {} \;
ls -la /var/www/mysite

Now follow the section for your combination.

Ravindra Bagale's Tip

Before you blame the web server, test from inside the server with curl -I http://localhost. If that works but the browser doesn't, the problem is outside (security group, firewall, IP, https). If it fails inside too, check the service and error log. This one test cuts your troubleshooting time in half.