Install Vanilla Forum on Ubuntu 18.04

0
160

Vanilla is an opensoure discussion forum  the installation is also very easy. please follow the steps to get an successful vanilla forum installation. maybe your  need some per-installed packages  to avoide any issues

Requirements

PHP version 7.0 or newer.
PHP extensions mbstring, cURL, GD, and PDO, MySQLi, OpenSSL.
MySQL version 5.6 or newer (or Percona/MariaDB equivalent).
Web server software (Nginx, Apache …).
SSL encryption.

Hosts :

127.0.0.1 localhost
127.0.1.1 mohamed-pc
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.2.30 vanilla.com
~

System Info

osradar@ubuntu-bionic:~$ uname -a 
Linux ubuntu-bionic 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Network

osradar@ubuntu-bionic:~$ ip a 

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:fc:ab:43:0a:1b brd ff:ff:ff:ff:ff:ff
inet 192.168.0.101/24 brd 192.168.0.255 scope global dynamic enp0s3
valid_lft 6342sec preferred_lft 6342sec
inet6 fe80::fc:abff:fe43:a1b/64 scope link 
valid_lft forever preferred_lft forever
osradar@ubuntu-bionic:~$

 

Configure Time zone

osradar@ubuntu-bionic:~$ sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/Amsterdam'
Local time is now: Wed Mar 13 19:30:22 CET 2019.
Universal Time is now: Wed Mar 13 18:30:22 UTC 2019.

 

Update your system to the the last level

sudo apt update && sudo apt upgrade -y

1-Install PHP and Needed  Extensions

The last  supported PHP for  Ubuntu 18.04 is the 7.2 version

Please add this  to your source list :

deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main
deb-src http://ppa.launchpad.net/ondrej/php/ubuntu bionic main

 

Install PHP

The last step to install LAMP on Ubuntu 18.04 is to install the PHP preprocessor.

PHP adds server-side web page processing that enables dynamic web pages.

Run the following command to install PHP.

apt install php php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-curl php7.2-gd php7.2-mysql

Next, we need to tell Apache to serve PHP pages first.

Open /etc/apache2/mods-enabled/dir.conf file and change it to have index.php listed first.

<IfModule mod_dir.c>

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>

Finally, we need to restart the Apache Web Server.

systemctl restart apache2

 

Show InstalledPHP version and php Modules

With this command you can do it

#php -m [PHP Modules] calendar Core ctype curl ....... 
#php --version PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, 
Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

2-Install MariaDB Server

You need a database Server, can be Mariadb server or Mysql.

To install latest stable  mariadbserver and mariadb client you can do it on this way.

please  edit /etc/apt/sources.list.d/mariadb.list

and add   on it

# http://downloads.mariadb.org/mariadb/repositories/
deb [arch=amd64] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu bionic main
deb-src http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.4/ubuntu bionic main

Please  update   the  repo lists

#sudo apt -get  update

Now  install  the packages

 

osradar@ubuntu-bionic:~$ sudo apt-get install mariadb-server mariadb-client 
Reading package lists... Done
Building dependency tree 
Reading state information... Done

 

Set Root Mysql password : 

How to set root mysql password ?

osradar@ubuntu-bionic:~$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y 
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
osradar@ubuntu-bionic:~$ 



Enable MariaDB to start on boot and then start the service:

sudo systemctl enable mariadb
sudo systemctl restart mariadb

Connect and Create Database and database user related.

Connect as root mysql user  predefined before :

root@ubuntu-server-18:/var/log# mysql  -u root -p 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 57
Server version: 10.4.3-MariaDB-1:10.4.3+maria~bionic-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database vanilla;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> CREATE USER 'vanillauser'@'localhost' IDENTIFIED BY 'vanillapass';
Query OK, 0 rows affected (0.003 sec)

MariaDB [(none)]> GRANT ALL ON vanilla.* TO 'vanillauser'@'localhost';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> FLUSH PRIVILLEGES;

 

3-Install Apache Server

Lets Install The latest apache Servers from Ubuntu 18 repo

#apt install apache2

 

3-1-Enable and Start  apache2

root@ubuntu-server-18:~# systemctl enable apache2
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
root@ubuntu-server-18:~# systemctl start apache2
root@ubuntu-server-18:~#

 

Check apache2  with  http://IP

How to Create VirtualHost in Ubuntu 18 ?

to make Apache serving contents, it’s necessary to create a virtual host file with the correct directives. Instead of modifying the default configuration file located at /etc/apache2/sites-available/000-default.conf directly,
let’s make a new Virtualhost at /etc/apache2/sites-available/example.com.conf:

sudo vi /etc/apache2/sites-available/vanilla.com.conf

Paste in the following configuration but updated the new directory and domain name:
/etc/apache2/sites-available/vanilla.com.conf

<VirtualHost *:80>
ServerAdmin admin@vanilla.com
ServerName vanilla.com
ServerAlias www.vanilla.com
DocumentRoot /var/www/vanilla.com/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save and exit

Please ensure the directory  are already created

Let’s enable the file with the a2ensite tool:

sudo a2ensite vanilla.com.conf

Disable the default site defined in 000-default.conf:

sudo a2dissite 000-default.conf

Next, let’s test for configuration errors:

sudo apache2ctl configtest

You should see the following output:

Output
Syntax OK

Restart Apache to apply the changes:

Download  Vanilla File to  /var/www/vanilla.com/html

root@ubuntu-server-18:~# cd /var/www/vanilla.com/html/
root@ubuntu-server-18:/var/www/vanilla.com/html# wget https://open.vanillaforums.com/get/vanilla-core-2.8.1,zip
--2019-03-18 21:51:05-- https://open.vanillaforums.com/get/vanilla-core-2.8.1
Resolving open.vanillaforums.com (open.vanillaforums.com)... 2606:4700:7::a29f:804f, 2606:4700:7::a29f:8a4e, 162.159.138.78, ...
Connecting to open.vanillaforums.com (open.vanillaforums.com)|2606:4700:7::a29f:804f|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘vanilla-core-2.8.1.zip’


Extract the zip file. and reload the Apache configurations

#unzip vanilla-core-2.8.1.zip

#mv vanilla-2.8.1  vanilla

root@ubuntu-server-18:~# sudo chown -R www-data:www-data /var/www/vanilla.com/
root@ubuntu-server-18:~# systemctl restart apache2
root@ubuntu-server-18:~#

 

Now Please  go to http://host/vanilla  in my case  vanilla.com/vanilla  and fillup  your  information and  database credentials  and gooo

Enjoy

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here