Serve local web pages via name not IP number Illinois

Learn how to serve web pages locally via name instead of IP address.


1 . Local Companies

Western Electronics
(309) 687-1311
3311 N Sterling Ave Apt N
Peoria, IL
Electronics Diversified
(309) 688-2444
4632 N Brandywine Dr
Peoria, IL
Kaiser Electronics
(309) 691-2929
Studio 29
Peoria, IL
Eddie Bauer
(309) 689-0413
5201 W War Memorial Dr Ste 475
Peoria, IL
Boom Did It
773-383-3174
Mobile Business
Loves Park, IL
Audio Logic
(309) 282-1789
3404 Ne Adams St
Peoria, IL
Best Buy
(309) 689-0277
5001 N Big Hollow Rd Ste 3a
Peoria, IL
A & V Electronic Services
(309) 691-1340
7011 N Willow Wood Dr
Peoria, IL
American Electronic Appliances Service Department
(309) 589-3000
5801 W War Memorial Dr
Peoria, IL
Zetta Medical Technologies
847-550-9990
363 Enterprise Parkway
Lake Zurich, IL

2 . Serve local web pages via name not IP number

provided by: 


Today's hint is about OS X 10.5's built-in Web server, and how you can make it easy to access sites you're running off that server. In case you weren't aware, the built-in OS X web server is the industry-standard Apache web server that powers literally thousands of web sites around the world. As of OS X 10.5.5, it's Apache version 2.2.9.

So what can you do with OS X's built-in Web server? Almost anything, though the one thing you probably can't do is use it to serve web pages to the outside world, at least not easily. Many ISPs don't allow web servers to run on a standard home account, and even if they do, your firewall and/or router may make it difficult for users to reach your site. If you get around those problems, you'll still need to arrange for a domain name to point to your home machine-and again, your ISP may make that difficult. You can solve some of these issues by using a service such as DynDNS, which lets you assign a domain name to an ever-changing home IP address. You'll still have issues if your ISP won't allow you to host sites, however.

So if you can't serve sites to the outside world, why then might you want to run a web server anyway? Perhaps, like me, your job requires you to maintain a web site, and you'd like to keep a copy of it locally for testing. Or perhaps you'd like to try out some of the popular blogging web applications (WordPress, Movable Type) or some of the hundreds of content management systems available (Geeklog, for instance, which powers macosxhints.com) on your own Mac before you decide to launch a site with a web hosting company. (As an aside, this is exactly how macosxhints.com got started-I installed Geeklog locally and ran it on my own Mac for a couple of months before I launched the site to the public. In many ways, the built-in OS X web server is the one piece of technology most responsible for my launching macosxhints.)

image
Whatever the reason, OS X makes it super easy to run a web server on your very own Mac. You can enable the built-in web server by clicking the Web Sharing button in the Sharing System Preferences panel. Once enabled, you'll see a couple of links in the area to the right of all the sharing options; one lists your computer's web site URL, and the other lists the URL for your personal site. For most users, these addresses will appear as a series of (IP address) numbers-in my case, they're listed as http://192.168.1.44 and http://192.168.1.44/

3 . Serve local web pages via name not IP number

robg, respectively. If I open Safari or any other web browser and enter those URLs, I'll see the standard pages as shown in the image at right-that's the computer page at the top, and my personal page at the bottom.

While this works well enough, wouldn't it be nicer to access your locally-hosted sites via domain name, just like you do on the "real" Internet? With a couple of relatively easy edits in the Terminal, you can do just that. Apache includes support for what they call name-based virtual hosts, and by enabling those, you can name your server and its hosted sites anything you like. Here's what you need to do.

These instructions assume that you'll be installing your sites in your user's Sites folder, and that you'll place each different package you want to use (WordPress, Movable Type, etc.) in its own sub-directory, which is a pretty standard practice. They also assume you're using 10.5; this method will not work in 10.4, as it doesn't use Apache 2. It also assumes that you don't need to access any sites stored in the standard /Library -> WebServer -> Documents folder-I do have a relatively simple fix for that problem near the end of this hint, though.

Name your server

The first thing you need to do is come up with the name you'd like to use for your server-keep it short and simple, and restrict it to one word without any punctuation. The whole idea is to make it easy to type. For this example, I'm assuming the server will be called mysites, which would let you type http://mysites into your browser's URL bar.

