Sai Gopal Wordpress Blog

saigopal wordpress blog

Saigopal's website

Saigopal's website

My Daughter Website

Weebly

Palwow

Freelance Jobs

Friday, March 12, 2010

Configuring Virtual host in Apache in Windows

Configuring Virtual host in Apache in Windows

Configuring a Virtual host in Apache in windows needs just two step.
First one: configure the apache
Second one: configure the DNS in windows.
First One:
The first file we’ll need to edit is the Apache httpd.conf file. Start your text editor and open the file. It will be in a sub-folder named conf of your Apache folder. For example, mine is here:
C:\Program Files\Apache\conf\httpd.conf
Now, for this example, we’ll assume that you have your web sites located in a folder on your C drive. Each web site has a sub-folder of its own under that folder, like this:
C:\test
We’re going to set up virtual hosts for those the site using the domain name test.local. That way, you’ll be able to tell at a glance whether you’re looking at the live site, or your testing site.
In reality, you can call the domain anything you want. You could just as easily name them test.com or test.net. I choose to use the convention of using the same domain name along with the .local TLD to simplify and minimize the typing needed to switch between the live site and the testing site. The only important point, and it’s really important, is that you NEVER use an actual, real, live domain name. If you used, for example, test.com for the local virtual host, you would never be able to actually reach the live site. All requests for the live site would be re-directed to your local virtual host.
Go to the very bottom of your httpd.conf file in your text editor. You should see an example of a virtual host there. Each line of that example will begin with an octothorpe (#). The octothorpe character marks the line as a comment, so the example is not executed. Add the following lines below that example:
NameVirtualHost 127.0.0.1


   DocumentRoot "C:\test"
   ServerName test.local
That’s all you need to do! Save and close the file. That will tell the Apache server everything it needs to know in order for it to serve the pages using the domain names test.local.
Second Change:
Obviously, if you typed http://test.local in your browser, it would not be found by your Internet provider’s DNS server. We’re next going to edit another file to work around that. The second file you need to edit is called hosts, with no file extension. It is a Windows system file and it will enable you to enter specific addresses for specific domains instead of using a DNS lookup. The normal location for this file is:
C:\WINNT\system32\drivers\etc\hosts
If you don’t find it there, do a search in your windows directory for the word hosts in the file name. The file you want is called hosts, with no file extension. The correct file will begin with the following lines:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
Once again, in this file, the octothorpe character is a comment marker. Lines beginning with it are comments. In all likelihood, there will be nothing there, except for comments. If there are any other non-commented entries, leave them alone. Just go to the bottom of the file, below all the comments and any existing entries and add the following two lines:
127.0.0.1 test.local
That’s all you need to do there. Save and close the hosts file.
Lastly :
You’re almost done! The only remaining thing you need to do is to re-start the Apache server. You need to do this because Apache only reads the configuration file when it first starts up
Hope this will work for you.

2 Comments »

  1. [...] post by Tapos Pal Share and Enjoy: These icons link to social bookmarking sites where readers can share and [...]
  2. [...] Virtual host confguration in Linux (Ubuntu) Some days ago I have posted how to configure apache virtual host in windows. You can find it here. Now I will describe how to configure virtual host in Linux. It’s all [...]

Andyjarrett.com. ColdFusion developer and general beta whore. If it moves on the web i'll try and consume it Setting up and using windows HOST file

Setting up and using windows HOST file

Host files used in windows to describe many-to-one mapping of device names to IP addresses. Using this file is helpful when developing locally as it allows you to assign the URL of the site to a local IP.
First, find you host file:
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP Home c:\windows\system32\drivers\etc\hosts

The HOST file doesn't have an extention and can be opened with notepad.
** Before we go any further make sure you back this up - just in case *** You should see something like:
   view plainprintabout
1  ......
2  # Additionally, comments (such as these) may be inserted on individual
3  # lines or following the machine name denoted by a '#' symbol.
4  # For example:
5  # 102.54.94.97 rhino.acme.com # source server
6  # 38.25.63.10 x.acme.com # x client host
7 
8  127.0.0.1    localhost
As with SQL '#' mean comments, so the only active line there is
   view plainprintabout
1  127.0.0.1    localhost
What does that mean. Well everytime you access localhost (like in a browser, or PING'd from a command line) you are acutally accessing the IP address 127.0.0.1. So lets say i'm developing a new blog. In Apache (or any web server) i'd set up the IP address 127.0.0.2 to look at my document root. Then in the HOST file i'd have
   view plainprintabout
1  127.0.0.2    www2.andyjarrett.co.uk
Alternatively I could just point the host to 127.0.0.1 instead of setting up a new IP. What you cannot do is map to a IP and port i.e. 127.0.0.1:8080
By the way, if you're wondering why i've changed the URL to have www2 as the prefix? It's that the HOST file is used first when going to a domain. For example try out the following
   view plainprintabout
1  127.0.0.1    www.google.co.uk
then goto www.google.co.uk.
N.B. If you use a proxy then you will need to bypass the proxy server for local addresses

work locally with apache and virtual hosts

Work locally with Apache and virtual hosts

Tuesday, 04 March 2008
Most web developers and template creators need to have multiple sites on their local computer that can be accessed any time without modifying apache configuration variables. The easy solution is each site to be in a www root folder sub-directory and access that site like that: http://www.elxis.org/siteA/. Here we will show you how you can easily create virtual hosts on a windows machine to run multiple sites simultaneous each one having its own domain (http://siteA.tld). What we are going to show you applies to everything, not only Elxis CMS. It is also valid for XAMPP. By the way, we advise you not to use XAMPP but install seperately apache, mysql/postgresql and PHP instead. It will help you to understand better how a real web enviroment works. In this guide we will show you the general method of creating virtual hosts that can also be applied to XAMPP.

Locating needed files

For this guide we need to edit 3 files:
1. The Apache configuration file (httpd.conf).
This file is located inside the Apache's installation directory. Example path from my local computer:

C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf

The above path may vary depending on the location of the windows installation drive on your computer and the apache version.
If you use XAMPP this file should be located inside the XAMPP installation directory. If you can nt find it use search.
2. The Apache Virtual hosts configuration file (httpd-vhosts.conf)
This file is located inside the Apache's installation directory. Example path from my local computer:

C:/Program Files/Apache Software Foundation/Apache2.2/conf/extra/httpd-vhosts.conf

The above path as well as the configuration file name may vary depending on the location of the windows installation drive on your computer and the apache version.
I think XAMPP by default adds virtual hosts inside the httpd.conf file. Sorry, I have never used XAMPP, I have just seen it 2-3 times.
3. Windows hosts file (hosts)
This is a file with no extension hidden inside the windows/system32/drivers/etc/ folder. It contains a list of the system hosts (normally only localhost). Example path for my local computer:

C:/windows/system32/drivers/etc/hosts

Notice: This guide is for Windows 2000/XP/Vista.

Examine your www root folder

Foreach one of you sub-folders/sites inside your www root folder we will create a virtual host. Go to your www root folder where you have your local sites. This by default is:
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs

Or a htdocs folder inside the XAMPP installation directory or any custom path you have set in httpd.conf as DocumentRoot.

In this folder you will have a directory structure like this:
siteA (folder where site A is located in)
siteB (folder where site B is located in)
etc....

For consistency we will use these folder names as domain names.

Add virtual hosts to Apache

Open Apache's Virtual hosts configuration file (httpd-vhosts.conf) with a text editor such as notepad, editpad, pspad etc. Make sure everything is commented by adding a sharp symbol (#) in front of each line. Everything pre-existing there are just samples. First of all write:

NameVirtualHost *:80
 
 
     DocumentRoot "F:/myweb"
     ServerName localhost
 

Where you should replace the F:/myweb (my local DocumentRoot) with the path of your www root folder (normally camed as htdocs).

Now, for each one of your sites (the sub-directories we talked about previously) create an entry like this:

     DocumentRoot "F:/myweb/elxis"
     ServerName elxis.loc
 

When finish your httpd-vhosts.conf file should look like this:

NameVirtualHost *:80

 
     DocumentRoot "F:/myweb"
     ServerName localhost
 
 
 
     DocumentRoot "F:/myweb/elxis"
     ServerName elxis.loc
 
 
 
     DocumentRoot "F:/myweb/elxis2008"
     ServerName elxis2008.loc
 
 
 
     DocumentRoot "F:/myweb/myblog"
     ServerName myblog.loc
 
etc...

Notice that for consistency we used folder names as domain names, you can change this if you wish. We also used the loc as a pseudo-TLD *. You can use anything you wish but we advise you not to use a real one (like com, net, org, gr, fr, etc).

* TLD: Top Level Domain

Prepare Apache to handle virtual hosts

Now that our virtual hosts file is ready we must tell apache to use that file. Open Apache's configuration file (httpd.conf) with a text editor. Locate the line saying about where Virtual hosts file is located in (somewhere in the bottom of the document). If this line does not exist add it!

# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Uncomment the second line in order to tell apache to include our virtual hosts file:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Add virtual hosts to Windows

Open Windows's hosts file (hosts) with a text editor. Inside it you will find a line like this:

127.0.0.1    localhost
Add bellow this line:
127.0.0.1    loc

Finally add all the virtual hosts you created at Apache:
127.0.0.1    elxis.loc
 127.0.0.1    elxis2008.loc
 127.0.0.1    myblog.loc
etc...
Your Widnows hosts file is ready. Save it. Restart Apache. If needed restart Windows.
Now you can access all of your local sites like this:

http://elxis.loc
http://elxis2008.loc
http://myblog.loc


No more sub-directories and ugly urls :-)
Notice: Don't forget to edit your Elxis configuration.php file(s) and change $mosConfig_live_site URL to the new one(s).

Sunday, March 7, 2010

i am a certified php4 developer of odesk now

oDesk Certified PHP4 Developer

Samsung N128: Review

Samsung finally manages to gate-crash into the netbook party with the introduction of their impressive netbook lineup in the middle of a market already dominated by majors such as Acer, Asus, Lenovo, Dell etc. Surprisingly affordable, these ultraportable laptops have become popular travel companions for people who do not want to drag a heavy notebook to presentations!

Their latest and the most affordable offering, the 10-inch Samsung N128 offers a great balance of features at a starting price of INR 13, 500 (equates to less than 300 USD!). So, is the Samsung N128 the most affordable netbook in the market ? Will it prove to be a worthy contender to the other netbooks? Is this netbook the one you've been waiting for? Read on to find out!

Specifications:

Processor: Intel Atom N270 @ 1.60GHz

Memory: 1GB DDR2 SDRAM @ 533MHz

Internal storage: 160GB 5400rpm SATA HDD

Display: 10.1 inch LED backlit WSVGA panel (1024 x 600)

Graphics: Intel GMA 950

Wireless: 802.11 b/g

Expansion: 3-in-1 media card slot (SD, SDHC, MMC)

Ports & connectors: 3 USB 2.0 ports, VGA out, DC power-in, RJ-45/Ethernet (10/100), Stereo headphone/line out, Stereo microphone in, VGA webcam, Kensington lock port.

Dimensions (H x W x D): 28.5mm x 185.5mm x 263.8mm

Weight: 1.25kg (not including the weight of AC adapter)

Power: 6-cell Li-ion battery (4000mAh, 44Wh)

Warranty: 1 year standard International warranty

OS: DOS

php question

php question

Thursday, March 4, 2010

Sony PS3 Slim 250GB Console

Sony PS3 Slim 250GB UC2 Bundle -- 20,750 Shipped

Location: Pune, Maharashtra

It Only Does Everything™

Boasting blistering processing speeds and eye-popping graphics, the PlayStation®3 will change the way you think about gaming. In addition to an ever-growing catalog of games, the PS3™ features the Cell Broadband Engine™, integrated Blu-ray Disc™ player and 250GB hard disk drive to deliver the ultimate high-definition entertainment experience.



It Only Does Everything™
While the form factor may have changed, the new slimmer and lighter PlayStation®3 250GB system still comes with free PlayStation®Network membership, integrated Wi-Fi and 250GB of hard disk drive storage for your games, music, videos and photos. Plus, every PS3™ system comes with a built-in Blu-ray Disc™ player to give you pristine picture quality and the best high-definition viewing experience available. Whether it's gaming, Blu-ray movies, CDs, DVDs, music or online services, you can experience it all with the PlayStation®3 system.
Note: This model will not play PlayStation® 2 games, but is backwards compatible with select PS one™ games.

Did you know?
PlayStation®3 and PSP® play nice together. Easily exchange media like photos, videos and music from your PlayStation®3 system to your PSP® system. Plus, get ready to witness an explosion in creativity as developers take on the challenge of integrating the PSP system into PlayStation®3 games.
Not all video and audio formats may be supported.
** Online connectivity requires broadband internet service and network devices such as a DSL or cable modem.
Video output in HD requires cables and an HD-compatible display, both sold separately. Full HD 1080p requires an HDMI cable and a 1080p native display with an HDMI input supporting HDCP. Copy-protected Blu-ray video discs can only output at 1080p using an HDMI cable connected to a device that is compatible with the HDCP standard.



What's in The Box:

* New slimmer and lighter PS3 system with a 250 GB HDD, Internet-ready built-in Wi-Fi, 2 USB ports and HDMI + Bravia Synch output for 1080p resolution and connectivity between other Sony HDMI products.
* Dualshock 3 wireless controller.
* AC power cord, AV cable and USB cable.
* Uncharted 2 Game Disc

Launch Date: December Last Week Tentatively
MRP: Rs 22,490 (Tentative)
Pre-Order Price: Rs 20,750 Shipped.
Pre-Order Closing Date: December 24th. Please clear your payments before this date.

interested can view this link