How we set up multiple websites on OSX Server
After fiddling and futzing around for weeks (actually since last year) I've finally figured out how to set up multiple websites (virtual sites) using one port and one IP address. While there seems to be lots of discussion on this topic, it seems that the basic assumption is that one knows everything about websites, DNS and all that stuff, which I do not.
When our network was originally established the engineer set up a wiki and also configured webmail, so we had two sites, one secured for mail and the other open for Calendar and the wiki. We were not hosting any websites locally because our school website is hosted by a company in New England.
This year I wanted to set up websites for teachers and students. As great as the wiki is, there are some things it just can't do as well as a website. So I figured if I set up the sites teachers could link back and forth from one to the other. In addition kids could now start to use a real website instead of the cobbled together file mess I had when we ran a Windows network. Also iWeb is a much more accessible tool than FrontPage.
SERVER SIDE:
Snow Leopard Server - 10.6.4
There are two - actually three pieces if you want your iWeb clients to connect to the server: Server Side Web Services, DNS and, in my case, FTP.
================================================ SERVER SIDE - WEB SERVICES
If you haven't turned on Web services, you'll need to open Server Admin and do that. If you don't know how to set up web services - just reply and I'll step you through that as well.
Once web services are set up and turned on, you'll see it listed under your server’s name in the Server Admin sidebar. Click on "Web" and then click on the "Sites" tab at the top of page. This is where you list all your sites.
Click the plus button and enter the fully qualified name of your site, for example: "students.myschool.org". Don't use the defaults here (no name) - that's what got me in trouble before. BE SPECIFIC!
You'll be looking at the "General" tab (the other tabs, "Options", "Realms", etc. we'll deal with in a second).
On the "General Tab", the default IP address ("any") and port (80) is just fine. We'll run everything over port 80. (Apache figures all the virtual site stuff out - you don't need your rocket science degree for that.)
"Web Folder:" is important because this is how you'll "segment" your websites. While I would NEVER do this again, we have a solid state hard drive for the OS and a RAID array for our data files. IF you have that, make sure you do NOT use the default "Web Folder" because it will store all your files on your solid state drive. There may not be enough room, over time, on that drive. I've not experienced it yet, but it's my understanding that if the drive fills up, the server shuts down.
I store my web sites on a folder on the RAID array.
Everything else on that tab can be left as the default. (Just make sure that you have an "index.html" or "index.php" file in your web folder root, but iWeb will take care of that for you.)
I would put in your email address in the "Administrator Email:" field.
Under "Options" you really don't have to put anything. I've tested making websites with iWeb and it doesn't appear that anything needs to be checked.
Nothing needs to be entered in "Realms" as well from what I see working w/ iWeb.
The defaults in "Logging" are fine.
You can leave "Security" alone, but we do have a (self-issued) certificate listed for our webmail site.
"Aliases" is important. Under "Web Server Aliases" you enter how you want the site to respond to when users type in a URL in their web browsers.
When our web server was initially set up the engineer set up "wiki.myschool.org" on port 80 and "mail.myschool.org" on port 443. In the aliases section was nothing but a "*" (the wildcard character). That means, from what I can figure out, that the webserver will respond to these sites regardless of what is typed in the URL. (Well, something like that - point is, if you create OTHER websites, you'll NEVER get to them because the wildcard character in the "Aliases" section, in effect, grabs those web requests and redirects them to the sites that are already there.
In my case I deleted both of those wild card characters. For my "wiki.myschool.org" site, I entered "mail.myschool.org". That means if you type EITHER "wiki." or "mail.", go to the site that’s stored in the “Web Folder” we set up when those sites were created.
For "mail.myschool.org" I just DELETED the wildcard character. I wanted that site (since it was secured) only to respond to "mail." - nothing else. (You're not going to that secured site for any other reason than to get your mail.)
"Proxy" can be left blank. Have no idea what that does. As time permits I'll do some research and figure out what it's used for.
"Web Services" is if you want to provide any MORE services to this particular site. Most likely you'll want to uncheck all the boxes. For our "wiki." site, we have checked "Wikis", "Blogs", and "Calendar". For our "mail." site we have those checked PLUS "Mail".
I would create a separate "Web Folder" for each of your sites. I don't know if that's a requirement but for housekeeping purposes, I would keep the sites separated. And I SUSPECT that it's "best practice" to separate your wiki from your other websites.
SERVER SIDE - DNS
OK...now you have to make your site reachable and the only way to do that is to set up DNS so that folks don't need to type in the IP address of your web server. You need to set up DNS inside your network and, if you want folks in the outside world to reach your website, you'll need to set up an external DNS as well. I'm going to cover INTERNAL DNS - if you don't know how to set up EXTERNAL DNS - reply or email me and I'll post those instructions.
Most likely you have already created Zones for you network...all you really need to do is create "Aliases" so that when you type "students.myschool.org" your web browser will know that site resides on IP address XXX.XXX.XXX.XXX.
If you've set up Zones then you already have a "Machine" setting that translates your server’s name to an IP address and vice versa.
All you need to do is create an "Alias" (CNAME) record for, in this case, "students". You’ll see the choices for types of records when you click the "Add Record" button.
There are only two fields to configure for a record: "Alias Name" - in this case "students" and "Destination" - in this case "servername.myschool.org". (You've already entered a machine record that says "servername" = 192.168.1.x.)
That's it for Internal DNS.
SERVER SIDE - FTP
Now you have to get iWeb to communicate with the webserver.
There are only three ways iWeb will communicate with webservers: MobileMe, Local Folder and FTP Server.
Local Folder is really only practical if you want to host a website on a laptop (I was blown away initially when I found out that all Macs had a built-in web server - how neat is that?). I think there are some very cool things teachers could do with configuration, and, of course, you wouldn't need to set up any web services on the web server, but that's for another discussion. You need to set up FTP services on the web server.
Turn on and enable FTP on your webserver.
You can leave the defaults for "General", "Messages" and "Logging". "Advanced" is the only thing you want to set. I set "Authenticated Users See:" to "Home Folder Only". I set the "FTP Root" to the same root folder in which I plan to store my web sites (/VOLUMES/RAID Array/WebServer/Documents). This setting sets that folder only to be accessible via FTP.
I would suggest returning to your DNS settings and adding one more "Alias". Set "ftp." to point to your webserver. Why? So folks can edit their sites from home (see below).
CAVEAT: If you are running FTP on other servers, make sure that the settings here do not conflict with the settings on the other servers. For example, I'm running FTP on my file server so that my scanners can communicate with it. However, I configure my FTP settings by machine name and NOT "ftp.myschool.org".
================================================
CLIENT SIDE - CONFIGURING iWEB
Now you have to configure iWeb so that it will communicate with your server.
Click on the "Site" icon so that "Site Publishing Settings" appears.
Publishing:
"Publish to:" = "FTP Server"
You can set the "Site name:" and "Contact email:" to whatever you want. But see below!
FTP Server Settings:
"Server address"=ftp.myschool.org (you could also enter in servername.myschool.org or the IP address. However, if you want folks to be able to work on the site from home, you will need to configure external DNS for that. If you use the IP address, you're out of luck for remote access to the site. (You can do it but it's beyond the scope of this discussion.)
"Username" & "Password" should be your user's network login credentials.
"Directory/Path" - this is important. Remember, you set your "FTP Root" to be "/VOLUMES/RAID Array/WebServer/Documents". If you leave this field blank then the website will be dumped into this folder. If you are only setting up one site, that may be OK. However I wanted to set up a "students" site folder, a "faculty" site folder and a separate site for our literary magazine.
THEREFORE: I have, in my ..../Documents folder (on the server), a "students" folder, a "faculty" folder, and a "litmag" folder.
SO...in my "Directory/Path:" field, I have "/faculty". That means the full path to this website is "ftp root/faculty" or "/VOLUMES/RAID Array/WebServer/Documents/faculty" (You don't need a trailing "/" character. iWeb will automatically append the folder for you user depending on what you entered in "Site Name:" in the "Publishing" area.
Website URL:
This is the root website depending on whether it is "students" or "faculty". Since iWeb will append the site name to this root website, I accomplished what I hoped to accomplish in this post ( http://discussions.apple.com/message.jspa?messageID=12288561#12288561).
Faculty sites will be @ http://faculty.myschool.org/username. Students @ http://students.myschool.org/username. PERFECT!
iWeb is such a GREAT tool - NOW the kids can start using it!
I want to reiterate that this works for our school but it should work for you as well. There may be better ways to do this but it works for us.
Hope this has been helpful and you won't have to spend weeks trying to figure this all out by yourself!
MacBook Pro