Home arrow Site Administration arrow Page 4 - Banner Management With phpAdsNew (Part two)

Many Websites, One phpAdsNew - Administration

In this second part of a three-part tutorial covering phpAdsNew, you will learn more about the features of the "Publishers" and "Advertisers" module, as well as a convenient way to integrate phpAdsNew with multiple websites, and more.

  1. Banner Management With phpAdsNew (Part two)
  2. Publishers Revisited
  3. Advertisers Revisited
  4. Many Websites, One phpAdsNew
  5. Remote Calling
By: Harish Kamath
Rating: starstarstarstarstar / 7
April 11, 2005

print this article



It is common knowledge that a Web entrepreneur is always looking for ways to leverage his existing infrastructure. Take Google, for example: it started with a search engine, then, it launched Froggle and more recently, it added email to its portfolio in the form of Gmail. You get the picture!

If you are a part of this group - and, more importantly, have many "popular" websites, it does not make sense to have multiple local instances (one for each website) of phpAdsNew on your server. In such a scenario, you are better off installing phpAdsNew at a custom URL - http://ads.mysite.com.

As usual, Iíll give you step-by-step instructions on how to go about this transformation. For starters, youíll need to unzip the phpAdsNew source code archive at a convenient location under the root folder of your Web server, as Iíve done below:

$ cd /www/htdocs/

$ tar -xzvf /tmp/phpAdsNew-2.0.4-pr2.tar.gz

$ mv phpAdsNew-2.0.4-pr2 phpads

Next, you need to configure your Web server. Iíll assume (as I did in the first part) that you are using Apache. As you may be aware, this Web server supports the concept of Virtual Hosts; for the uninitiated, this feature allows a single Apache instance to host several websites, simultaneously.

Coming back to phpAdsNew, consider the following scenario: you own a Web site accessible at http://www.mysite.com. Next, you would like to add a couple more - a new website (say http://www.mynewsite.com), and the phpAdsNew application, set up so that its administration module can be viewed at http://ads.mysite.com.

This is not a problem. Just fire up your favorite text editor and load the "httpd.conf" file, which controls configuration of your Apache Web server. Add the following line of code:

NameVirtualHost *:80

Note that this may already be present in your file - just uncomment the instructions by removing the "#" character at the beginning of the line. Next, insert these VirtualHost directives to configure the different websites that Iíve listed above:

DocumentRoot /www/htdocs/mysite
ErrorLog logs/mysite-error.log
CustomLog logs/mysite-access.log common

DocumentRoot /www/htdocs/mynewsite
ErrorLog logs/mynewsite-error.log
CustomLog logs/mynewsite-access.log common

DocumentRoot /www/htdocs/phpads
ServerName ads.mysite.com
ErrorLog logs/phpadsnew-error.log
CustomLog logs/phpadsnew-access.log common

Note that you may have to configure the DNS server to map IP addresses to the appropriate URLs. If this sounds like Greek and Latin to you, it's time to seek the assistance of the server administrator of your Web server.

Now, let me give you a quick run-down of the "VirtualHost" directives that Iíve listed above. For obvious reasons, the IP addresses are different for each block because the Web server has been configured to serve more than one IP address. Another important point to note is the path specified in the "DocumentRoot" directive in each block. The more discerning amongst you will notice that this points to the root folder of the corresponding website.

Restart the server and load the following URL: http://ads.mysite.com. If all goes well, you should see the familiar administration module of phpAdsNew.

Note that first-time installers will see the default installation wizard in the browser. Just follow the steps outlined in the first part of this tutorial and voila - phpAdsNew should be up and running in no time!

Would you like to learn more about Virtual Hosting? Just point your browser to http://www.devshed.com/c/a/Apache/Getting-Started-with-Apache-2-0-Part-II/ and if you are still not satisfied, the official Apache documentation has a complete section devoted to this topic: http://httpd.apache.org/docs-2.0/vhosts/

>>> More Site Administration Articles          >>> More By Harish Kamath

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: