Setting Up A Simple Web Server

You don’t need to set up a web server in order to automate the delivery of your information products. This section is for people who don’t want to pay a cent for hosting their downloadable information products and web sites. Hosting your own web pages gives you much more hard drive space and easier control of your HTML documents. This section will also go over typical issues when setting up a web server and a solution for each issue.

Internet Service Providers (ISP’s)

Here is a little information on most Internet Service Providers (ISP’s). If you’re on a basic ADSL or Cable package, then chances are you have some restrictions on your Internet account. Common limitations are certain port blockages, and IP address assignment process. First, let’s look at ports.

Ports

Ports are used for communication on the Internet. There are a lot of them, and knowing what they all do is not important for this document. What is important is that your ISP may be blocking you from accepting requests on port 80, which is the HTTP (Hypertext Transfer Protocol) port. HTTP allows you to surf the Internet. If you look at the address bar on your browser, you will always see “HTTP”. This means that you can access the Internet on an outgoing basis, but you can’t accept incoming HTTP connections. Why? Think of your ISP as doing you a favor. By blocking port 80, they are eliminating the chance of your computer from ACCEPTING viruses, spyware, and all sorts of other malicious activity. The problem is, this also blocks your ability of accepting other HTTP (port 80) requests, therefore preventing you from being a web server. To find out if your port 80 is blocked, you will either have to go to your ISP’s web site and find your license agreement, or call their technical support line and ask. Either way, this problem is easily solved in the next few pages. We will now move on to the next issue, IP Address Assignment.

IP Address Assignment

An IP (Internet Protocol) address is a unique identifier that gives your computer a “home” on the World Wide Web. Most basic Internet packages, including all dial-up connections, work on a dynamic IP address assignment process. The problem this causes is that if your IP address is always changing, how is anyone supposed to find your “home”? It would be like you lived in your house for 5 hours, and then left. Even your trusty mailman would get confused! One solution is to call your ISP and get your Internet package upgraded to a business plan, which will change your IP from dynamic to static, but at an extra cost. The other is to use a great free tool that we will explain in the next section.

To find out your IP address, click “Start”, then Run, type “Command”, click “OK”. When the black window, known as the “Command” window opens, type “ipconfig /all”. This will yield your current IP configuration. If you see a line that says “Lease Expires”, and it’s soon, then you definitely have a dynamic IP. Don’t worry if it expires soon, you’ll get a new one as soon as it does. You will also notice a 4-octet number, seperated by 3 periods next to its appropriate description, “IP Address”. This is your IP address.

No-IP.com

Who is No-IP?

These guys are great!

Before we get into it, lets define what a domain name is. A domain name is a alphanumeric representation of your IP address. In other words, any “www” name you enter into your address bar actually reflects an IP address. If you open up your command window again and type “ping www.articleautomate.com”, you will notice there is an IP
address in square brackets next to my domain name in the results.

Now, let’s move on.

First, No-IP will give you a web name and you don’t even have to pay for it! That means you don’t have to purchase a domain name. Any “www” address you see in your address bar is a domain name. When you use No-IP.com, you will receive a domain name that looks like www.yourname.no-ip.com. Notice the “no-IP” part. Since No-IP.com is a free service, they add that to your “www” name. This is fine because the purpose of your site is to serve your articles to your customers through your eBay and Paypal “Instant Purchase” sales, although you can also serve web pages. Your domain name also remains easy to remember.

Second, your dynamic IP address issue simply disappears. No-IP.com has developed a free piece of software that you download from them and install on your PC. What it does is monitor your IP address, and when your IP changes, it tells the No- IP.com server, which updates your “www” name to reflect your new IP address.

No-IP.com Registration

Now that you understand what No-IP is, you are ready to go out and get registered. Click the link below, find their “Sign-up Free” link, and fill in the blanks.

www.articleautomate.com/no-ip

Once you have fully registered, you will receive a confirmation email. Follow the directions on the email. Next, log into your No-IP.com account, and click on the “Add” link under the “Hosts/Redirects” header.

The “Hostname” textbox is where you will enter your “www” name, and the dropdown is the No-IP.com extension of your choice.

If your ISP does not block port 80 then you don’t need to do any port redirecting. Just click the “Create Host” button at the bottom of the page.

If your ISP does block port 80 then click on the “Port 80 Redirect”. A new page will load, but will look almost the same. For the “Port”, enter 8000. Click the “Create Port Redirect” at the bottom of the page.

Registration is complete – on to the software!

Click on the “Downloads” tab at the top and then click “Windows” on the left column. Click on the No-IP DUC v x.x.x link. (x.x.x because the version is always changing)

Follow the wizard to install the program. Once installation is complete, you will be prompted for the email address and password you entered during registration. After entering this, the console will open. Turn to the next page to see what your console will look like.

