When you do a standard installation of Revive Adserver, the installation procedure will result in a situation where the banner images will be stored in a folder that’s deep down in the Revive Adserver folder tree. This makes it hard to perform future upgrades or effective backups. Luckily, it’s rather simple to move the banner storage folder. In this article, I will explain how to make that change.
I’m starting with the assumption that you have installed your Revive Adserver system in a folder under your website root, let’s say it’s in www.example.com/revive/. This means the images will be found in www.example.com/revive/www/images/. The objective is to move the image storage location and banner delivery URL to www.example.com/images.
Here’s how to do this:
- Create a new folder on server named ‘images’, next to the existing ‘revive’ folder. This folder will become visible to the outside world as ‘www.example.com/images’.
- Give this new folder the ‘777’ permissions or whatever is required for your operating system to enable Revive Adserver to store banners there when they are being uploaded through the Revive Adserver user interface.
- Copy the full content of the existing www.example.com/revive/www/images folder on the server into this newly created www.example.com/images folder (including any and all sub folders).
- Now open the configuration file in the ‘revive/var’ folder on the server and edit it. The configuration file will be named similar to www.example.com.conf.php (so the name corresponds to the main URL of your Revive Adserver installation).
- Look for the [webpath] section, and change the two lines in that section that start with ‘images’ and ‘imagesSSL’ respectively. The end result should be www.example.com/images for both.
- Look for the [store] section, and change the line in that section that starts with ‘webDir’. The new value should be full path of the newly created images folder (or just take out the ‘revive/www’ part of the existing path.
- Save the configuration file.
From this moment on, newly uploaded banners will be stored in the new folder, and Revive Adserverwill serve them from this folder onto you website.
Revive Adserver normally offers you the choice to store banner images either on the webserver or in the database. This article helped you move the banner image storage location on the webserver. To make sure you can’t (accidentally) store the banner images in the database anymore, do this:
- Open the configuration file again (see above) and find the section named [allowedBanners].
- Find the line that starts like ‘sql=’ and if there is a value of 1 there, change that to 0 (zer0) or remove the 1. The end result will look like ‘sql=’.
- Save the configuration file.
From now on, the ‘add new banner’ screen in Revive Adserver will no longer offer the option to store the banner images being uploaded in the database.
After you’ve moved the images that were in the ‘www/images’ folder into its own directory, and completed the configuration changes, you can (but don’t have to) remove the image files from the ‘www/images’ folder, so that they don’t take up any space on the disk. Don’t delete the folder itself, however!
Upgrading in the future
Now that the images folder is no longer a part of the Revive Adserver software folder, when you do a software upgrade in the future, you longer have to take care of copying the banner images to the new location. Just follow the Upgrade process.