# Installation - Cloud VPS

Follow the below steps carefully to install the QwikTest script in the cloud server. Your server must have PHP 7.4, MySQL 5.7.24 or higher, and Apache/NGINX.

1. Configure a domain to your server public IP address
2. Create a database
3. Upload script downloaded from CodeCanyon to the server using WinSCP.
4. Installation

See [Important Things to Remember](https://nearchip.gitbook.io/qwiktest/installation-shared-hosting#important-things-to-remember) before installation.

The following are some useful links for configuring the Laravel application in cloud servers.

* How To Install Linux, Nginx, MySQL, PHP (LEMP Stack) on Ubuntu 20.04 <https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-20-04>
* How To Install and Configure Laravel with Nginx on Ubuntu 20.04 (LEMP) <https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-laravel-with-nginx-on-ubuntu-20-04>

#### Our Demo is powered by Digital Ocean VPS.

[![DigitalOcean Referral Badge](https://web-platforms.sfo2.cdn.digitaloceanspaces.com/WWW/Badge%201.svg)](https://www.digitalocean.com/?refcode=899d01009f04\&utm_campaign=Referral_Invite\&utm_medium=Referral_Program\&utm_source=badge)

### Installation Process

#### Step 1

Create a domain or subdomain and set **A** record to the server IP address in your DNS editor.

#### Step 2

Login to your putty using SSH client, create a database and assign all privileges to the database user.

```
$ myql -u root -p

mysql > CREATE DATABASE qwiktest;

mysql > CREATE USER 'user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

mysql > GRANT ALL ON qwiktest.* TO 'qwiktest'@'%';
```

#### Step 3

* Download the zip file from CodeCanyon.
* Extract the zip file from your system.
* Navigate to **`Fresh Installation`** folder.
* Select the  **upload\_this.zip** file and upload it to the `/var/www/app_folder` directory of your server using WinSCP.
* Extract the contents of the uploaded zip file to the same directory.

```
cd /var/www/your_folder
sudo chmod a+rwx /var/www/your_folder

unzip upload_this.zip

rm -r upload_this.zip
```

* Give 775 permission to the following directories.
  * storage/framework
  * storage/logs
  * bootstrap/cache

```
chown -R $USER:www-data storage
chown -R $USER:www-data bootstrap/cache

chmod -R 775 storage
chmod -R 775 bootstrap/cache
```

Give 644 permission to the .env file.

```
chmod 644 .env
chown $USER:www-data .env
```

#### Step 4

The application files are now in order, but we still need to configure Nginx to serve the content. To do this, we’ll create a new virtual host configuration file at `/etc/nginx/sites-available`.

```
nano /etc/nginx/sites-available/yourdomain
```

&#x20;The following configuration file contains the recommended settings for Laravel applications on Nginx:  Copy this content to your`/etc/nginx/sites-available/yourdomain`file and adjust the directory path and other values to align with your own configuration. Save and close the file when you’re done editing.

```
server {
    listen 80;
    server_name server_domain_or_IP;
    root /var/www/your_folder/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
```

To activate the new virtual host configuration file, create a symbolic link to `yourdomain` in sites-enabled.

```
sudo ln -s /etc/nginx/sites-available/yourdomain /etc/nginx/sites-enabled/

sudo nginx -t

sudo systemctl reload nginx
```

#### Step 5

Then navigate to **yourdomain.com/install** on the browser and follow the instructions.

![](https://3791649983-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mb1ofvkThROm6pwq71N%2F-Mf3jAbqI0dw1Js-Ky6C%2F-Mf3k2RtC-o_5FvsYH69%2Finstallation-screen.jpg?alt=media\&token=588681ee-e8a0-44c0-a826-b14c071b0739)

#### Final Step

Finally, when you are on the installation success screen, don't close the browser window directly. Instead, you must hit the **Click here to exit** the button to complete the installation.&#x20;

![](https://3791649983-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mb1ofvkThROm6pwq71N%2F-Mf3jAbqI0dw1Js-Ky6C%2F-Mf3kP_ja5e7RkPbtPhL%2Fsuccess-screen.jpg?alt=media\&token=ee5876b1-9852-4cd3-b9cf-d248290be9be)

{% hint style="danger" %}
If the installation fails due to server issues, fix them and:&#x20;

1. Delete all the tables in the existing database or make a new database.
2. Delete the **storage/installed** file of the app in the sever
3. Replace the .env file on the server with the .env file from the downloaded script.
4. Finally, start the installation again by visiting **yourdomain.com/install**.
   {% endhint %}

### Installation Support

{% hint style="info" %}
Please raise a ticket on our support portal if you have any issues with the installation within the QwikTest application.
{% endhint %}

{% hint style="danger" %}
We cannot provide fixes that are related to your web hosting or server environment. Therefore, if your hosting or server environment is different than what is listed in the above section, you’ll need to determine if it will work before purchasing. Server setup and configuration are not in our scope of support.
{% endhint %}