console

Notice the smiley face. That means the No-IP.com server has been updated with your current IP address.

Now that you have your domain name set up, you have to start hosting your pages! The next section will introduce you to an excellent program called Abyss Web Server by Aprelium.

Abyss Web Server

What is Abyss?

Simply put, Abyss is a free personal web server for Windows, MacOS X, Linux, and FreeBSD. Abyss is just a web server, and does not allow for any FTP protocol. You can access your console remotely to update directory and user settings, but you can’t upload any files unless you are at the computer running the web server.

Installation

Click on the following link:
www.articleautomate.com\abyss

Find the “Download” link under the “Software Resources” header near the bottom of the page. Click on the “Download Abyss Web Server X1 for Windows” link and install the software.

Once the installation is complete, you will be asked for a username and a password. This identifier will then be your login to your web server. You will also see the Abyss icon in your system tray. After entering your login info, you will be prompted again for a username and password. You will always be prompted for your login information with this screen whenever you start your console.

You should get a console that looks something like this:

console

Do not change the “Server Root”. This is where your web server runs.

Change your “Documents Path” to the path you wish to host your pages from. For this book, I will use “c:\article”.

If your “Port” isn’t already set to 8000, do that now.

Any changes that you make will require a server restart, which is nothing more than clicking a button when you are prompted.

If you ever need to access your console again, right click on the Abyss icon in the system tray, and select “Show Console”. Please take into consideration that we have only skimmed the surface with Abyss Web Server and that there is much more to learn about it, such as setting up directory and user permissions, and your access statistics.

We will now move on to a “suggested” method of setting up your web server directory.

Directory Structure

Before you start creating HTML and putting your article online, you may want to look at how you want your web server’s file system to be set up. I have found that it is easier to maintain when you have the following setup: For this example, I have set my “Documents Path” to c:\article. To create a directory, read “Directory Creation”.

Take a look at the image below:

console

You will notice that we are in the article directory, and there is an index.htm file. This file will be your website’s home page. Next, you will see an images folder and a widgets folder. You will store all of your website’s images in the image folder. The widgets folder will contain another “index.html” file, which will contain the download link to your article.

Directory Creation

To create your “article” directory:

1. Right-Click the “Start” menu.
2. Click on “Explore”.
3. Navigate through the tree until you find “C:” and click on it.
4. In the right window pane, right-click on some white-space, and select “New”, then “Folder”.
5. Name your folder “article”.

Follow this process to create your “images” and “widgets” directory. We will look at creating your “index.html” file in Section 4 or this article.

Test Your Server

Next, test your server. Run the “ipconfig” command, and write down your IP address. Open a new web browser and in the address bar type: yo.ur.ip.addy:8000/

If you get the Paypal button you created and tested earlier, you have correctly installed Abyss. Notice the “8000”. This directs the website to your port 8000. If you decide to run your server on a different port, you will need to change this figure to be the same.

Now try your No-IP domain name “http://yourname.no-ip.com”. Notice that your address bar changes to your IP address?

If you don’t want the address to change to your IP, then you will have to log into your No-IP account and edit your Host settings from “Port 80 Redirect” to “DNS Host,” but the difference will be that your domain will look like www.yourname.no-ip.com:8000.

Troubleshooting

If you experience problems, such as “error 404 - Page cannot be found”, then try some of these suggestions:

1. Make sure there is an “index.html” file in your “c:\article” directory.
2. Make sure your “Documents Path” is set to “c:\article”
3. Make sure you see the following icons in your system tray (bottom right):
4. Make sure your web address DOES NOT contain a “WWW” in it. It should follow this exact protocol: yourname.no-ip.com.

If all none of these suggesstions work, the following link:
www.articleautomate.com/serverhelp

Freebsd Installation Guide

A step-by-step guide to installin’ FreeBSD 5. It assumes moderate experience with linux and leaves you with a fully updated FreeBSD system.

FreeBSD Installation

A. 5.x vs 4.x
The first thin’ to understand about FreeBSD is that dere are two lines of development. The -STABLE branch is marked with a 4.x version number and de most recent version is 4.10. It is well tested and very solid, but does not include de most recent technology. The -CURRENT branch, marked with a 5.x version, is de “unstable” branch. However, it is nicely stable at de moment and is comin’ alon’ quite well. Most users should go with 5.x and dese instructions are only valid for that tree.

NOTE: DragonFlyBSD ( www.dragonflybsd.org ) is a continuation of de 4.x line. It uses lock-less (no mutexes) SMP support and a Light Weight Kernel Threadin’ system. It has a lot of promise and is developin’ at a breakneck pace, but it should still be thought of as “R/D.”

