Sunday, February 26, 2012

This by far has been the shortest, quickest, fastest way to check my IP address and I just discovered it today.

Go to www.google.com and type this query ==> "check my ip" and see what happens. The first result you get should be your IP address, something like this ==> "Your public IP address is 100.141.09.555". To know more about IP address here's what Google says, "IP Address"

WARNING: This tool can ONLY be used if you are hosted by an Apache web server or if your server allows URL rewriting (recommended). Please ask your hosting provider if you are not sure.

1. First to generate a .htaccess file you must enable "Friendly URL: at Preferences >> SEO & URLs.2. You may also enable Canonical url for redirecting example.com to www.example.com. Effective for SEO. (Recommended, but your theme must be compliant).3. You can now generate a .htaccess file at Tools >> Generators.
4. You can also generate robots.txt for restricting search-engine crawlers from crawling certain pages of your website such as your about page, login page etc.

When it’s first installed, Apache is capable of hosting only one website, which is identified in a local testing environment by the URL http://localhost/. To get around this restriction, it’s common practice to develop websites in subfolders of the Apache server root. For example, if you have two sites called site1 and site2 and create separate subfolders for them in the server root, you access them in your testing environment as http:// localhost/site1/ and http://localhost/site2/. This works perfectly well as long as you use document-relative links all the time. However, if you want to use links relative to the site root, you need to create virtual hosts for each site.

Virtual hosting is a technique that web servers use to host more than one website on the same machine. If you have bought a web-hosting package from a hosting company, it’s almost certainly on a shared server that uses virtual hosts. Continuing with the previous example, once you create virtual hosts for site1 and site2 in Apache, you can test them locally using http://site1/ and http://site2/. This is essential for testing sites that use links relative to the site root. If you’re serious about web development, you should learn sooner or later how to set up virtual hosts in your testing environment. Once you have mastered the technique, it takes only a few minutes to set up each one.

You can call your virtual hosts whatever you like, as long as you don’t use any spaces or characters that would be illegal in a domain name. I always use the same name as the actual website, without the top-level domain. For example, for my own site, http://foundationphp.com/, I have created a virtual host called foundationphp in my local testing setup. This means that I access it as http://foundationphp/. It’s then a simple matter of clicking in the browser address bar and adding the .com to see the live site. Whatever you do, don’t use the top-level domain as the name of a virtual host in your testing setup. If you do, your computer will always point to the local version of the site and never access the real one on the Internet.

Apache allows you to create as many virtual hosts as you want. It’s a two-stage process. First, you tell the operating system the names of the virtual hosts, and then you tell Apache where the files will be located. There are separate instructions for Windows and Mac OS X.Registering virtual hosts on Windows

Although you can locate your virtual hosts anywhere on your hard drive system, it’s a good idea to keep them in a single top-level folder, as this makes it easier to set the correct permissions in Apache. The following instructions assume that all your virtual hosts are kept in a folder called C:\vhosts and show you how to create a virtual host called dwcs4 within that folder.

To edit the necessary files in Vista, you need to select Run as administrator even if you are logged in to an administrator account. For Notepad, go to Start ➤ All Programs ➤ Accessories, right-click Notepad, and select Run as administrator from the context menu.
Enter your administrator password when prompted. Inside Notepad, select File ➤ Open and navigate to the relevant file. The Open dialog box in Notepad shows only .txt files, so you need to select All Files (*.*) from the drop-down menu at the bottom right of the dialog box.STEPS For Configuration:

1. Create a folder called C:\vhosts and a subfolder inside it called dwcs4.

2. Open C:\WINDOWS\system32\drivers\etc\hosts in Notepad or a script editor and look for the following line at the bottom of the file:
127.0.0.1 localhost
127.0.0.1 is the IP address that every computer uses to refer to itself.
3. On a separate line, enter 127.0.0.1, followed by some space and the name of the virtual host. For instance, to set up a virtual host for this book, enter the following:
127.0.0.1 dwcs4 or 127.0.0.1 sackid.local and also set ServerName (see bottom page to know more) also to sackid.local if you want something like http://sackid.local
4. If you want to register any further virtual hosts, add each one on a separate line and point to the same IP address. Save the hosts file and close it.

5. Open the Apache configuration file, httpd.conf. The default location is C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf. If you installed XAMPP, it should be at C:\xampp\apache\conf\httpd.conf.

6. Scroll down to the Supplemental configuration section at the end of httpd.conf, and locate the following section:

7. Apache uses the hash sign (#) to indicate comments in its configuration files. Uncomment the command shown on line 463 in the preceding screenshot by removing the #, like this:
Include conf/extra/httpd-vhosts.conf
This tells Apache to include the virtual host configuration file, which you must now edit.

8. Save httpd.conf, and close it.

9. Open httpd-vhosts.conf. The default location is C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf. If you installed XAMPP, it should be at C:\xampp\apache\conf\extra\httpd-vhosts.conf. The main part of the file looks like this:

10. Position your cursor in the blank space shown on line 15 in the preceding screenshot, and insert the following four lines of code:

<Directory C:/vhosts>Order Deny,AllowAllow from all</Directory>

This sets the correct permissions for the folder that contains the sites you want to treat as virtual hosts. If you chose a location other than C:\vhosts as the top-level folder, replace the pathname in the first line. Remember to use forward slashes in place of backward slashes. Also surround the pathname in quotes if it contains any spaces.

11. Lines 27–42 in the preceding screenshot are examples of virtual host definitions. They show all the commands that can be used, but only DocumentRoot and ServerName are required. When you enable virtual hosting, Apache disables the main server root, so the first definition needs to reproduce the original server root. You then add each new virtual host within a pair of <VirtualHost> tags, using the location of the site’s web files as the value for DocumentRoot and the name of the virtual host for ServerName. If the path contains any spaces, enclose the whole path in quotes. If your server root is located, like mine, at C:\htdocs, and you are adding dwcs4 as a virtual host in C:\vhosts, change the code shown on lines 27–42 so they look like this:

12. Save httpd-vhosts.conf, and restart Apache. All sites in the server root will continue to be accessible through http://localhost/sitename/. Anything in a virtual host will be accessible through a direct address, such as http://dwcs4/.

Email Subscription:

Support/Donate:

Drupal Association Member

eV@gabond - The Meaning

" I want to be an educated vagabond, not a vagabond out of weakness. I don't want to do anything in my life out of weakness - because I could not be anything else, that's why I am a Vagabond - that is not my way. First I want to prove to the world that I can be anything that I want to be, but still I choose to be a vagabond - out of strength. Then there is respectability even if you are a Vagabond, because respectability has nothing to do with your vocation, your profession; respectability has something to do with acting our of strength, clarity, intelligence. "