Friday, February 5, 2010

How to set up a personal home web server


client-server-model.jpgA web server is software that continuously runs on a computer and allows other computers to download documents from it. This text that you're reading right travelled over a network connection from Lifehacker's hosting web server to your browser. Web servers are usually loud, scary, headless machines in cold windowless rooms, but you can run one under your desk at home.

Why would you want to run a home web server? Maybe you want to download files on your home computer from anywhere. Like, say, your digital music collection. In this how-to, we'll set up a home web server that lets anyone (with the right password!) connect to your computer and download your MP3's from it, for a nice way to share your music collection with friends, or play a song from your home machine at the office for co-workers.

Please note: Running a server on your home computer is a risky undertaking, and before you start, make sure your computer has all the latest patches and security updates, and that you've done a thorough spyware and virus scan. This tutorial is for advanced users who feel comfortable editing textual configuration files and exposing port 80 on their home computer to the internet. As always, a strong firewall with explicit user-set rules is recommended. Still game? Carry on.

Let's get started.

What you'll need:

  1. A Windows PC
  2. An always-on broadband (DSL or cable) internet connection

Step 1. Install Apache HTTP server.

First and foremost, disable and stop any other firewall or server software you may have running, including Windows Firewall, Skype, Trillian or any other instant messaging applications. This is extremely important, and if it's not done, can cause the server installation and startup to fail miserably. These programs and services can be started and used again as usual once we're done setting up the web server.

Download Apache HTTP Server from here, using the link next to "Win32 Binary (MSI Installer)." Start the installation wizard. Accept the license agreement and use the default location for the Apache files, inC:\Program Files\Apache Software Foundation\Apache2.2\. When you reach the screen prompting for server information, enter your own email address and homeip.net as the domain information, like so:

Complete the installation wizard using the "Typical installation" setting.

When it's done, open your web browser and go to http://localhost/. If the page you see reads, "If you can see this, it means that the installation of the Apache web server software on this system was successful," you're golden.

Step 2. Configure Apache to share documents from the right folder.

Say you want to make your music collection downloadable using your new web server, and all your music files are located inC:\Gina\My Music. Using a plain text editor like Notepad, open theC:\Program Files\Apache Group\Apache2\conf\httpd.conf file. This is Apache's configuration file, which looks long and scary, but most of the defaults will work just fine for us. We just have to change a few things.

In this httpd.conf file, comment out the line that starts with DocumentRoot and add another with your directory, like this:

#DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs" DocumentRoot "C:/Gina/My Music" 

Then, comment out the line that starts with

#  

Last, about 20 lines below that

AllowOverride None 

Change it to:

AllowOverride All 

When you're done, save httpd.conf. Then, click on the Apache icon in your taskbar and choose "Restart." If Apache restarts successfully, you edited your the file correctly. Visit http://localhost/ in your web browser. This time you should see a listing of your music files. Woo-hoo!

Step 3. Password your web site documents.

But we don't want just anyone to be able to download your music. Your bandwidth is precious, and we want to secure things a bit. Let's create a password prompt.

First, open a command prompt (go to the Start menu, choose Run, then type cmd.) Change to the Apache bin directory by typing:

cd "C:\Program Files\Apache Software Foundation\Apache2.2\bin" 

Then create a password file by typing:

htpasswd -c "C:\Documents and Settings\Gina\my_password_file.txt" gina 