B. Gettin’ Media
I am not goin’ to say much about this. There are links to various ftp mirrors at www.freebsd.org and de directory structure is fairly self-explanatory. There are however several choices for ISO. You should choose de miniinst ISO. It is small and will include everythin’ you need for de base system.

C. Startin’ Installation
After, de CD boots up you will enter de…ahh…..majestic sysinstall. You can safely ignore most of de options and just choose a standard installation. Most of de install process is pretty easy and anyone who has some experience with linux or unix will be able to handle it without much stress. However, creatin’ partitions and dealin’ with drives will seem very odd to your standard linux user.

D. Hard Disc Management in FreeBSD
Ok, de first thin’ to get used to here is that IDE drives are not hda, hdb…etc. They are ad0, ad1 and so forth. SCSI discs are da0, da1…and so on. There is one oder thin’ that is goin’ to freak some people out. You create slices, not partitions, on de disc and den create partitions within those slices. For example, de first partition in de first slice on de first IDE disc would be ad0s1a. Just accept it.

E. Partitionin’
Sysinstall will lead you through de partitionin’ and its fairly easy to understand. The first part will ask you to choose a disc or discs to partition and den will show you a “slice editor.” This is where you will create your slice. I advise you to only make one. While multiple slices are easy to deal with, it just adds complication. If this is not your first installation of a BSD type OS, den you can ignore me and why are you readin’ this again?

After creatin’ your slice, you will be prompted to choose de drive(s) to install an MBR on. The FreeBSD boot loader is nothin’ to write home about, but it tends towards workin’. After this step, you can create partitions. There is not much to say here. At de top of de screen it will show your slice(s) and when one of them is selected you can use de controls to create a partition on it. You will need at least a root and swap partition. On de non-swap partitions it is usually a good idea to enable soft-updates.

F. Distribution Sets
This is a simple section, select minimal.

G. Continue Installation
The rest of this is pretty simple. Make sure you install from de CD and not de Internet. The bulk of de install is now done. After it copies files to your disc, it will start de configuration process. This is all pretty self-evident, but dere are a couple thin’s you should know.

Network Configuration

Don’t be scared by de names, in *BSD devices are named after deir drivers. There is also a short description after de name, so you should be able to choose de right one. The rest of de network config is easy, just follow de prompts.

System Console Configuration

You can pretty much ignore this, you may want to look around for your own knowledge and of course you could pick a nice screen saver here, but oder den that I would leave it alone for now.

Time Zone

All I have to say here is that if you live in de US, after you choose “America – North and South” hit de end key. The US is at de bottom of de list and hittin’ end is de quickest way dere.

Linux

Say no, we will do this later and with an updated linux_base.

Mouse

OK, welcome to de wonderful and amazin’ world of moused. Answer de first question truthfully, and den you can tweak de settin’s in de “Please configure your mouse” dialog. Whatever you do, be sure to enable de daemon. Also, for most users that is all you will have to do. You can safely ignore de oder options.

Package Installation

At this point, de installer will ask you to install binary packages. Say no. These binaries are out of date and not included on our CD.

Of users and roots

This isn’t de most thrillin’ section, add a user when it asks you to and set a root password after that. The only thin’ I have to say about this process is when de new user dialog comes up leave de “Group:” box unchanged and add “wheel” to de Member groups. You also might want to set your shell to /bin/tcsh. As for settin’ de root password, if you can’t handle that we have bigger problems.

Rebootin’

Ok, next it will ask if you would like to visit de general config area. Select no and you will be brought back to de main menu. Exit de install, reboot without de CD in and enjoy de boot messages.

H. The Real Post-Install
At this point, I am goin’ to assume that you are now lookin’ at a login prompt and thinkin’ “my my…FreeBSD boots quite quickly doesn’t it.” Well, our task is not done yet…dere is a reason we did a minimal install. We are goin’ to do most of it ourselves. First, lets upgrade to -CURRENT. This isn’t a practice I would usually recommend, but 5.x is close to bein’ tagged stable and -CURRENT is rader solid at de moment. First, I need to explain how thin’s are done in de BSD world.

CVS up; you up; we all CVSUP. Cvsup is a very interestin’ program that I am not goin’ to explain in detail here. All you really need to know is that it updates source trees. You see, that is de thin’. You may be used to /usr/src not doin’ much. In BSD it has a job, it holds de source for de entire base system. However, we did a minimal install and no source is dere. It wouldn’t be up2date anyway. So, lets fix that. Login as root and type de followin’: pkg_add -r cvsup-without-gui

pkg_add is de binary installer for FreeBSD and de -r argument tells it to fetch binaries from de net. It will also fetch any deps that you might need. Switch to anoder console while this is happenin’ and login as root. Do de followin’:

