ibookserver Setup

my How-to quest to set up a rural dialup server on an ibook g3.

My Photo
Location: Trinity County, East Texas, United States

I'm a lawyer who likes to surf the net, play music and bitch about things I can't change.

Friday, July 01, 2005

More on Getting PHP Up and Running on the way to Hosting your own Forum Server

Her's where we left off... Enabling PHP on your mac running Panther or Jaguar. So you need to get it running? It comes already installed, so all you need to do is follow a few simple steps in Terminal. You already know that when you open up a new window in terminal, the prompt tells you where you are – the “~maybeso” means you are in the home directory because that is how you logged in on your mac in the first place. You need to get to your root directory – All the other web sites that try to help you forget that most folks delving into unix are not geeks – they just want to do something that requires a little knowledge – they forget that you don’t know the basics of the command line interface – (CLI) that is all Terminal is. To get to the “root” directory from your prompt just type in “cd /” without the quotes. You will see something like this :

Garbo:~ maybeso$ cd /

Garbo:/ maybeso$

That “slash” or forward slash means you are in the root directory. Now type in “ls” that is an Ls but lower case. You should see a list of folders and files. Find one named “etc” and then at the prompt type in cd etc

this takes you to that folder or directory. Type “ls” again and you will see another list of files and folders. If you have a folder called “httpd” you are getting closer to your goal. Type cd httpd or cd /httpd to change directories to that one. Type “ls” and you will find a file called httpd.conf. That is the one you want. You are going to change this file, and it is an important file so you NEED to BACKUP this file before proceeding. This file is the configuration file for most of the system-wide settings in Unix. How to back up the file? While you are in the same directory you likely saw a file called httpd.conf.applesaved. That is your backup file for this file. You need to make a backup that you know is pre php changes so we will call the new backup file “httpd.conf.phpsaved. To do this you can do it this way:

Garbo:/etc/httpd maybeso$ sudo cp httpd.conf httpd.conf.phpsaved

it will ask you for your root password.


Garbo:/etc/httpd maybeso$

Now type “ls” to see if the new file is in that directory. If it is go to the next step. You will want to open up the httpd.conf file in a text editor. I use the included unix editor called pico. To open up the file in pico, stay in the same directory you were in. type sudo pico httpd.conf. What this does is tell unix to give you permission (sudo) to edit the file in Pico. Got it open? You should see the following :

## httpd.conf -- Apache HTTP server configuration file

Hehe – fooled you! You didn’t know about the apache server. That is what this file configures and you need this up and running properly to do most things with any server. The highlighted black squares are the commands to do things in the pico editor. To move around you use the Arrow keys. It moves the grey prompt which is the only place you can start typing. The other key commands are basically self-explaining – but for one thing – the Caret thingy in front of the commands such as ^V means to hold the control key while pressing the v key to page down. Got it? To find out more use the help command in pico.

