Administration
  Home arrow Administration arrow Page 4 - Banner Management With phpAdsNew (Part...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Banner Management With phpAdsNew (Part two)
By: Harish Kamath
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2005-04-11

    Table of Contents:
  • Banner Management With phpAdsNew (Part two)
  • Publishers Revisited
  • Advertisers Revisited
  • Many Websites, One phpAdsNew
  • Remote Calling

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    FaxWave - Free Trial.
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Banner Management With phpAdsNew (Part two) - Many Websites, One phpAdsNew
    (Page 4 of 5 )

    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:

    <VirtualHost 192.168.0.1:80>
    DocumentRoot /www/htdocs/mysite
    ServerName
    www.mysite.com
    ErrorLog logs/mysite-error.log
    CustomLog logs/mysite-access.log common
    </VirtualHost>

    <VirtualHost 192.168.0.2:80>
    DocumentRoot /www/htdocs/mynewsite
    ServerName
    www.mynewsite.com
    ErrorLog logs/mynewsite-error.log
    CustomLog logs/mynewsite-access.log common
    </VirtualHost>

    <VirtualHost 192.168.0.3:80>
    DocumentRoot /www/htdocs/phpads
    ServerName ads.mysite.com
    ErrorLog logs/phpadsnew-error.log
    CustomLog logs/phpadsnew-access.log common
    </VirtualHost>

    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 Administration Articles
    More By Harish Kamath


       · Appreciate the tutorials. Great overview and explanation! Nice work.
     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway