How to Install OpenX on CentOS 9: A Comprehensive Guide
Welcome back to the Greenhost.cloud blog! In this post, we’ll walk you through the process of installing OpenX on a CentOS 9 server. OpenX, now known as Revive Adserver, is an open-source ad serving platform that allows you to manage and optimize your ad campaigns effectively. Whether you’re running a personal project or managing a business, OpenX can be a valuable tool for maximizing your advertising efforts.
Prerequisites
Before we dive into the installation, ensure that you have:
- A CentOS 9 server with root access.
- A basic understanding of the command line.
- A LAMP stack (Linux, Apache, MySQL, PHP) installed on your server. If you don’t have this set up yet, here’s a brief rundown on how to install it:
- Apache:
sudo dnf install httpd
- MySQL (MariaDB):
sudo dnf install mariadb-server
- PHP:
sudo dnf install php php-mysqlnd php-gd php-mbstring php-xml
Step 1: Update Your System
Before installing any new software, it’s best to ensure that your system is up-to-date:
sudo dnf update -y
Step 2: Install Required PHP Extensions
OpenX requires several PHP extensions to function correctly. Install them using the following command:
sudo dnf install php-curl php-zip php-gd php-mbstring php-xml php-mysqlnd -y
After installing, restart the Apache server to apply your changes:
sudo systemctl restart httpd
Step 3: Download OpenX (Revive Adserver)
Next, navigate to the official Revive Adserver website or GitHub repository to get the latest version. You can use wget
to download it directly to your server:
cd /var/www/html
sudo wget https://www.revive-adserver.com/download/revive-adserver-x.y.z.tar.gz
Replace x.y.z
with the latest version number.
Step 4: Extract the Downloaded Files
Unzip the downloaded file and change the ownership to the Apache user:
sudo tar -xvzf revive-adserver-x.y.z.tar.gz
sudo chown -R apache:apache revive-adserver-x.y.z
Step 5: Create a Database for OpenX
Log in to MySQL to create a new database and user for OpenX:
sudo mysql -u root -p
Run the following commands in the MySQL shell:
CREATE DATABASE revive;
CREATE USER 'reviveuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON revive.* TO 'reviveuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Make sure to replace 'your_password'
with a strong password of your choice.
Step 6: Configure Apache
You’ll need to create a new virtual host configuration for OpenX. Edit the Apache configuration file:
sudo nano /etc/httpd/conf.d/revive.conf
Add the following configuration (adjust ServerName
and paths as necessary):
<VirtualHost *:80>
ServerName your_domain.com
DocumentRoot /var/www/html/revive-adserver-x.y.z/www
<Directory /var/www/html/revive-adserver-x.y.z/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/revive-error.log
CustomLog /var/log/httpd/revive-access.log combined
</VirtualHost>
Then, restart Apache:
sudo systemctl restart httpd
Step 7: Run the OpenX Installation Wizard
Open your browser and navigate to http://your_domain.com
to start the installation wizard. Follow the on-screen instructions, providing the database details you created earlier.
Step 8: Secure Your Installation
After successfully installing OpenX, it’s crucial to secure your installation:
- Delete the installation directory:
sudo rm -rf /var/www/html/revive-adserver-x.y.z/www/install
- Consider setting up SSL for your site using Let’s Encrypt or any other SSL provider to secure your connections.
Step 9: Access and Configure OpenX
Once the installation is complete, you can access your OpenX dashboard at http://your_domain.com
. You can start configuring your ad campaigns, managing advertisers, and analyzing performance right from there.
Conclusion
Congratulations! You’ve successfully installed OpenX on your CentOS 9 server. This open-source platform can significantly optimize your advertising efforts and provide valuable insights into your campaigns. As always, ensure you keep your software up to date to avoid vulnerabilities and improve performance.