Once you've come up with a name for your server, you need to tell OS X to look for that name locally before it tries to find it on the Internet. To do this, we'll make a simple change in the /etc/hosts file. My instructions assume you'll be using a Terminal-based text editor, such as vi or nano, but programs wuch as BBEdit and TextMate that offer a command-line interface could also be used-really, any text editor that lets you edit with root account privileges would do the trick.

Edit the hosts file in Terminal by typing sudo nano /etc/hosts, and then enter your password when prompted. The nano editor will open, displaying something like this:

### Host Database## localhost is used to configure the loopback interface# when the system is booting.  Do not change this entry.##127.0.0.1       test.super127.0.0.1       localhost255.255.255.255 broadcasthost...

Add a row just above the 255.255... line by pressing Return with the cursor at the start of that line, then use the arrow keys to move up, and add this entry:

127.0.0.1       mysites

Replace mysites with whatever name you've chosen for your server, and then save the file and quit the editor (press Control-X to exit, Y to save your changes, and then Return to accept the filename if you're using nano).

Set up Apache

Now that you've named your server, you need to tell Apache how to convert mysites into the IP address of your Mac, so that it can display your web pages. The file you need to modify can be found in /etc/apache2/users, so cd there as a first step: cd /etc/apache2/users. In this folder, you'll find a ".conf" file for each user on your Mac. You want to edit the file for your user, again with root privileges; type sudo nano username.conf (where username is your short username) and enter your password when prompted. Move the cursor to the bottom of the file, and add these lines:

NameVirtualHost *:80<VirtualHost *:80>    DocumentRoot /Users/username/Sites    ServerName mysites</VirtualHost>

Replace username with your user's short username, and change mysites to the server name you used when editing the hosts file. Save the file and quit the editor.

If you also need access to sites in the standard /Library -> WebServer -> Documents folder, you need to edit one additional file. First, move into the right directory with cd /etc/apache2/extra, and then edit the httpd-vhosts.conf file (again, using sudo). Add these lines at the end:

NameVirtualHost *:80<VirtualHost *:80>    DocumentRoot /Library/WebServer/Documents    ServerName localhost</VirtualHost>

Save the file, and you'll be able to access those sites by typing http://localhost in the URL address bar, while using your named server will show pages in your user's Sites folder.

Try it out

Those are the only required edits. To make your changes take effect, however, there are two things you need to do. First, as Leopard caches DNS queries, we need to clear the cache to make it read our hosts file again. In Terminal, enter this command then press Return: dscacheutil -flushcache. The other thing you need to do is restart the Apache web server. You can do this in the Sharing System Preferences panel by toggling the Web Sharing off and back on, or in Terminal, you can use this command: sudo apachectl graceful.

Once Apache restarts, test your new named server by opening your favorite browser and typing your server name in the URL bar: http://mysites. If you haven't replaced the default page in your user's Sites folder yet, that's what you should see when the page loads. Now, as you install various web packages into sub-folders, you can access them as http://mysites/wordpress or http://mysites/geeklog, etc. (If you prefer, you could even name your sub-folders as completely separate sites-just duplicate the above changes to the hosts and .conf files, but with your new server name and path directly to a sub-folder.)

If you have other Macs in your home that you'd like to use to access your served pages, you can do that easily, too. Just edit the hosts file on the other Mac as above, but instead of using 127.0.0.1 as the server address, use the IP address of the Mac running the web server (which you can easily find in the Web Sharing System Preferences panel). Remember to clear the cache after editing the file, and you can then access the host Mac's served pages using the defined server name.

I hope the above is clear and easy to follow-I've tested it on two different Macs here, and it works as described. If you have any troubles getting it working, however, please post a question and I'll do my best to answer it. Remember that this hint is for internally-hosted sites only, and it doesn't do anything about providing access for users outside your local network.


Read article at Macworld.com

4 . Featured Local Company

Western Electronics

(309) 687-1311
3311 N Sterling Ave Apt N
Peoria, IL

