# Apache Server (LAMP)

#### **Linux, Apache, MySQL, PHP (LAMP) Stack**

{% hint style="warning" %}
Note:

1  You can set up Taxido on different types of clean Ubuntu servers using VPS, including Digital Ocean Droplets, Amazon Lightsail, AWS, Google Cloud Virtual Private Server, Azure Ubuntu Virtual Private Server, and more.

2  If you plan to utilize the scripts (Taxido\_laravel) on a single server as outlined in this tutorial, we suggest setting up a new Ubuntu-based server with a minimum of 2+ CPU cores and 2GB+ of memory for an efficient and smooth operation.
{% endhint %}

### **Introduction**

A "**LAMP"** stack is a bundle of open-source software commonly used to host dynamic websites and web apps written in PHP. It includes Linux for the operating system, Apache for the web server, MySQL for the database, and PHP for processing dynamic content.

#### **Install LAMP**

**Step 1: Installing Apache and Updating package**

&#x20;Start by updating the package manager cache. If this is the first time you’re using sudo within this session, you’ll be prompted to provide your user’s password to confirm you have the right privileges to manage system packages with apt:

```html
sudo apt update
```

Then, install Apache with:

```html
sudo apt install apache2
```

&#x20;You’ll be prompted to confirm Apache’s installation. Confirm by pressing Y, then ENTER.

<figure><img src="https://docs.pixelstrap.net/laravel/taxido/assets/images/vps/lamp/lamp-03.png" alt=""><figcaption></figcaption></figure>

Select unnattended-upgrades options by pressing space-bar, and then press Tab button to select OK button, please Enter button.

**Step 2: Setup Firewall to allow HTTP**

Once the installation is finished, you’ll need to adjust your firewall settings to allow HTTP traffic.

Ubuntu’s default firewall configuration tool is called Uncomplicated Firewall (UFW). It has different application profiles that you can leverage.

To list all currently available UFW application profiles, execute this command:

```html
sudo ufw app list
```

<div align="left"><figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2F8NFwqePRDgOIH9k7OyOx%2Fimage.png?alt=media&#x26;token=e91d47c4-0adf-4ae9-9acb-8b7c82b49df8" alt=""><figcaption></figcaption></figure></div>

To only allow traffic on port 80, use the Apache profile

```html
sudo ufw allow in "Apache"
```

Enable firewall and verify the change with:

```html
sudo ufw enable
```

After execute this command it will ask proceed this operation with existing ssh connection? Enter "y" and continue it.

```html
sudo ufw status
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2Fbr7iZ61JPUqXFxHIKLKW%2Fimage.png?alt=media&#x26;token=72645817-3f19-423f-ab59-0952c099ab11" alt=""><figcaption></figcaption></figure>

**Step 3: Find your Server’s Public IP Address**

If you do not know what your server’s public IP address is, there are a number of ways to find it. You can following this command to find your public server ip address.

```html
ip addr show ens3 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FpagfZXhYtVv1rBooglR8%2Fimage.png?alt=media&#x26;token=dcf7ebab-0072-475a-9a0e-6df978496c2d" alt=""><figcaption></figcaption></figure>

Open this IP address in your browser, If you can view this page, your web server is correctly installed and accessible through your firewall.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2F8Si31EEN1jwEq1IGLKyi%2Fimage.png?alt=media&#x26;token=e43cd34e-3207-45b6-89b0-c009f9f78b7d" alt=""><figcaption></figcaption></figure>

**Step 4: Installing PHP**

To install php and mysql, run the following command:

```html
sudo apt install php libapache2-mod-php php-mysql
```

Press "Y | y" to continue this process and Once the installation is finished, run the following command to confirm your PHP version:<br>

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FJneQ1G2NG5x3m0pmG2AH%2Fimage.png?alt=media&#x26;token=8052c4af-1030-4371-8b62-88febe5e19e1" alt=""><figcaption></figcaption></figure>

To install php extensions, run the following command:

```html
sudo apt install php-mbstring php-xml php-bcmath php-simplexml php-intl php-gd php-curl php-zip php-gmp
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FQBeinWswNmYcKfshphJd%2Fimage.png?alt=media&#x26;token=80328207-1db5-475c-93d2-08c7dbb7bf61" alt=""><figcaption></figcaption></figure>

Once the installation is finished, you can run the following command to confirm your PHP version:

```html
php -v
```

<div align="left"><figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FOVbBIXedtAKdjQjDEXUo%2Fimage.png?alt=media&#x26;token=a4713fbd-b002-4a79-857b-a974ef86c33c" alt=""><figcaption></figcaption></figure></div>

**Step 5: Installing Composer**

Update the local repository lists by entering the following in a command line.

```html
sudo apt update
```

The following curl command to have the latest Composer version.

```html
curl -sS https://getcomposer.org/installer | php

