Installing Revive Adserver on CentOS 7

Last Updated: Wed, Apr 6, 2016
CentOS Linux Guides Server Apps

Revive Adserver is a free and open source ad serving system which can be used to manage ads on websites, in apps, and/or in video players.

In this article, I will introduce you to the whole process of installing Revive Adserver on a Vultr CentOS 7 server instance.

Prerequisites

Before moving on, you need to:

  • Deploy a Vultr CentOS 7 server instance from scratch.

  • Create a sudo non-root user and then use it to log in your CentOS 7 system from your SSH terminal. You can learn about how to create such a user in another Vultr article.

Step 1: Update the system using YUM

One of system administrators' best practices is always updating the system to the latest stable status:

sudo yum update

sudo reboot

After the reboot, use the sudo user to log into the system again.

Revive Adserver needs the LAMP stack to operate properly. In the following sections, you need to deploy Apache, MariaDB, and PHP one by one.

Step 2: Install and configure Apache

Install Apache using YUM:

sudo yum install httpd

sudo systemctl start httpd.service

sudo systemctl enable httpd.service

Prevent Apache from displaying the default welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Prohibit Apache from displaying files in the /var/www/html directory:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Setup a virtual host for Revive Adserver:

sudo vi /etc/httpd/conf.d/adserver.conf

Populate the file with the following configurations. Be sure to replace the those user-specific parameters with your own ones.

<VirtualHost *:80>

ServerAdmin xxx@xxx.com

DocumentRoot /var/www/html/adserver/

ServerName adserver.xxx.com

ServerAlias www.adserver.xxx.com

<Directory /var/www/html/adserver/>

Options FollowSymLinks

AllowOverride All

</Directory>

ErrorLog /var/log/httpd/adserver.xxx.com-error_log

CustomLog /var/log/httpd/adserver.xxx.com-access_log common

</VirtualHost>

Save and quit:

:wq

Meanwhile, in order to accept users' visit, you need to modify the firewall rules to allow inbound http traffic:

sudo firewall-cmd --zone=public --permanent --add-service=http

sudo firewall-cmd --reload

Step 3: Install MariaDB and then create a database for Revive Adserver

Install MariaDB with YUM:

sudo yum install mariadb mariadb-server

sudo systemctl start mariadb.service

sudo systemctl enable mariadb.service

Perform the secure MySQL installation:

sudo /usr/bin/mysql_secure_installation

Finish this process according to the following instructions:

Enter current password for root (enter for none): click the Enter key

Set root password? [Y/n]: Input Y, then click the Enter key

New password: Input a new root password, then click the Enter key

Re-enter new password: Input the password again, then click the Enter key

Remove anonymous users? [Y/n]: Input Y, then click the Enter key

Disallow root login remotely? [Y/n]: Input Y, then click the Enter key

Remove test database and access to it? [Y/n]: Input Y, then click the Enter key

Reload privilege tables now? [Y/n]: Input Y, then click the Enter key

Open the MySQL shell as root:

mysql -u root -p

Input the MariaDB root password you set earlier to log in.

In the MySQL shell, execute the following commands to create a database for Revive Adserver. Remember to replace the database name "adserver", the database username "adserveruser", and the database user password "yourpassword" with your own ones.

CREATE DATABASE adserver;

CREATE USER 'adseveruser'@'localhost' IDENTIFIED BY 'yourpassword';

GRANT ALL PRIVILEGES ON adserver.* TO 'adserveruser'@'localhost';

GRANT ALL PRIVILEGES ON adserver.* TO 'adserveruser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

EXIT;

Step 4: Install PHP 5.6 and necessary extensions

With the default YUM repos, you can only install an unqualified version of PHP (5.4.16) on your server. You need to add a third-party YUM repo source (for example, the IUS repo) into your system to solve the problem:

cd ~

wget https://centos7.iuscommunity.org/ius-release.rpm

sudo rpm -Uvh ius-release.rpm

Install qualified PHP and necessary extensions, such as PHP 5.6:

sudo yum install php56u.x86_64 php56u-gd.x86_64 php56u-mysqlnd.x86_64 php56u-mbstring.x86_64 php56u-xml.x86_64 php56u-opcache.x86_64

Put all your changes into effect:

sudo systemctl restart httpd mariadb

Step 5: Download the Revive Adserver archive

As of writing, the latest version of Revive Adserver is 3.2.4. You can always find the latest download URL on the Revive Adserver official website.

cd ~

wget https://download.revive-adserver.com/revive-adserver-3.2.4.tar.gz

tar -zxvf revive-adserver-3.2.4.tar.gz

mv revive-adserver-3.2.4/ adserver/

sudo chown -R apache: adserver/

sudo mv adserver/ /var/www/html/

Step 6: Finish the installation in your browser

Visit your Vultr server using a web browser:

http://[your-server-IP]

On the "Welcome" page, click the "I Agree >>" button. Then the installation wizard program will execute a system check.

After the system check you will get into the "Database" page. Input the database name, database username, and database password you specified earlier and leave other fields untouched. Then, click the "Continue >>" button.

On the "Configuration" page, input administrator username, administrator password, and administrator email address; adjust language and timezone as you wish; and leave other fields untouched. Then click the "Continue >>" button.

On the "Finish" page, click the "Continue >>" button to finish the installation.

That's it. Now you can manage ads in the Revive Adserver system.

Want to contribute?

You could earn up to $600 by adding new articles.