cd /etc

cp /usr/share/examples/etc/make.conf /etc/make.conf

cp /usr/share/examples/cvsup/standard-supfile /usr

cp /usr/share/examples/cvsup/ports-supfile /usr

chmod u+w /etc/make.conf /usr/standard-supfile /usr/ports-supfile

What was that? Well here is de rundown. Make.conf is de file that controls de buildin’ of programs from source on FreeBSD and de supfiles tell cvsup where to get de source for de base system and de ports system, also where to put said source. They come out of /usr/share/examples without de write bit set and that gets annoyin’. So we set that. Now switch back to de first console and type rehash. This tells tcsh to check its path for new programs. Now, edit de standard supfile that is in /usr. You can eider use ee or vi. I like vi. Scroll down to de line that looks a bit odd. It will be somethin’ like:

*default host=CHANGE_THIS.FreeBSD.org

The “CHANGE_THIS” is where you put what cvsup server to use. Choose a number between 1 and 9, like 4, and put cvsup4 where CHANGE_THIS is. So it would end up bein’:

*default host=cvsup4.FreeBSD.org

Now exit your editor and run cvsup /usr/standard-supfile

If everythin’ goes correctly, you will see a lot of text scrollin’ on de screen. If it says somethin’ about a bad connection, try anoder number.

Make.conf

Now ’tis de time for all good men (and women) to edit deir make.conf . This is not difficult, in fact have a look around de file. It may be lon’, but it is pretty simple. Now, uncomment de CPU settin’ and de CFLAGS settin’. Set de CPU to your CPU (dere will be a list in de comments above de settin’) and set de CFLAGS to -O2. (NOTE: If de base system fails to build, down’rade your CFLAGS back to -O).

Build Your World

When CVSUP finishes (it will be awhile…go get some coffee), cd to /usr/src and run make buildworld. That command will do exactly what it sounds like. It builds your world, or base system. While its doin’ that, lets get you a kernel. First, cd to /usr/src/sys/i386/conf den cp GENERIC to some file of your choosin’. Any name you want. However, be aware that this is goin’ to show up in a uname -a. Now, crack open your new file and take a look at what a FreeBSD kernel config is like. There are many thin’s you can do here that will improve performance and subtract in size. However, lets keep it simple. Near de top of de file will be de name GENERIC. Change that to your new name. You can now look through de file and you will find several sections that are just for debuggin’. These will indeed add size and slow down de kernel a bit, but I would leave them for now. Go to de end of de file and make a new line. Add de followin’:

device pcm

This will add sound support to de kernel. Be aware that you don’t need to do this, you can load binary modules at boot or after boot, but this way is easy and sound is used often. Save de file and exit. Go back to your buildworld console and when its done execute make buildkernel KERNCONF=YOUR_KERNEL_CONFIG_NAME

NOTE: NOT THE PATH OF THE KERNEL CONFIG..it knows to look in /usr/src/sys/i386/conf

Installin’ Your World

This isn’t that difficult. First run make installkernel KERNCONF= your config name. Now here is de interestin’ part. Run mergemaster -p, this program looks through your etc and updates it to match de new /etc in /usr/src. It will display changed files to you, press q and it will give you options. Somethin’ like i (install), m (merge) etc. Pick merge and it will open a nice little screen that shows you one file on de right and one on de left. It will go section by section, showin’ de areas that have changed. Press r or l to choose which section to keep. Its pretty easy to see which section has new stuff and which does not. After de merge, it will prompt you with options for de newly merged file. One of dese will be install and this is de one you want. In de latest current, most of what you will be showed is user and group files. Make sure you do select de sections with de new users and groups. After this is done, it will ask you a couple questions that you can say yes to. Now that your /etc is updated run make installworld den reboot.

NOTE: You usually don’t need to run mergemaster. However, 5.2.1 is a pretty old release and -CURRENT has come a lon’ way.

I. Ports
Welcome to runnin’ current. The rest is easy. cd back to /usr and edit de ports supfile de same way you did de standard one. Run cvsup on it and wait. After its done, you will have a full ports tree. There is not much left to say. You now have a workin’ system and a fully updated one too. To install software from ports cd to /usr/ports/category/softwarename/ and run make install clean . If you want linux binary support, install de linux_base port. To find where it is cd to /usr/ports and run make search name=linux_base | less . Enable loadin’ de kernel modules for linux binary support by editin’ /etc/rc.conf. Just add de line linux_enable=”YES” to de file and your set. If this is a desktop system, I would recommend installin’ /usr/ports/x11/xorg and your choice of /usr/ports/x11/gnome2 or kde3. Have fun .

Get it from:

www.madpen\’uin.org/cms/?m=show&id=1853