Share this blog:

Monday, October 22, 2007

Running the Alpha Five Web application from your office or home computer

Certainly it is preferable to run Alpha Five Web applications on a corporate or hosted server.

But there are times when doing so is overkill. There are plenty of people and organizations who have produced Web databases with Alpha Five, and would like to host them on their desktop or laptop PC.

Here's how to do it.

So far...
Let's assume you’ve created some Alpha Five Web pages, or maybe even a full-fledged Web application.

Now it’s time to deploy...
You want to allow people to go to a Web site so they can see and use the Web pages you’ve created. You already know that your Alpha Five Web pages will only work if they are put on a PC running the Alpha Five Web Application Server (which we'll call the Web App Server).

And you may know that there are a few Web hosting providers that run the Web App Server. (One of them is AlphaFiveOnline, Alpha’s own hosting service). But you want to find out whether it would be feasible for you to run the Web server yourself on your office computer or home office computer.

Besides saving money in hosting fees, there’s another advantage. You can create hybrid desktop and Web applications that share the same tables (and therefore data), without the need to figure out remote database connection or synchronizations schemes. In other words, hosting on your own PC can make building and managing your applications much simpler.

This may sound good to you, but you probably have some questions: Will the performance and reliability be adequate? How long will it take to set up, and how easy will it be to maintain? Is it safe? What do I need?

The good news is just about anyone can run the Alpha Five Web App Server successfully and with confidence! You just need a little information. And this article will give you exactly what you need.

So let’s start with your concerns:

1. Is this approach good enough? You want a Web site that works quickly, and is available 24/7. Can you really get that by running a server yourself in your office or home office?

Yes you can. If you have fairly reliable Internet access, your server will run dependably for you, even if you are just using a DSL or cable Internet connection. And there are ways to increase your uptime, too. (We'll cover that in a future guide.)

2. Is it safe enough? You’ve heard the old saying, “Fools rush in where wise men fear to tread.”

Alexander Pope probably wasn’t talking about setting up a Web server. But naturally anyone would be nervous to rush in. We’ve all heard horror stories about fiendishly clever hackers. And the truth is that any time your computer is connected to the Internet (even just browsing the Web), your computer is at some risk.

However, with Alpha Five and a little knowledge, you can set up a Web server the safe way, without fear.

So let’s look at the core of this issue: Running a Web server means that you're allowing outsiders to access your PC. That may sound scary, but it’s not nearly as dangerous as you think.

You see, Alpha Five creates a special folder on your hard drive called the "Web root" folder (typically this folder is C:\A5Webroot). People from the outside can ONLY look at the files and Web pages that you deliberately put into this folder (and only this folder).

Alpha Five doesn't let visitors see or access any other folders on your hard drive, or any other computers on your network. On top of that, the actual data that you collect or display on your pages can be stored in tables that you place OUTSIDE the Web root folder -- so YOU control what data gets displayed and to whom.

3. Will this take a lot of my time? Is this going to take a long time to set up or -- more importantly -- to maintain? You want the Web server to help you become more efficient and more productive. So naturally, if installing it and running it takes a lot of time, that would defeat the whole purpose.

Not to worry. Even if you are a complete newbie, it should take very little time to get everything set up. And as for maintenance -- and this is a toughie -- once it’s set up, your primary job is making sure that the computer is plugged in and turned on.

And just like any other computer, yours may occasionally crash, and need to be restarted. Lastly, it’s a good idea to stay up to date with the latest version of the server, and the latest security patches from Microsoft. (Windows can do the latter for you automatically.)

I hope I’ve adequately addressed your concerns and you’re ready to read on and get started. If not, feel free to send an email to Sales@AlphaSoftware.com with any concerns you still may have.

Getting Started
First let’s make sure you have what you need.

What you need:

* A copy of this article. You might want to print this out.
* Your 16-digit Web App Server license number. If you need to order one, visit the Alpha Software Web site (AlphaSoftware.com).
* Alpha Five Version 8 (or standalone Web App Server)
* A permanent Internet connection (such as ISDN, Cable, DSL, or FIOS.)
* A PC (or notebook) running Windows 2000 or above
* A router (Optional. But if you are using one, we’ll show you how to configure it.)

What you DON’T need:

* A static IP address. (If you do have a static IP address, that’s great. And if you don’t know what an IP address is, that’s OK … you will soon.)

Understanding the Basics
This is a how-to article with practical advice, so we’re not going to bog you down with too many technical details. Let’s just say that what happens between a visitor’s Web browser and a Web server is very intricate. So we’ll only get into technical details that we absolutely need, starting with this simplified explanation.

Think about setting up the Web App Server as opening a channel of communications between visitors’ Web browsers on their machines and Alpha Five on your machine. If this channel is open and Alpha Five is running, then your job is done. So let’s look at this channel in detail:


You don’t have any control over the visitors’ browsers, the Internet, or over most of the other links in this chain, either. There are only a few areas to concern yourself, and those are highlighted below.


In this article, I'm going to show exactly what you need to do -- step-by-step -- to get your server onto the net. And for convenience, let's start with the Alpha Five Web App Server, and work backward to NO-IP.

Step 1: Activating and Configuring the Alpha Five Web Application Server
Starting Alpha Five is the simplest of the four steps. There are only a few critical settings you need to know about, and I’ll cover them here.

1. Open Alpha Five and open a database (any database will work).
2. Click on the Control Panel to give it focus.
3. From Alpha Five’s Tools menu, choose Web Application Server. The Web Application Server Control Panel appears.


4. On the General tab, enter 8080 for the port number. (I’ll explain why later.)
5. Check the box labeled “Automatically start the Web application server when Alpha Five is launched.”
6. Make a note of your Web Root folder. This is where you will put your Web pages so that they are accessible on the Internet.
7. Click the Sessions tab.

8. Click the Add button to enter your license number.
9. Click the Start the Server button (if the server isn’t already running).
10. Place an index.a5w page in your Web root folder. If you don’t already have a page you want to use, then create one in Alpha Five and publish it to your Web root folder. (HINT: Use Alpha Five’s built-in HTML editor to create a page with the words “this is a test.” To get to the editor, click the Web Projects Control Panel button. Then click the New button to create a new Alpha Five Web page.)

The Alpha Five Web Application is now running. You can test it for yourself in a Web browser, if you like. Just type in the URL http://localhost:8080. The next step is to let outsiders come through the Windows firewall to get to the server.

Step 2: Configuring the Windows Firewall
This step deals with configuring the Windows Firewall. The Windows Firewall is available only in Microsoft XP (SP2) and Windows 2003 Server. If you have a different firewall or an additional firewall (like ZoneAlarm), you’ll need to follow the documentation or online help for directions.

NOTE: Even if you do not have Windows XP or Windows Server 2003 (and therefore you do not have the Windows Firewall), you should still read this section, since the principles are the same for all firewalls.

To understand firewalls you need to understand ports, at least in general terms. A port is a channel of communications. Ever seen a CB radio? Channel 19 (in the USA anyway) is the channel to talk to truckers. Channel 9 is the emergency channel.

Think of ports as channels, except your PC can use multiple ports at the same time. And there are 10,000 of them (CB’s have only 40 channels).

For Web traffic, port 80 is the most common channel to communicate. In fact, it’s assumed when you type in a Web address, like http://www.alphasoftware.com, you mean “please go to the server at alphasoftware.com through port 80.”

Another way to access the Alpha Five Web site is by including the port number:
http://www.alphasoftware.com:80

But you don’t need the “:80” because it is assumed by your browser that if you leave off the port that you mean port 80.

Now that you know the basics of ports, the concept of a firewall is going to make a bit more sense. A firewall’s job is to prevent traffic from coming from the Internet to your PC via any of the ports.

So, in order for someone from the outside to get to your Web server, you will need to tell the Windows firewall that you wish to make an exception and let in Web traffic. Here’s how.

1. From the Windows start menu, choose Control Panel.
2. Click Security Center at the bottom right (you might need to switch to category view first).
3. Click Windows Firewall. The Windows Firewall dialog appears.
4. On the General tab, click on the On radio button and clear the “Don’t allow exceptions box” if it’s checked.

5. On the Exceptions tab, click Add Program. The Add Program dialog box appears. Select Alpha Five and click OK.


6. Back on the Exceptions tab of the Windows Firewall dialog box, click the Add Port button.


7. Enter the Alpha Five Web App Server in the Name box and 8080 in the port box. The reason to use 8080 here instead of 80 is that port 80 is blocked by many ISPs (and even if port 80 isn’t blocked, these instructions will still work). See the next step for details if you are curious.

Step 3: Configuring your Router
If you don’t have a router -- and your PC is plugged directly into your cable modem or DSL modem -- then you can skip this step, since it doesn’t apply to you.

Your first question is probably: Why do I need to configure my router?

Here’s why. In order for a Web visitor to get to your site on the Internet, the visitor’s browser needs your IP address. Think of the IP address as a phone number. Each of the computers connected to your network all share this same phone number. When a call comes in, the router needs to know which computer to forward it to. And this process is called “port forwarding.”

Each router manufacturer has a different interface for setting up port forwarding. We are going to use Linksys here as an example, but the principle is the same if you are using Netgear, 3M, D-link, Belkin, or any other brand.

Don’t take these instructions too literally. Manufacturers change makes and models all the time, so these directions may vary from what you need to do, even if you have a Linksys router.

Can’t find your router’s users guide? Most router manufacturers make their user’s guides available for viewing or download on their Web site. Do a Google search on the manufacturer’s name to find their site.

Here’s how you configure a Linksys port forwarding.

First you need to get to the configuration screen, which you do via a Web browser. In the address line, type http://192.168.1.1. A box appears asking for a username and password.

If you have not set a username and password before, leave the username field blank, and type "admin" into the password field. Once you’re logged into the router, choose the Forwarding tab. (It may also be called Applications/Gaming.) A screen like this will appear:

On this screen, there are two critical pieces of information you need to supply: (1) what port do you want to use for incoming Web traffic, and (2) to which computer do you want to forward this traffic.

Why you probably can’t use Port 80 Ideally, you would want to use port 80. This is the standard port for Web communications. However, there is a good chance that your ISP has blocked this port. Whether they do this to prevent you from running a Web server or for some other reason is unknown.

Different ISPs will tell you different things. And sometimes two support reps from the same ISP will tell you two different things. However, whatever the reason, blocking port 80 is such a common practice among ISPs that we’ll assume in these instructions that port 80 is blocked for you as well. And if it isn’t blocked, the instructions in this document will still work.

So, set this setting to port 8080 instead.

You’ll notice on this screen that Linksys asks for a range of ports. So you need to type in 8080 twice -- once as the starting port, and once as the ending port.

Now you just need to tell the router to which computer you want to send this Web traffic. You do this in the IP address column. So what do you put here?

Remember our discussion of IP addresses, and that you only had one that is shared among all the PCs in the network. That wasn’t quite the whole story. Your PCs share one external IP address, but each PC has its own unique internal IP address. And it’s this internal IP address that you need to enter here.

So how do you find the internal IP address? Simple. Just follow these instructions. On the PC where you will be running the Alpha Five Web server, choose Run from the Windows Start menu. When the Run box appears, type in COMMAND and click OK.

A DOS box will open with a command prompt. At the prompt, type ipconfig and press ENTER.

On the line that reads IP Address, you’ll find your internal IP address. Enter this IP into your router, save your changes and you’re done.

If you notice the window title (above) and the prompt, you'll see that this invokes command.com, the good old DOS environment. In Windows 2000, XP and 2003 Server, you can use “cmd,” which is the Windows Command Prompt. CMD is a Windows application that supports long filenames (not needed for our purposes here). On 98/ME, you can run "winipcfg" instead, which gives you a nice little graphical interface.

Checking Your Work So Far
With the Web App Server running and firewall and router configured, you are on the Internet. So now would be a great time to check your work.

To do this, we’ll see if we can get to the Alpha Five server via your external IP address. Don’t know your external IP address? Finding it is easy. Just to go to: http://www.whatsmyip.org/, and at the top of the screen in bold letters, you’ll find your IP address.

Open a Web browser and type your External IP address, followed by a colon (:) 8080, like this:

http://123.45.67.89:8080

(You need to fill in your actual external IP address, not the sample one above.)

Once you enter this address followed by a colon and the port number, you should see the test page you created earlier.

If this is what you see, terrific. Everything has gone right and you can skip ahead to step 4, Configuring NO-IP.

If you get this instead:

That’s actually a good sign, too. The “This server does not allow directory browsing” just means that you don’t have a page to display in your Web root folder. Put a Web page in c:\a5webroot and call it index.a5w and the page will display.

If you get the “not licensed for remote access page,”


it means that the Web server hasn’t been activated with a serial number. The good news is that everything else is configured properly. And if you get something else, like “page cannot be displayed,” then something is not configured correctly.


Chances are it’s one of a few things. So go back and check the following:

* Alpha Five Web App Server is running and is set to port 8080. Try accessing the page via the address: http:\\localhost:8080. If it works, then Alpha Five is running.
* The Firewall is allowing traffic on port 8080.
* The router is forwarding traffic from port 8080 to the correct internal IP address.
* Your external IP address is correct. Go to www.whatsmyip.org to double check.

Still doesn’t work? Skip ahead to the Need Help section at the end.

Step 4: Setting up and Configuring NO-IP
At this point, visitors from the Internet can visit your Web site, but only if they type in the correct IP address and add the port number to the end. This is a bit inconvenient, and it gets worse.

Chances are your ISP has supplied you with a dynamic IP address. That means every so often -- and without warning -- the IP address will change, and you’ll have to supply your visitors with the new address, or they won’t find your site. But there is a convenient solution.

Services like NO-IP.com are designed to handle this exact situation. Here’s how it works.

You set up a URL with NO-IP for your visitors to enter into their Web browser. You have two choices, you can use one they provide to you, or you can use your own. If you use one they provide, the service is free, and you’ll get a URL that’s something like, mybusiness.NO-IP.com.

If you use your own domain name there is a small annual fee (currently US $20, on top of the cost of registering your own domain name, which will run about another US $20 per year).

NO-IP then provides you with a small piece of software to run on your PC. This software constantly monitors your IP address and reports back to NO-IP.

When a visitor types your URL into their browser, they are taken first to the NO-IP site and then redirected to your current IP address. NO-IP will even specify the correct port number. And all of this happens within seconds, making the process seamless.

NOTE: There are many other services besides, NO-IP. We are using NO-IP here as an example not as an endorsement. The principles here are the same for other services. For a list, click here.

NO-IP is fairly easy to use. First go to NO-IP.com and sign up for an account. Then follow the instructions for setting up a new host account. Here are some of the controls you’ll see while setting up:

In this example, we are using our own domain name called mybusiness.com. Notice that the Port 80 Redirect option is selected and that port 8080 has been entered as the port to use.

You can leave the IP Address box alone, since the NO-IP client software will keep this setting up to date.

It can take NO-IP several minutes for your request to be processed. You’ll know it works when you type in your URL and you see the page you put up on your Web server.

When it works, pat yourself on the back. Well done. The path is complete, and voila! You’re hosting your own site. Congratulations!

Save these instructions in case you need to set up your server on another PC. Or if the server stops working, and you need to troubleshoot.

Coming Up Next
More and more people are using the Web App Server over their LAN to extend their desktop applications to users who do not have Alpha Five installed. If you have a desktop application, and you want additional people in your office to gain access to some of the data, but they don't necessarily need your entire application, this is a great solution.

All they need is a Web browser to use the screens you build for them. Even MAC-based Web browsers will work. I'll cover this in detail next time.

And if there is a topic you would like to see covered in an upcoming guide, please send us your request at guides@alphasoftware.com

Need Help?
Still need help? Go to AlphaSoftware.com's Message board, which you’ll find under the Support menu. Search to see if someone else had the same issue (and what the resolution was), or write a post explaining the situation in as much detail as possible.

If you have feedback about this article, please send it to: guides@alphasoftware.com. We may not be able to respond to all e-mails, but we will read all of them, and use them to improve this and future articles.

1 comments:

asergeyev said...

I prefer DynDNS Dynamic DNS to No-IP. They allow to create 5 wildcarded hostnames for free and any number of them could be used as url forwarding address for free as well.