Replace the path with the path of your new password file (which should in any folder EXCEPT the web server's document root.) Replace gina with the username you want to use. When prompted, enter the password you want to set up. Once you've done that, a password file will be created.

Now we want to apply that login to your music directory. Open up a new file in a plain text editor like Notepad. Copy and paste the following into it:

AuthType Basic AuthName "This is a private area, please log in"   AuthUserFile "c:\Documents and Settings\Gina\my_password_file.txt" AuthGroupFile /dev/null    require valid-user  

Make sure you replace "C:\Documents and Settings\Gina\my_password_file.txt"in the text with your own password file created above. Save this new file IN YOUR WEB SERVER DOCUMENT ROOT (in this case, C:\Gina\My Music) and name it .htaccess. Don't forget the dot in the beginning, before .htaccess. So, in this case, we're saving the file as C:\Gina\My Music\ .htaccess.

Note: If you're using Notepad to create your .htaccess file, when you save the file, put quotes around the filename - ".htaccess" - so that Notepad doesn't automatically put a .txt extension on the file. If there's a .txt file extension, your password won't work!

Now, using your web browser, go to http://localhost/. You should be prompted to log in. Enter your username and password you set up in your password file. Rock!

Step 4. Congratulate yourself. You've got a home webserver running.

If you are NOT behind a firewall, you can access your web server from other computers by typing your computer's IP address into a web browser's address bar. If you're not sure what your IP is, visit What Is My IP to find out. If your IP is 12.34.567.890, then type http://12.34.567.890 into a browser's address bar.

If you ARE behind a firewall (like a wireless router), you'll need to open up port 80 on the firewall and forward it to your computer. How to access a home server behind a firewall.

How to set up a home FTP server

A home FTP server is useful to anyone who wants to save and retrieve files on their computer from anywhere.

The main advantage of a home FTP server over a web server is that you can save files to the server, whereas with a web server, you can only get files. The disadvantage of a home FTP server is that you need an FTP client to connect to it, whereas web servers can be accessed using a plain old web browser. However, many modern web browsers support the FTP protocol. Instead of prefacing the URL with http://, use ftp://. That said, most web browsers make crappy FTP clients. You should use a more fully-featured FTP client to conect to your server like SmartFTP or WS_FTP wherever possible.

Let's get started.

What you'll need:

  1. A Windows PC
  2. An always-on broadband (DSL or cable) internet connection

Step 1: Download and install Serv-U FTP

Serv-U FTP is a nice windows FTP server app that has a simple to use interface. It's been around for years — I've used it since 1997 and it works flawlessly. The newest version adds more security through SSL support and the best part of all is that the personal version which allows for two FTP logins is completely free.

Now, don't get confused because they have several levels of pricing and several editions, but you can download a single package from here that includes all versions. Once installed, you will have a "corporate edition" that after thirty days will become the "personal edition." If you follow along this tutorial, you won't be using any special features so you shouldn't see anything change once the application reverts to the free version. And by all means, if you decide to use this on a machine at work, make your employer pay for a license, but as long as this is on your home computer, free personal use is fine.

Step 2: Complete setup and create a user login

After the initial setup is done, Serv-U should start the administrator and ask you to create a new user account. Start off by first putting in the domain name you used to setup your dynamic DNS. The names I'm using in these figures are for demonstration purposes. (Click to enlarge image.)

To keep your FTP server for your own use, be sure to disable Anonymous access by selecting "No" when asked.

When it asks for your Home Directory, it's probably best to just say C:\ for your home windows machine. This will give you easy access to any file on the main drive. Be sure you say No to locking your own user in the home directory, otherwise you might not be allowed to switch to other drives.

Step 3: Grant proper rights to any drives you have

When you are done creating a new user account, start the FTP server and the Serv-U Administrator application. Expand the Domains tree to show your server, then the Users tree to find your account. With your user selected, click the Dir Access tab on the right pane, as shown. (Click to enlarge.)

Highlight the drive letter and fill all the checkboxes on the right side except for "Execute". This will give you total access to upload, download, delete, create, and make any directory changes as well. If you're nervous about your account having too much access, you can probably get away with just read or read and write access for most things. Also be sure to add any other drives on your computer (I have a second hard drive with the letter E:\ on mine, as shown in the figure).

Step 4: Be sure you have outside access to your new FTP server

Like many of you reading this, I have a router/firewall/wireless access point at home that shares my broadband connection with every internet device in the house. Most router/firewall/wireless points hand out internal IP addresses and keep your computers safely away from outside access, but if you're running your own FTP or web server at home, you'll want to poke a hole in the firewall and map port 21 to your home computer running Serv-U.

Here's a screenshot of my D-Link wireless router's advanced settings page where I'm mapping port 21 to my home computer, which is known by the internal-only 192.168.1.1 IP address.

For regular FTP connections, map port 21 to your computer, for secure FTP connections, map port 990 to your computer on the network (or just map both).

Step 5: Test it out

The last thing to do is to test out your FTP server by firing up a FTP client and try connecting to your own server. Even though you are using the very computer you are testing, if you try to FTP using the outside address (your dynamic DNS name), it will be exactly like connecting from the outside.

Here's a partial screenshot of me using WS_FTP Pro. On the right pane, I'm connected to my own FTP server (I called it "home" and saved it to a profile) and I'm looking at my desktop files. (Click to enlarge.)

Optional Super Bonus Step 6: Keep your FTP secure like Fort Knox

The last step is optional, and depends on how you will access your home server's FTP. If you share a large corporate network or ever want to access your home server from an open wireless access point, by all means set Serv-U to allow secure (SSL) connections. This will encrypt your password and any files that are transmitted, keeping prying eyes from knowing how to access your home server or what you did during your connections.

It's pretty easy to do in Serv-U. Bring up your Serv-U Administrator application, click your home server's domain name under the Domains area. On the right pane, there is a setting marked Security and change the pull-down to Allow SSL/TLS and regular sessions (see below) or for even more security set it to Allow only SSL/TLS sessions. Then hit Apply to save this setting.

When you connect to it the first time, you might get a warning about a bogus certificate provided by Serv-U. Just set your FTP program to always trust it and you won't see this warning again.

That's it. Now you'll never forget a file at home because anything on your home computer will be accessible from anywhere else on earth.

Create your own virtual private network with Hamachi

You can do things between computers on your local network you can't from out on the internet: like listen to a shared iTunes library or access files in shared folders. But using the free virtual private network applicationHamachi, you can access your computer from anywhere on the internet as if you were home on your local network.

Today we'll use Hamachi to create a virtual private network between a PC and Mac and listen to a shared iTunes library over the internet.

What's Hamachi VPN?

The free Hamachi desktop application gives you secure, zero-configuration LAN over the internet. Any app that works over a local network can be used with Hamachi over the internet, like Windows file sharing, iTunes, Remote Desktop, FTP, VNC and gaming. All of Hamachi's connections are secure, encrypted, authenticated and peer-to-peer. Though Hamachi acts as a mediator between your computers and creates the tunnel for their communication, Hamachi's servers don't listen in on or log your activity.

Some situations you might use Hamachi:

  • You're on the road with your laptop and want secure access to your PC's files.
  • Your office or dorm room computer is behind a restrictive firewall that doesn't let you reach it from the internet.
  • You want to add encryption to insecure network protocols like VNC.
  • You want to set up a shared folder of files for friends and family to access.

Sound useful? Let's get started.

Set up Hamachi

  1. Download and install Hamachi. For the most part, the Windows installation is the usual "just click next" routine, except for two notes: Hamachi will attempt to install a virtual network adapter which Windows XP says is not supported. - just hit the "Continue Anyway" button at that point. Also, if you have Windows Firewall enabled (or any firewall, for that matter), it will ask if you want to allow traffic to and from the Hamachi client. You do. Click the "Unblock" button to allow Hamachi traffic through your firewall, as shown.


  2. Create your Hamachi network. Once Hamachi's installed it will walk you through a quick tutorial to get you started. Read it - it's worth it. Then, hit the network button (bottom right hand corner, second button to the left) and choose "Create new network" from the menu. Give your network a name (mine was "gtrap-home") and a password (if you'd like.) Click the Create button.

    Now your computer will be a member of the new network, and get its own Hamachi IP address (in addition to its regular IP address). It will also have a nickname that will identify it on your network. Mine was "dell-pc."
  3. Join your Hamachi network. At this point you can tell your friends or co-workers your Hamachi network's name and password so they too can join it with the Hamachi client installed. To connect my Mac to my new network, I issued a hamachi join gtrap-home command after setting my nickname to "powerbook." Once my Mac was on the network, the Hamachi client looked like this.
  4. Network away! Now you're ready to share files or stream your iTunes library to other computers in your Hamachi virtual home network. Within iTunes on my PC I turned sharing on and tried to listen on my Mac. At first the sharing didn't work because Windows Firewall wasn't allowing it. Once I opened up port 3689 (iTunes sharing port) within Windows Firewall, I was all set. Go to Windows Firewall settings in Control panel and open up the iTunes port as shown (click to enlarge):

    Then, I could see and play tunes in my PC's shared library within iTunes on my Mac. (Be sure to check off "Look for shared libraries" in iTunes' Preferences Sharing panel.)

Finally, you can manage your Hamachi networks and clients through a web interface as well. Register for a free account at My Hamachi and enter your client's Hamachi IP. Once you grant the web site access to your network information, view all your networks and clients on the web site, like this (click to enlarge):

Streaming music (and, uh, copying songs from others' shared iTunes libraries) is only one example of what can be done with your virtual home network. Browse shared Windows folders, remote control your PC, access an FTP or web server (over Hamachi's encrypted connection). Anything you can do locally you can do over the 'net with Hamachi.

Wednesday, February 3, 2010

Your user profile was not loaded correctly! You have been logged on with a temporary profile.

Try these steps:

  1. Log on with local administrator account, preferably in safe mode. To boot the machine in safe mode, Click F8 during boot.
  2. Click Start + Run and type in regedit and then Enter.
  3. Open HKEY_LOCAL_MACHINE
  4. Open Software
  5. Open Microsoft
  6. Open Windows NT
  7. Open Current Version
  8. Open ProfileList
  9. Here you will see keys that belong to each profile. To find your problematic profile navigate to each key and refer to the ProfileImagePath entry on the right hand side.
  10. Once you find your problematic profile, just delete the key. This means delete the folder on the left hand side tree view that contains your alias in the ProfileImagePath entry.
  11. Restart machine.

There is another way you can actually backup your profile and create a new one.

Click on “Start”, Right click “Computer” and go to “properties”

Click on “Change Settings”

image

Go to the “Advanced” tab and click on User Profiles “Settings” button

image

image

“Change type” will allow you to change your profile type between Roaming and Local Profiles

“Delete” will delete that profile. Including the registry entries and everything.

“Copy To” will back up your profile. It is always advisable to backup your profile from here rather than from anywhere else. Your profile contains more than you can see. Hidden Files, System Files, etc. This takes care of everything in a safe manner.


Monday, February 1, 2010

What Is the Active Directory Installation Wizard?

Active Directory is not installed by default on a computer running Windows Server 2003. When you install Windows Server 2003, the computer assumes the role of a standalone server or a member server that is a part of a domain. For the computer to become a domain controller, you must use the Active Directory Installation Wizard to install and configure Active Directory. Read more.......

What Is DNS?

Domain Name System (DNS) is one of the industry-standard suite of protocols that comprise TCP/IP. Microsoft Windows Server 2003. DNS is implemented using two software components: the DNS server and the DNS client (or resolver). Both components are run as background service applications. Read more

Show hidden files / Show or hide file name extensions in Vista

Follow these steps to display hidden files and folders.

  1. Click to open Folder Options.

  2. Click the View tab.

  3. Under Advanced settings, click Show hidden files and folders, and then click OK.

    ...........................................................................

    Show or hide file name extensions

    A file name extension is a set of characters added to the end of a file name that determine which program should open it. Follow these steps to choose whether Windows displays these file extensions.

    1. Click to open Folder Options.

    2. Click the View tab, and then, under Advanced settings, do one of the following:

      • To hide file extensions, select the Hide extensions for known file types check box, and then click OK.

      • To display file extensions, clear the Hide extensions for known file types check box, and then click OK.