YNOT
  • Home
  • Industry News
    • Adult Business News
    • Adult Novelty News
    • YNOT Magazine
    • EU News
    • Opinions
    • Picture Galleries
  • PR Wire
    • Adult Company News
    • Adult Retail News
    • Adult Talent News
    • Adult Videos News
  • Podcasts
  • Industry Guides
    • Adult Affiliate Guide
    • Affiliate Marketing for Beginners
    • Top Adult Traffic Networks
    • Top Adult PR Agents
    • Funding an Adult Business
  • Business Directory
    • View Categories
    • View Listings
    • Submit Listing
  • Newsletters
  • Industry Events
    • Events Calendar
    • YNOT Cam Awards | Hollywood
    • YNOT Awards | Prague
    • YNOT Cammunity
    • YNOT Summit
    • YNOT Reunion
  • Login with YNOT ID
YNOT University: Educational articles and tutorials

Create a site with WordPress: Configuring Apache for Virtual Hosts

Posted On 07 Feb 2011
By : admin

YNOT – The previous article showed how to set up the Apache rewrite module so as to enable WordPress to change the URLs of the pages the CMS creates.

This article is dedicated to all those intending to implement several versions of the same website or more than one website. In this case, you will need to set up what are called “virtual hosts.” Virtual hosts run as if they are independent instances of the server, but all operate on a single Apache installation.

We can reduce the virtual host creation process to two simple steps to be repeated for the number of sites that we operate on the same PC.

Step 1: To allow Apache to distinguish between different versions of the same site, you must set a unique name for each version. Locally, we can choose whatever name we like, even if that won’t be the name of the site when you finally make it live on the web. If we wanted to create a site called www.sitodiprova.com, we could choose a name like local.sitodiprova.com, replacing the www prefix in the original with the “local” string in the trial site.

At this point you will need to communicate the name you have chosen to the operating system. When you type the address of a website in the navigation bar of a web browser, the browser queries the DNS (Dynamic Naming System) server network to identify the site. Before querying the DNS, a search is made on a file inside the operating system that is identified as the hosts file. Only if the name you seek matches an IP address in this file is the server queried. In our case, we will modify the hosts file to tell it that if we try to find local.sitodiprova.com, the browser should look in our local PC itself, and not on the web.

With Notepad (or any other plain-text editor), open the file hosts. You should find it in this path: C:\windows\system32\drivers\etc\. At the end of the file, add the line 127.0.0.1 local.sitodiprova.com. If you wish to add more than one local site, add one similar line for each site, changing name each time. For example, you could add lines for local.sitodiprova.com, local.domain2.com and local.myfave.com. Each one will be “mapped” to 127.0.0.1, which is your local machine’s IP address.

Step 2: Now you must set the Apache httpd.conf file to recognize the new site. Open the file (as described in the previous article) and paste the following lines at the bottom:
[PHP]
NameVirtualHost 127.0.0.1


DocumentRoot “C:\wamp\www”
ServerName localhost


DocumentRoot “C:\wamp\www\sitodiprova.com”
ServerName local.sitodiprova.com
ErrorLog logs/sitodiprova_error.log

[/PHP]
After editing, save the file. You will notice that beyond the basic localhost Apache, we created a folder inside the www the location where Apache will look for the file when you type local.sitodoprova.com into your browser. You also have created a folder where error logs for the webserver will be kept.

Important: For proper operation, you must create the folder sitodiprova.com in the path C:\wamp\www\.

If you followed all the steps correctly, you have successfully created your first virtual host. To test its operation, create a file called phpinfo.php in the folder C:\wamp\www\sitodiprova.com. The file should contain only the following string:
[PHP]

[/PHP]
Now type [URL]http://local.sitodiprovacom/phpinfo.php[/URL] in your browser. If you get a PHP information page, you have completed all the steps in the right way.

In future articles, we will see how to configure MySQL and phpMyAdmin to set up the database installation for WordPress.

This article was written for YNOT.com by Eng. Antonio Lodesani. For more information, visit ingoccupati.blogspot.com (in Italian).

  • google-share
Previous Story

Making Money with Live Phone Chat

Next Story

Defining Terms: Translation Demystified

Leave a Reply Cancel reply

You must be logged in to post a comment.

Sponsor

YNOT Shoot Me

YNOTShootMe.com has exclusive pics from adult industry business events. Check it out!

YNOT Directory

  • RIVCash
    Live Cam Affiliate Programs
  • Ero Advertising
    Marketing & Traffic Services
  • DPLCash
    Dating Affiliate Programs
  • Premiere Listing

    delevit – remove your leaked content

    More Details

RECENT

POPULAR

COMMENTS

Lily Starfire Plays the Game in New Brazzers Scene

Posted On 01 Jul 2025

‘Teachers Hookup After Hours’ on MILFuckd

Posted On 01 Jul 2025

Justine Jakobs Crowned Nookies Newest Rookie

Posted On 01 Jul 2025

Vanessa, Meet Vivid

Posted On 29 Sep 2014
Laila Mickelwaite and Exodus Cry

Laila Mickelwaite, Exodus Cry and their Crusade Against Porn

Posted On 03 May 2021

Sex Toy Collective Dildo Sculptor

Posted On 19 Mar 2019

Find a good sex toy is now a problem,...

Posted On 18 Mar 2024

Thanks to the variety of sex toys, I can...

Posted On 02 Feb 2024

I understand the concerns about...

Posted On 05 Jan 2024

Sponsor

Sitemap
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy Policy