Error opening httpd.conf during forced ads cron job

Question:

Q: When my forced-ads cron job runs, I receive the following error messages:

fopen: Permission denied httpd: could not open document config file /usr/local/apache/conf/httpd.conf

How do I fix this?

Answer:

This error message is generated by Apache, not iPanel/iAds. iPanel/iAds needs to modify your Apache configuration each time its cron job runs in order to rotate your ads and apply ads to new accounts. After modifying the Apache configuration, it needs to restart Apache so that Apache will see the updated configuration.

Apache is generating this error message because it is unable to open its configuration file. Usually this means that you are not running the forced-ads cron job as root, which is required per the installation guide.

To correct this problem, run the forced-ads cron job as root.

If you are using a shared hosting or reseller account instead of a dedicated server or VPS, you will likely not have root privileges and thus will not be able to use the forced ads feature.