```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FlHfOaGLWU9ouJvlFpsfT%2Fimage.png?alt=media&#x26;token=58108cb5-7445-448a-86bd-e28ca2e9e823" alt=""><figcaption></figcaption></figure>

This will download and execute an installer script that will download the latest version of Composer and install it in your current working directory.

You’ll need to move the composer to use Composer globally and run the Composer commands from any where.phar file from your current directory to a location included in your PATH environment variable.

The most common location is the /usr/local/bin directory. So use the following command to initiate the move:

```html
sudo mv composer.phar /usr/local/bin/composer
```

To test composer installation, run:

```html
composer
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FdohxeofOcAJGQLZvWpft%2Fimage.png?alt=media&#x26;token=016e37eb-e533-449f-b0b8-22d71a210cf9" alt=""><figcaption></figcaption></figure>

**Step 6: Install MySQL Database & User**

Now that you have a web server up and running, you need to install the database system to be able to store and manage data for your site. MySQL is a popular database management system used within PHP environments.

```html
sudo apt install mysql-server
```

When prompted, confirm installation by typing Y, and then ENTER.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FCjBZv0Cv0SigG0oxPXcy%2Fimage.png?alt=media&#x26;token=40e36c1a-cd18-4588-bf10-474ba7d5ecd2" alt=""><figcaption></figcaption></figure>

Start the interactive script by running:

```html
sudo mysql_secure_installation
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FAhYZyqbJNbManR7sTc6t%2Fimage.png?alt=media&#x26;token=70529415-374a-41fc-a75b-70a4cb69b973" alt=""><figcaption></figcaption></figure>

&#x20;When prompted, confirm installation by typing Y, and then ENTER.

If you answer “yes”, you’ll be asked to select a level of password validation.

{% hint style="warning" %}
If you choose the strongest level as 2, you'll encounter errors when trying to set a password that doesn't include numbers, uppercase and lowercase letters, and special characters.
{% endhint %}

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2F6a3MmcS7nXNcQ3UGO3Ah%2Fimage.png?alt=media&#x26;token=118958b2-80a0-4633-a673-03fe1f5fce5d" alt=""><figcaption></figcaption></figure>

We have choose the medium level as 1, after choose password validation level. It will ask some confirmation you can choose as your need.

<figure><img src="https://docs.pixelstrap.net/laravel/taxido/assets/images/vps/lamp/lamp-17.png" alt=""><figcaption></figcaption></figure>

&#x20;When you’re finished, test whether you’re able to log in to the MySQL console by typing:

```html
sudo mysql
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FqLlTFHXKmJoq3CpXVDyg%2Fimage.png?alt=media&#x26;token=4c79692c-ffab-43bd-aa0d-7c0297fb8704" alt=""><figcaption></figcaption></figure>

&#x20;Once you are entering mysql panel, following some command for create database and database user to store data.

```html
CREATE DATABASE Taxido_laravel;
```

```html
CREATE USER 'Taxido'@'%' IDENTIFIED WITH mysql_native_password BY 'Password@123';
```

```html
GRANT ALL ON Taxido_laravel.* TO 'Taxido'@'%';
```

```html
FLUSH PRIVILEGES;
```

To exit the MySQL console, type:

```html
exit
```

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FYsYnbNTXW6cw0YZInagO%2Fimage.png?alt=media&#x26;token=085bfcd0-6aca-4750-81a4-76b51be04d7f" alt=""><figcaption></figcaption></figure>

**Step 7: Change permission for the www folder**

```html
sudo chown -R $USER:$USER /var/www;
```

**Step 8: Upload Taxido Laravel to Server**

&#x20;To make a new directory on your website, just type this command:

```html
mkdir /var/www/Taxido
```

* Download the Taxido-laravel-react\_native-package zip file from CodeCanyon and unzip it on your computer.
* Inside the unzipped folder, find Taxido\_laravel folder
* Upload the Taxido\_laravel folder to the server at the path /var/www/Taxido/.

**Step 9: Install zip and extract it**

following this command to install zip and extract it.

```html
sudo apt install zip unzip

```