The next thing you need to learn is what the heck the Number sign (#) means. Whenever you see the sign at the beginning of a line that means unix will not read and implement that line of code. It is called commenting the line out. To make a line work, you must uncomment it by removing the number sign at the beginning of the line and all other lines of that piece of code.

Keep in mind that what you are doing is making apache load, run and use PHP whenever it starts up. Next step: you need to find the

“LoadModule php4_module libexec/httpd/libphp4.so

AddModule mod_php4.c”

To find this line in the 1102 lines of the file use the Control W keys to find it and then type the first portion of the line you want to find in the black line and hit return. It will take you there. Delete the # sign by placing the grey cursor to the right of the # and delete it. Then scroll down to the addmodule area – just a few lines down and find the AddModule mod_php4.c and uncomment that line. For Mac os x 10.1 users you may need to add the following line :

addType application/x-httpd-php .php. Do a search using control W and search for addtype. Then cursor down to just below the other addtype uncommented line and add your line.

Back to the rest of the users – panther and jaguar – next find the

DirectoryIndex index.html index.htm index.php

to find it just search for directoryindex index.html. This set is likely to uncommented already – if so, leave it alone – unless you want to add the index.htm type like I did. The important thing here to make sure the index.php is in the directoryIndex line. Got it? Good! Now save that file by using control “O’ that is zero, and save to the httpd.conf file. To exit the pico editor – Control X and you are out!

Now, the easy way to restart apache is to go to your sharing panel in your systems preferences on your regular mac os system It is in your Dock or under the apple – Go to the sharing panel and start the personal web sharing. If it is running – turn it off then back on – that is the easy way to do it. The better, unix way to do it is to do this in Terminal: sudo apachectl restart

Terminal should then tell you apache is restarting.

Now you have to test it out – Remember where you turned on the personal web sharing? Just under the checkmarked box the computer will give you a line that will tell you where your web server is on your computer – in my case it was - your mileage may vary.

Now, to test this php/apache stuff out you need to make a document called info.php and place it in the /library/webserver/documents/ folder. To make this file all you need is an editor that will save as plain text – like Textedit or BBedit. Open a new document in Textedit – and add these lines

< ?php



Remove all the quote marks - they are only in there because the formatting in this blog wouldn't print the code correctly - If you can't get it right, let me know and I will post the file or send it to you.
Make sure you select under the textedit menu FORMAT – make plain text. Then save it as info.php and place it where I said in the paragraph above.
Now, open a new page in Safari and type your web server address Example:

And you should get a page that show you the PHP logo and tells you your php configuration. Congrats to YOU! You are now in the web server bidness! If you have probs, feel free to leave a question or an answer in the comments on this article. Thanks for playing “You’ve got PHP!”

So You Want To Host a Forum Server? You can with just a little know-how.

You see all those forums and Bulletin boards (BBS) that you can get help with computer probs, talk to other people who are into collecting left-handed pliers or used soup spoons - whatever you want, they got! And you asked yourself "why can't I have one of those so I can talk about what I want to talk about?" The answer is - you can! And just like all other servers on the mac, this one is really easy to do - unless you are afraid of a few unix commands. Let's go through the steps.

First, you gotta turn on a few things in your unix kernal. IN order to use the forum software (see my example forum- just Click on the title of this article), you need mysql started, and php started. To see what you have available and running in your Unix underlayer, you need to use the Terminal program that came with your mac os x - you will find it in the aplications folder under utilities - (unixspeak this would be /applications/utilities). First drag the Terminal icon onto your dock and let go - this will give you an alias that will open your Terminal from the dock and it will always be available. Now, open Terminal - it will say something like this: Garbo:~ maybeso$ This tells me that I am talking to Garbo - my other powerbook G3 Lombard mac, the squiggle is a tilde, and since there are no brackets around the Garbo name, I know I am in the Bash shell, and I am logged in as myself, and the dollar sign is the prompt in Bash. To see if you have php installed type in "php -v" do not use the quote marks. It should give you something like this: Garbo:~ maybeso$ php -v
PHP 4.3.11 (cli) (built: May 25 2005 14:03:43)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Garbo:~ maybeso$

If you don't have php in your system, you can download php for free at any unix or darwin or freeBSD website - download the correct php for your system, but as of this writing, you should not be loading php version 5.x.x - it is brand new, You want php 4.x.x.. Follow the instructions and it will work for you.

Next, you need to start up mysql - You might want to download it from the net and follow the instructions for installing -but, you should have it somewhere in your unix files. Again, use terminal and try to find the folder. More on this later - I have to cook din-din for my wife!

Your Own Mail Server on Your Mac! But first - DYNDNS.org

You already have a mail server on your mac - it resides in the Darwin underlayer of your computer, you know, the FreeBSD Unix layer that drives the modern macintosh computers. Fortunately, you can turn on most of what you need to operate your own mail server by accessing the prefs of the Mail.app (the Eagle Postage Stamp Icon). To serve email to folks that are not on your household or office network (intranet), you need to do a few things under the hood.

First things first - you have to have some way for people to find you on the internet. Most of us have a dynamic IP address that is assigned by your ISP when you connect. Each time you connect, the ISP gives you a new IP address. That is no good if you want folks to get to your server from afar. You could solve this by having your ISP assign you a Static IP Address - but it usually costs more than you are willing to pay. The solution is: DYNDNS, http://www.dyndns.org/, a place where you can get a subdomain name that points folks to your computer.

Let's look at my setup: I have a dialup connection that is connected to my Airport Extreme Base Station w/modem. Whenever it detects one of my computers - connected with a wireless card or through ethernet, the Base Station assigns an IP address based on my settings. I have my server computer set up to have an assigned network address as - the base station is set as The next computer to connect is - get the picture. There are ways of making sure each computer has a permanent intranet IP address, but is beyond the scope of this article. Now, when I coonect with the Base station to my ISP - it assigns a real IP address to the base station that I can use with any of my five computers. The Base acts as a router and translates anything for my server computer and sends the info request on to - my server mac. If I set up a subdomain at dyndns.org, such as: serverman.gotdns.com, the base will now send anything to my server mac if it comes from serverman.gotdns.com. All I had to do to get this free service was to register at dyndns.org, download and set up an application that lets dyndns.org know what dynamic IP my ISP has given me each time I reconnect to my ISP. THe application is called DNSupdate, and you can find it a lot of places. Once set up, DNSupdate will tell dyndns.org every 15 minutes what my IP address is, and whether or not it changed. Dyndns then tells the DNS databases all over the internet what my new IP address is whenver it tries to find serverman.gotdns.com. To recap, People can find your servers even if you have a dynamic IP assigned to you. THe way the base and your mac distinguishes which server someone wants to talk to is by the port number - each server on your computer uses a different port, ftp access is through ports 20 -21, http is reached through port 80, etc. As long as the base know your intranet IP ( - and DNSupdate is working its magic (it loads a daemon in your unix area), and you are connected to the internet, folks can get to your servers - mail, webserver, etc. It's cool to be connected!

Saturday, June 18, 2005

AFSserver: The Apple File Share Server - It is Ready

Let's say you have five computers in your home - your good ole laptop, the main tower computer in your home office, the general imac in the den, the iBook your son uses for school, and the laptop your wife has from work (a Wintel type PeeCee because that is what they use at work). You have your Airport Base Station set up and sending wireless signals (next ime we will talk about the Airport base Station), and you decide you want to keep all the files you don't need all the time on the big tower mac you have in your home office. You can also back up all your data from your various computers. Once you have the Airport Base Station set up, and the airport wireless cards in the computers (the PeeCee can also connect to the internet via the wireless network - the airport works with the dark side, too), you can set up the AFSserver. It is fairly easy to do.

Step one. Go to the sharing preference pane in the system preference.

Step Two. turn on the Personal file sharing by checkmarking the personal file sharing choice in the window on the left - then click on the big Button that says START on the right - down below, under all these choices a line of text will tell you other computers on your network can find and access you server - "Other Macintosh users can access your computer at afp:// or browse for "iBook G4" by choosing Network from the Go menu in the Finder." This is what my computer says for this. I assigned this computer the name:IBook G4 in the top of the same sharing preferences pane. You can name your computer anything - in this example, we will call the home office tower mac "Tower of Power". You can also let Windows users (remember your wife has a PC that can't connect), connect to your server by checkmarking the the Windows sharing selection - and wham! Another server called an SMB/CIFS servers is up and running on your computer. This also allows windows users to utilize the shared printers on the mac network. (later on, folks I will get to the printers)

Once it is on and named, other computers on you net can connect to it and upload and download files. If they have a userid and permissions set up to let them. You did make user accounts for everybody, didn't you. Oh, you didn't? No problem!

In your System Preferences click on the Accounts tab and make them accounts with limited access. This way you control which files and folders other people can access. Assign them accounts exactly like the ones on their computer - if Mary is maryB with a password of Snoop on her iMac, then that is what you create on your computer. Be sure to uncheck the administrator privileges under the security tab in the accounts setup. Now, set up folders owned by them using the get info (command i keyboard shortcut while the folder or file is selected). That's it, in a nutshell. You have now got a file server and and windows file server up and running on the same computer, Tower of Power.Wasn't that pretty easy?

To recap, you have set up an Apache web server, an AFSserver, an ftp server, and an SMB/CIFS server for windows. Pretty good, ain't it! It is way cool. Next post is - the mail server - SMTP, IMAP and POP servers and how to do the easy way for the cheapest cost -free or nearly free!

Friday, June 17, 2005

Mac Servers You already have - you just din't know it!

Servers you want? Servers you got! Inside every mac that ships with OS 10.3.X are servers. And, if you bought the OS X 10.3 Panther you just have to install it from your Xcode Tools Disk - that is the one that you did not install.

When you go to the sharing preferences panel and turn on sharing - personal Web sharing - what you are really doing is starting the Apache server, a unix based server that all the major companies use. You already know about Apache - that is the server that gives you the site not found page or file 404 or 403 page when you go to a website that is no longer good. See? it always has that little line under it that reads "Apache Server V. 1.3.1....." You have that in your computer and all you need to turn it on is flip a couple switches in your systems preferences file.. Now go to your Home directory or folder -the one named after you automatically. You should have a folder called "Sites". That is you personal web page you can put up for other people on your mac network. You also have in your Macintosh HD in the Library Folder, a folder called "WebServer" - tht is yur apache webserver site folder - just drag all your web site files, folders, jpgs, etc. into the folder and your site is almost ready for prime time. Anybody can come to your "web Site" as long as you are on the internet and as long as you give your friends the exact url such as : But that is awkward. there is an elegant way to do it. We will cover it later on.

In the same preference pane where you turned on your Personal Web Sharing, are several more servers - the ftp server and the Apple File Server - called Personal File sharing. Any other mac on your network can use the AFPserver to get and receive files. This is great if you have more than one computer in the house. turn it on and it works - all you need to do is set the permissions on your files and folders to keep the children out of those sensitive "business records" otherwise known as your porn collectiion.

Do the same for your ftp server in the same pane and yuou have an instant ftp server -It even tells you the url to give out to people. It works, but there is a better way to run an FTPserver - more on that later.

Okay, you got a webserver, an ftpserver, an AFPserver. whatis left? How about a mailserver - you know, let people have their own email accounts and send and receive email without having to pay for email accounts. For that, you need to open the mail application - that postage-stamp with the flying eagle on it - that is it. You just have to set it up in the preferences. More on that later - and there is a better way.

See, I told you you had all the servers for free right there in your little ole mac, imac, ibook, powebook, emac, laptop, whatever - if it is a mac running Mac OS X then you have the servers. Next post will be about AFPservers.

Rural, out!

Mac Software -What You Need for free or at Small Cost

Even though you mac comes with a whole bunch of applications that you can use to set up your web pages and servers, there are a few programs that help. And, since we really like free or nearly free stuff, we shall talk a smidge about some programs that will make your life easier and does not cost a whole lot.

The first thing you might need is an image manipulation program that does what Photoshop does. There are a few applications out there that are free, but the cream of the crop is a shareware program that is not crippleware (crippleware is software that won't let you save or do some of the better things it does until you pay the shareware fee). That program is GraphicConverter X. It is Shareware, but it also works without registering. This way you can use it to see if it is what you want - then pay the registration fee to Lemke - the creator. I have used GraphicConverter for years and years since the early - mid 1990's. The latest version is fast and full of a sorts of image manipulation programs. It is worth the money.

HTML Editor - there are plenty of HTML editors out there that are free or nearly free, but you have AppleWorks that will do it for you - You also have an app that comes with mac that you can write basic html code on - it is called TextEdit, and it fits our pocketbook - free with your mac. I use Appleworks, TextEdit and (i m a lawyer) Word. I would recommend that you download the full version of netscape if you want a free html page creator. To learn how other pages are created using html, go to a website in your free web browser that came with your computer -Safari. When you go to a page you like - click on the view source menu item under View in the menu bar and you can see how they did it. Or you can just highlight it and "borrow" some of the html code. That is how everyone else did it to learn - why reinvent the wheel. Just don't use their basic layout - it would be copyright infringement. The html codes are yours for the using, though.

The best wa yto learn html codes is to go to W3Schools!, a website that is geared to training you how to write proper html tags and code. THey have a tutorial and examples you can cut and paste, and even an interactive tutorial that lets you try out code to see how it looks. A good site.

Next on the agenda is an FTP program - I like Fetch, but they only have a limited time demo now - you have to pay to registration fee to keep using it. I still think it is the best mac fetch program out there. There are others, but hte freeware ftp programs are buggy. This is one application you will have to pay for. You will use it to place files to and from an ftp server - yours! Actually, you can do all that without an ftp client program, but you need to see if people can upload, oor download using your ftp server - Fetch, I know works well with the ftpservers for macs. Got it? - Good.

Now all you need is the servers. next time - servers you already own.

Rural, out!

Mac Software - Just The Basics, Ma'am!

Software is important, but remember, your basic, out-of-the-mac has almost everything you need to create and maintain a server - whether its a mail server, an ftp server, a web server, a file server, or a unix server - how about FreeBSD and Apache servers - these are already in your computer, or on your startup disks. I have Mac OS X 10.3.9, commonly called Panther I recommend you upgrade any earlier version of Mac OS X to at least 10.3.9. If you buy the OS X from the store (on the internet, of course), it is likely 10.3.1 - Your computer will run a program called software update and it will tell you what you need to download from apple to bring your computer up to snuff - or you can bite the bullet and buy Mac OS X 10.4 called Tiger. Cost right now for the 10.3 system (Panther) - about $39.00; Tiger 10.4 will set you back $129.00 and you will still have to download the new updates as soon as you install it. Have you ever tried to download 100 MBs on a dialup connection? SLOOOWWWW!!. I did not upgrade to the new tiger; I just downloaded the 100 or so MEGS from apple over a period of nights and, viola! My iBook is fully 10.3.9 upgraded - except for the three security upgrades that apple tells me I need to install. Maybe later, eh?!? That's Canadian for "Yeah, right!", and no, I am not Canadian; I am 100 percent Texan born and bred. Nothing against our friends to the north - I just ain't one of them!. Ahem Back to the topic.

YOu also have in your mac out of the box Appleworks - a program that can do a database, a spreadsheet, Draw, Paint, and is also a text program similar to Microsoft Word, only way cheaper - it's free with your mac! You can also do PDF documents, both reading and making them. It is built in to the system. You have a calander program, a mail application, itunes, iphoto, idvd, imovie, etc. These programs are good for bringing in and manipulating graphics, sound, photos, digital video for putting on the web - that is the point of having this blog - web stuff and servers.

So, to review - in the basic mac, you have almost everything you will need to get up and running for web content creation, publishing, and serving. Next post will be about what extra software you might need or want for free or very little cost.

Rural, out!

My Basic ibook setup - Equipment

Macs all around! I have an older iBook G3 Blueberry 366 Hz. with 320 MB RAM, a cd-rom, airport card, modem and 10 GB hard drive. It is circa 1998. Obsolete? No way! If it has software and can connect to the internet, it is not obsolete. Slow? A little bit in comparison to the newer iBooks. My other main computer is an iBook G4 1.07 GHz, 768 MB RAM, Super drive DVD, Airport Extreme Card, 14" Screen, 40 GB hard drive. It is way faster than the Blueberry, but it is circa 2004. The latest iBooks are faster still. Remember, comparing hertz speed on different chips and computers i.e., PCs versus Macs, is not the way to tell speed. For the average user, most computers are speedy enough. Get the most speed you can for the money! To speed up your mac, always install more memory first.

The other equipment for my home setup is as follows; an Airport Extreme Base Station with dial-up modem, a cheap Lexmark 605 color printer, an extra phone line, and a cheap dial-up ISP that allows unlimited connection time. They all say "unlimited connection time", but their fine print says that you cannot use any auto features to stay connected 24/7. As a lawyer, I say they are pissing in the wind - offering unlimited time and then saying "not really" is not cool at all. Can you say consumer complaint? I knew you could! But I digress.

Optimally, you would want a high-speed, always on, broadband account with which you connect to the internet. But that is not gonna happen in the rural areas for quite some time. You can always do better, but remember the nature of this blog - cheaper, easier, leaner, and meaner. I use Apple Macintosh computers because they stay up and running way longer than Wintell Computers, they are easier to use, and they are a lot more easy to setup and configure. Adding new software is a snap! I worked my way through college (and while awaiting Law School to begin) as a computer tech at my college. I fixed all the macs on campus (400 or so). The other techs worked for the PC computer side - 10 -13 for about 1,000 PCs. They were busy all the time - I, on the other hand, skated because once a mac was set up properly, it tended to stay up. Since I knew the PC side, also - I used my spare time running fixit tickets for the PC users. Thinks about that for a moment - 1 part-time tech taking 17 hours keeping 400 macs up and running versus 10 -13 techs, some of which were fulltimers, to keep 1000 or so PCs up and running. This does not include the unix and server folks, or the software helpdesk, or the lab techs -(you know, those geeks who warm a chair in the computer lab reading a book or playing games who tell you "use that computer over there, and I send a repair ticket in").

That is a major reason why I use macs. Sometimes my ibooks run for weeks and weeks without a restart, and usually I only restart to clear up hard drive space - some programs eat up your hard drive space and never give it back unless you restart. Safari is bad about that. After you have loaded about 1000 web pages, each having 20 to A HUNDRED icons and graphics, a small hard drive fills up quite fast. Restart to clear up memory. Photoshop is (I use an older version) is notorious for using up hard drive space - 50 to a 100 MB per filter use or color change or mask or any of a hundred other things. When you open a photo and change the color just a little, that is 50 MB of space reserved by Photoshop - get the picture. Quit the program to reclaim the disk space, and sometimes, you just gotta restart to clear the space.

So, More RAM, More Hard Drive Space means a faster computer. I also have a couple of cheap firewire 30 BG hard drives that I use to back up my data. There you have it - my basic hardware - an old laptop, a newer laptop, an airport base station with modem, a printer and a couple of external hard drives. Next time, Basic software.

Rural, out!

Details, Details! It's all in the details - My quest

I decided to setup a server at my home using my old ibook g3 (blueberry) When I can find a good deal on a tower g4 or imac g4, I will upgrade. This is my uest to set up the servers using nothing but basic equipment, free or nearly free software, and minimal modem setup using good ole POTS (landline dialup phone line). I live in East Texas and cannot get DSL, ADSL, any form of broadband, no cable and satellite is out due to costs. The phone companies tell me I am just too far from a switching station to get dSL, etc. I live 6 miles from the nearest small town and 15 miles from the nearest bigger small town. I am on the fringe of cell phone reception from the nearest tower, and I lose signal strength unless I go outside on the porch or down to the end of the driveway to make my calls. See what I am up against? it sucks, but there are workarounds for the rural poweruser wannabe. Take heart! The next post will show you my setup and computers - all macs, of course.

Rural, out!