Regional Articles
- Serve local web pages via name not IP number Addison IL
- Serve local web pages via name not IP number Algonquin IL
- Serve local web pages via name not IP number Alsip IL
- Serve local web pages via name not IP number Alton IL
- Serve local web pages via name not IP number Arlington Heights IL
- Serve local web pages via name not IP number Aurora IL
- Serve local web pages via name not IP number Barrington IL
- Serve local web pages via name not IP number Bartlett IL
- Serve local web pages via name not IP number Batavia IL
- Serve local web pages via name not IP number Belleville IL
- Serve local web pages via name not IP number Bellwood IL
- Serve local web pages via name not IP number Belvidere IL
- Serve local web pages via name not IP number Bensenville IL
- Serve local web pages via name not IP number Berwyn IL
- Serve local web pages via name not IP number Bloomingdale IL
- Serve local web pages via name not IP number Bloomington IL
- Serve local web pages via name not IP number Blue Island IL
- Serve local web pages via name not IP number Bolingbrook IL
- Serve local web pages via name not IP number Bourbonnais IL
- Serve local web pages via name not IP number Bridgeview IL
- Serve local web pages via name not IP number Buffalo Grove IL
- Serve local web pages via name not IP number Calumet City IL
- Serve local web pages via name not IP number Carbondale IL
- Serve local web pages via name not IP number Carol Stream IL
- Serve local web pages via name not IP number Carpentersville IL
- Serve local web pages via name not IP number Champaign IL
- Serve local web pages via name not IP number Chicago Heights IL
- Serve local web pages via name not IP number Chicago IL
- Serve local web pages via name not IP number Cicero IL
- Serve local web pages via name not IP number Clarendon Hills IL
- Serve local web pages via name not IP number Collinsville IL
- Serve local web pages via name not IP number Country Club Hills IL
- Serve local web pages via name not IP number Crete IL
- Serve local web pages via name not IP number Crystal Lake IL
- Serve local web pages via name not IP number Danville IL
- Serve local web pages via name not IP number Decatur IL
- Serve local web pages via name not IP number Deerfield IL
- Serve local web pages via name not IP number Dekalb IL
- Serve local web pages via name not IP number Des Plaines IL
- Serve local web pages via name not IP number Dolton IL
- Serve local web pages via name not IP number Downers Grove IL
- Serve local web pages via name not IP number East Moline IL
- Serve local web pages via name not IP number East Peoria IL
- Serve local web pages via name not IP number East Saint Louis IL
- Serve local web pages via name not IP number Edwardsville IL
- Serve local web pages via name not IP number Effingham IL
- Serve local web pages via name not IP number Elgin IL
- Serve local web pages via name not IP number Elk Grove Village IL
- Serve local web pages via name not IP number Elmhurst IL
- Serve local web pages via name not IP number Elmwood Park IL
- Serve local web pages via name not IP number Evanston IL
- Serve local web pages via name not IP number Evergreen Park IL
- Serve local web pages via name not IP number Fairview Heights IL
- Serve local web pages via name not IP number Franklin Park IL
- Serve local web pages via name not IP number Freeport IL
- Serve local web pages via name not IP number Galesburg IL
- Serve local web pages via name not IP number Glen Ellyn IL
- Serve local web pages via name not IP number Glendale Heights IL
- Serve local web pages via name not IP number Glenview IL
- Serve local web pages via name not IP number Godfrey IL
- Serve local web pages via name not IP number Granite City IL
- Serve local web pages via name not IP number Grayslake IL
- Serve local web pages via name not IP number Gurnee IL
- Serve local web pages via name not IP number Harvey IL
- Serve local web pages via name not IP number Harwood Heights IL
- Serve local web pages via name not IP number Hazel Crest IL
- Serve local web pages via name not IP number Highland Park IL
- Serve local web pages via name not IP number Hinsdale IL
- Serve local web pages via name not IP number Homewood IL
- Serve local web pages via name not IP number Jacksonville IL
- Serve local web pages via name not IP number Joliet IL
- Serve local web pages via name not IP number Kankakee IL
- Serve local web pages via name not IP number Kewanee IL
- Serve local web pages via name not IP number La Grange IL
- Serve local web pages via name not IP number Lake Bluff IL
- Serve local web pages via name not IP number Lake Villa IL
- Serve local web pages via name not IP number Lake Zurich IL
- Serve local web pages via name not IP number Lansing IL
- Serve local web pages via name not IP number Lemont IL
- Serve local web pages via name not IP number Libertyville IL
- Serve local web pages via name not IP number Lisle IL
- Serve local web pages via name not IP number Lockport IL
- Serve local web pages via name not IP number Lombard IL
- Serve local web pages via name not IP number Loves Park IL
- Serve local web pages via name not IP number Machesney Park IL
- Serve local web pages via name not IP number Matteson IL
- Serve local web pages via name not IP number Mattoon IL
- Serve local web pages via name not IP number Maywood IL
- Serve local web pages via name not IP number Mchenry IL
- Serve local web pages via name not IP number Melrose Park IL
- Serve local web pages via name not IP number Midlothian IL
- Serve local web pages via name not IP number Mokena IL
- Serve local web pages via name not IP number Moline IL
- Serve local web pages via name not IP number Morris IL
- Serve local web pages via name not IP number Morton Grove IL
- Serve local web pages via name not IP number Morton IL
- Serve local web pages via name not IP number Mount Prospect IL
- Serve local web pages via name not IP number Mundelein IL
- Serve local web pages via name not IP number Murphysboro IL
- Serve local web pages via name not IP number Naperville IL
- Serve local web pages via name not IP number New Lenox IL
- Serve local web pages via name not IP number Niles IL
- Serve local web pages via name not IP number Normal IL
- Serve local web pages via name not IP number North Chicago IL
- Serve local web pages via name not IP number Northbrook IL
- Serve local web pages via name not IP number O Fallon IL
- Serve local web pages via name not IP number Oak Forest IL
- Serve local web pages via name not IP number Oak Lawn IL
- Serve local web pages via name not IP number Oak Park IL
- Serve local web pages via name not IP number Orland Park IL
- Serve local web pages via name not IP number Palatine IL
- Serve local web pages via name not IP number Palos Hills IL
- Serve local web pages via name not IP number Park Forest IL
- Serve local web pages via name not IP number Park Ridge IL
- Serve local web pages via name not IP number Pekin IL
- Serve local web pages via name not IP number Peoria IL
- Serve local web pages via name not IP number Plainfield IL
- Serve local web pages via name not IP number Prospect Heights IL
- Serve local web pages via name not IP number Quincy IL
- Serve local web pages via name not IP number Riverdale IL
- Serve local web pages via name not IP number Rochelle IL
- Serve local web pages via name not IP number Rock Falls IL
- Serve local web pages via name not IP number Rock Island IL
- Serve local web pages via name not IP number Rockford IL
- Serve local web pages via name not IP number Rolling Meadows IL
- Serve local web pages via name not IP number Romeoville IL
- Serve local web pages via name not IP number Roscoe IL
- Serve local web pages via name not IP number Roselle IL
- Serve local web pages via name not IP number Round Lake IL
- Serve local web pages via name not IP number Saint Charles IL
- Serve local web pages via name not IP number Schaumburg IL
- Serve local web pages via name not IP number Skokie IL
- Serve local web pages via name not IP number South Elgin IL
- Serve local web pages via name not IP number South Holland IL
- Serve local web pages via name not IP number Springfield IL
- Serve local web pages via name not IP number Streamwood IL
- Serve local web pages via name not IP number Streator IL
- Serve local web pages via name not IP number Sycamore IL
- Serve local web pages via name not IP number Taylorville IL
- Serve local web pages via name not IP number Tinley Park IL
- Serve local web pages via name not IP number Urbana IL
- Serve local web pages via name not IP number Vernon Hills IL
- Serve local web pages via name not IP number Villa Park IL
- Serve local web pages via name not IP number Waukegan IL
- Serve local web pages via name not IP number West Chicago IL
- Serve local web pages via name not IP number Westchester IL
- Serve local web pages via name not IP number Westmont IL
- Serve local web pages via name not IP number Wheaton IL
- Serve local web pages via name not IP number Wheeling IL
- Serve local web pages via name not IP number Wilmette IL
- Serve local web pages via name not IP number Wood Dale IL
- Serve local web pages via name not IP number Woodridge IL
- Serve local web pages via name not IP number Woodstock IL
- Serve local web pages via name not IP number Zion IL
Related Local Events
Electronics Assembly Show
Dates: 9/21/2009 - 9/24/2009
Location: Donald E. Stephens Convention Center
Rosemont, IL
View Details

Electronics Assembly Show
Dates: 9/21/2009 - 9/24/2009
Location: Donald E Stephens Convention Center
Rosemont, IL
View Details

Assembly Technology Expo
Dates: 9/21/2009 - 9/24/2009
Location: Donald E Stephens Convention Center
Rosemont, IL
View Details

AD:TECH CHICAGO 2009
Dates: 9/1/2009 - 9/2/2009
Location: Navy Pier
Chicago, IL
View Details

FITC Chicago
Dates: 6/22/2009 - 6/23/2009
Location: Lakeshore Theater, Chicago
Chicago, IL
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Advertising Family Home Services Real Estate Resources
Business Services Fashion Industrial Goods & Services Retail & Consumer Services
Career Financial Services Insurance Software
Cars Food & Beverage Internet Technology
Computer Hardware Franchise Legal Telecommunications
Construction Health Miscellaneous Trade Shows
Education Holidays Nightlife Travel
Entertainment Home Appliances Online Database Weddings
Environmental Home Electronics Pets World History