MyAAC
Official WebsiteDemoDownloadGitHub
  • Welcome!
  • Quick Start
  • Troubleshooting
  • Install
    • Linux
      • Configure web server
      • Install with git
      • Serve
    • Windows
      • Uniform Server (recommended)
      • XAMPP
  • Customize
    • Pages
    • Plugins
      • About plugins
      • Compatibility
    • Templates
  • Misc
    • Updating
    • Contributing
    • TODO
    • Supported servers
    • Stripe
Powered by GitBook
On this page
  • Update system first
  • Option 1: apache2
  • 1. Install apache2 with php and all required extensions if you still didn't have.
  • 2. Edit /etc/apache2/sites-enabled/default.conf or 000-default.conf
  • 3. Add following directives between <VirtualHost> block.
  • 4. Restart apache
  • Option 2: nginx
  • 1. Install nginx with php and all required extensions if you still didn't have.
  • 2. Edit /etc/nginx/sites-enabled/default
  • 3. Restart nginx
  1. Install
  2. Linux

Configure web server

PreviousLinuxNextInstall with git

Last updated 25 days ago

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:

  1. and

Update system first

Before we continue, lets ensure we have the latest list of packages for our system:

sudo apt update

Option 1: apache2

1. Install apache2 with php and all required extensions if you still didn't have.

sudo apt install -y apache2 php php-zip php-xml php-mysql php-gd

2. Edit /etc/apache2/sites-enabled/default.conf or 000-default.conf

Set DocumentRoot /var/www/myaac.

DocumentRoot /var/www/myaac

3. Add following directives between <VirtualHost> block.

<Directory "/var/www/myaac">
        AllowOverride all
        Order Deny,Allow
        Allow from all
        Require all granted
</Directory>

With this we say that we allow all users to access our website, and that we allow customisations through .htaccess files.

4. Restart apache

sudo service apache2 restart

Option 2: nginx

1. Install nginx with php and all required extensions if you still didn't have.

sudo apt install -y nginx php-fpm php-zip php-xml php-mysql php-gd

2. Edit /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:

1.

location ~ /system {
    deny all;
}

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)!!!

2.

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

This one is not so dangerous, but without it, you won't be able to see some pages:

3. Restart nginx

Finally, we can restart the nginx to make our changes happen.

sudo service nginx restart

You can take following configuration as an example:

nginx-sample.conf
apache2
nginx