**10. Create Virtual Host File**

```html
nano /etc/apache2/sites-available/your_domain.conf
```

Add Following Code in Virtual Host File

```html


                            <VirtualHost *:80>
                                ServerName www.your-domain.com
                                ServerAdmin contact@your-domain.com
                                DocumentRoot /var/www/Taxido_laravel/public
                                ErrorLog ${APACHE_LOG_DIR}/error.log
                                CustomLog ${APACHE_LOG_DIR}/access.log combined
                                <Directory /var/www/Taxido_laravel/public/>
                                    Options -Indexes +FollowSymLinks
                                    AllowOverride All
                                    Require all granted
                                </Directory>
                            </VirtualHost>
                        
```

Include the following Nginx configuration in your edited file:

&#x20;Restart Apache2

```html
service apache2 restart
```

### **Installing Taxido Laravel**

**1. Initially, navigate to the Taxido\_laravel directory, and change the file named .env.example as .env.**

```html
cd /var/www/Taxido/Taxido_laravel
```

&#x20;Add values to the below keys in the **.env** file using nano command

```html
nano .env
```

```html
cp .env.example .env
```

If you're running your Laravel project on your own computer (localhost), make sure to use localhost with current running port and put in APP\_URL. as a given example below

If you want to install on live server, you need to add your live server Taxido\_laravel url like a APP\_URL=<https://your-domain.com>.

```html
APP_URL=http://localhost:8000
                        DB_DATABASE=database_name
                        DB_USERNAME=database_username
                        DB_PASSWORD=database_password
```

{% hint style="warning" %}
Note: Make sure to set the APP\_URL correctly. If you don't, features like uploading, downloading, and showing images won't work properly. Be sure to double-check and make sure everything is set up correctly.
{% endhint %}

**2. Install Required Dependencies:**

&#x20;In the Taxido\_laravel folder, run following command in the terminal to install the required dependencies.

```html
composer install 
```

**3. Generate Laravel APP KEY:**

Once the necessary dependencies are successfully installed, run following command to generate laravel app key.

```html
php artisan key:generate
```

**4. Installation of Taxido:**

{% hint style="info" %}
**Note:** If you've previously run following command or migrated tables, be aware of the fact that it will erase all of your data.
{% endhint %}

Then, run following command to install Taxido database table.

```html
php artisan web:install
```

During the installation, you'll be asked two questions:

1\. Do you want to continue with the installation? If you say yes, Taxido will continue to install.

2\. Do you want to import in sample data? If you say yes, the sample data will be imported. If you say no, the installation will go ahead without adding any sample data.

**5. Link Storage folder to Public folder:**

&#x20;Then, run following command to store and display images correctly.

```html
php artisan storage:link
```

**6. Run Taxido Laravel :**

Once you've finished all the previous steps, you can run the Taxido Laravel by adding following command.

```html
php artisan serve
```

When you start your Taxido Laravel project, it typically runs on the default port, you can access it by opening [127.0.0.1:8000 ](http://127.0.0.1:8000/)in your web browser.<br>

**7. Verify Taxido Purchase Code:**

&#x20;Before using the Taxido Laravel, it's important to verify your Envato purchase code.

Enter in your Envato username and the Taxido purchase code and click next button.

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FLIhK2RifR89yBFnz7zXZ%2Fimage.png?alt=media&#x26;token=caccd74d-70ce-461e-a884-17a46c546a26" alt=""><figcaption></figcaption></figure>

If you don't know where to find your purchase code, click here: [Where Is My Purchase Code?](https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code)&#x20;

{% hint style="warning" %}
**Note:** Once a license is verified, it can't be used for another project. An envato purchase code can only be verified on one domain at a time.
{% endhint %}

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FS3SQYCnblTNWPrKj0rOX%2Fimage.png?alt=media&#x26;token=46c80174-6d71-48a7-9794-5d94445c138d" alt=""><figcaption></figcaption></figure>

Congratulations, Taxido has been successfully installed and configured in your system!🎉, you can proceed by using the default credentials.

### **Default Credentials**

**Admin Credential:**

&#x20;Url: <https://your-domain.com/admin/login>

&#x20;Email: <admin@example.com>

&#x20;Password: 123456789

**Driver Credential:**

&#x20;Url: <https://your-domain.com/admin/login>

Email: <driver@example.com>

&#x20;Password: driver\@123

**User Landing Page:** [**https://your-domain.com**](https://your-domain.com/)
