Configure web server
Last updated
Last updated
First we will configure the web server, so it will serve our website.
There are many possible options to use, but in this tutorial we will just cover the two most populars:
and
Before we continue, lets ensure we have the latest list of packages for our system:
/etc/apache2/sites-enabled/default.conf
or 000-default.conf
Set DocumentRoot
/var/www/myaac
.
<VirtualHost>
block.With this we say that we allow all users to access our website, and that we allow customisations through .htaccess files.
/etc/nginx/sites-enabled/default
Don't copy it 1:1, but take it as example, how your config might look like.
Replace server_name with your domain, and adjust fastcgi_pass to your PHP version.
The most important parts of this config, are those two:
This one blocks access to system folder, where logs and source code is stored: If you don't add it, anyone will be able to read your PayPal logs (for example)!!!
This one is not so dangerous, but without it, you won't be able to see some pages:
Finally, we can restart the nginx to make our changes happen.
You can take following configuration as an example: