Friday 29 June 2012

Be the Master of Your Own Domain With a DIY Webserver

Summary:


[[Image:ServerRacks.jpg|630px|thumb|left|Get on your own personal cloud. Photo by Ciprian Popescu/[http://www.flickr.com/photos/getbutterfly/6317955134/ flickr]/CC]]

If you've ever spent a minute investigating anything related to creating a website (which, chances are you have, dear Wired reader whose demographic we know intimately), you've likely been bombarded with advertisements from companies offering to host your new site or provide you with server space to store your files on an internet database. Relax ? you don't have to sift through a storm of cloud services to figure out which is right for you. With a little education and patience, you can create your very own webserver that does whatever you want, free of charge.

''This article was written by How-To Editorial Assistant Jack Donovan, who uses his own home server to keep his head in the cloud.''

==File Servers With Apache==

If you?re looking for simple and unlimited cloud storage, then you need nothing more than an Apache HTTP setup for your server box or home computer. After downloading the Apache installer for your operating system from the [http://httpd.apache.org/download.cgi download site], install it using the default settings and call the server and domain settings to any web address you want ? they'll just be placeholders for now. Once the installation completes, type http://localhost in your browser?s address bar. If you see a bold message that says ?It works,? you?ve got yourself a server going.

Next, you?ll need to populate the server with whatever files you?d like to house on it. Navigate to the directory that Apache was installed to and look for the folder called ''htdocs''. Inside this folder, you?ll see the file ''index.html''; this is the basic web page that told you your server was running when you first connected. If there is ever an HTML document named ''index'' in this folder, Apache will always load it as the page that outwardly displays to the world for your server when you access it through a browser. For a personal file server, though, you don?t need a pretty front-end, so feel free to get rid of that page and replace it with whatever files you?d like on the network. This way it will just appear as a simple index page.

After you?ve put your music, documents, photos or videos into the htdocs folder, open up Apache and restart the server. Then check your internal IP address (''ipconfig'' on Windows, ''ifconfig'' on Linux or Mac) and type it into the address bar. Once you press enter, you?ll be taken to a list of all of your files, which can be streamed or downloaded from any device on your home network. You just got served.

==Dynamic Web Pages==

If you're looking to turn your server outwards to the world, you'll probably want something that looks nicer than a simple file index. To do this, it's necessary to install some tools on top of your basic HTTP server application ? namely [http://en.wikipedia.org/wiki/PHP PHP] and [http://en.wikipedia.org/wiki/MySQL MySQL]. The combination of these two services in addition to a basic Apache framework is what makes up the common AMP (Apache/MySQL/PHP) architecture (known as WAMP, LAMP, or MAMP based on your operating system). Performing these installations used to take hours and require advanced tinkering with config files, but now there's an easy single installer for every major operating system.

===Windows===

For Windows users, the best way to house an all-encompassing server suite is to download and install [http://www.wampserver.com/en/ WAMPServer], an open-source application that installs all components of a WAMP setup in one easy shot. From WAMPServer, you can make changes to the Apache, PHP and MySQL configurations, and switch web connectivity on and off with one click. Nothing needs to be done with WAMPServer when it's installed, so the only work you'll need to do is follow the instructions for your desired PHP framework, such as MediaWiki or WordPress.

===Linux===

The LAMP architecture is the most favored server architecture among veteran web monkeys and networking hobbyists alike. The installation for LAMP components is also fairly easy if you're using Ubuntu, Debian, or any APT-based operating systems. Just open Terminal and type the following commands:

''sudo apt-get install tasksel''

''sudo tasksel install lamp-server''

Once you're done, simply install your desired PHP framework and get to coding!

===Mac OS X===

Mac OS X, although not used abundantly in the server world, has an extremely simple AMP installer called MAMP. Download the installer from the MAMP website and install it as you would any other application, and you're ready to go. Make sure and familiarize yourself with the different directories that MAMP creates, and then apply your PHP architecture of choice using the architecture?s install documentation.

==Live to Serve==

Once your file server or flashy website is up and running, you?ll probably want to show it off to more people than just your roommate or mom. However, in order to access the server from outside your home network, you need to configure your computer and router firewalls to allow outside connections through port 80, which is the standard port for HTTP traffic.

===Router Firewall===

To create a new exception for your server on your router?s firewall, navigate to your router administration page and look for the area that?s labeled ''Port Forwarding''. Click into this section and add a forwarding rule on port 80 by entering your computer?s internal IP address when it prompts for a forwarding address. This basically tells your router to forward all hypertext requests to your server, and not to any other devices that may be connected to your network.

===Computer Firewall===

Adding an exception to your server box?s firewall is a very similar process. Open your Firewall Settings page in your preferences area or control panel, look for TCP/IP rules, and add a rule that allows incoming access to port 80. Keep in mind that opening up your server to the Cold Wide Web could potentially invite some baddies into your network, so make sure to [http://httpd.apache.org/docs/2.0/howto/auth.html password protect your server] if you plan on leaving the door open.

[[Category:Computers]]
[[Category:DIY]]
[[Category:Internet]]


Source: http://feeds.wired.com/~r/howtowiki/~3/lPNbzqaBrpw/Be_the_Master_of_Your_Own_Domain_With_a_DIY_Webserver

coolest gadgets desktop gadgets awesome gadgets gadget

No comments:

Post a Comment