2 Guys, a Mac, and a Website - The Evolution of the Web - Publishing Your iCal Calendars Locally Pg:3
October 11th - Hey, happy pantsday.
2 Guys Store

120x60

 Search

 Classic 2 Guys
10 Random Stories:
The Words "CompUSA" & "Not Sucking" in the Same Sentence?
Mother May I? An Introduction to Mac OS X Permissions
Jaguar Unleashed
The Stupidest Story Ever
Safari Public Beta 2 Soon
Mac Users Are Not Elitists
New Apple Device
Panther: Reader Questions Answered
Apple Customer Service Gripe (.Mac Auto-Renewal)
Natural Born iPod mini Killer

 Comments
yum hot guys - core
You guys are the pants! - PHP WannaBe
Maybe they don't like you - so they sent you defective product. Have yo... - DJLC
A friend of mine had this product, and the antenna portion quickly came... - Cubist
And the other rule of not commenting on your own article!
...
- Jonahan


 Account
Not logged in.

Username:
Password:
Save password
Not registered?




There are no comments to display.
Add a Comment
(Line and paragraph breaks automatic, HTML allowed, URL trumps e-Mail)

 Publishing Your iCal Calendars Locally Pg:3
Page 1, Page 2, Page 3

What to do if you are behind a router

First off, let me explain how to tell if you are behind a router. Find your broadband modem. It should be a box with three things plugged in to it. Those 3 are a power cord, going to an outlet on the wall. A connection to the internet (cable line if you have a cable modem, telephone line if you have DSL). And either a ethernet cable (looks like a telephone line, but wider - It has 8 wires instead of 4) or a USB cable, it would look like a small square going to a wide, and thin connection on the other side (Same cable a printer would use.). Once you find that, follow the ethernet cable, or the USB cable to see where it goes. If it goes to your computer, then you don't have to do anything else (unless you have an extra firewall program beyond the one built in to OS X). If it does go to something else, or if you have an extra firewall (other than os x's firewall) you need to forward port 80 to your machine.

Now, forwarding ports is different on each router. Check your router information on how to do that, or call tech support for more information. If you do have a firewall, you will need to allow port 80, but again, that is something that is different for each firewall program out there. So check with your firewall's documentation.

Publishing your Calendars with iCal

Once you have your calendar ready to go in iCal, and you are ready to publish it, all you have to do is follow these simple steps.
1. Open iCal
2. Click on the calendar you want to publish on the left hand side.
3. Click on "Calendar" at the top.
4. Click "Publish"

Now you will be greeted with a publish screen. Here is were you can make all the publishing options, read over the options, and decide if you want to use them. Then follow these steps to publish it.
1. Pull down the menu next to "Publish Calendar"
2. Select "on a WebDAV server"
3. In the "Base URL" field type in "http://127.0.0.1/DAVdocs/" (The 127.0.0.1 will point to your machine, and the /DAVdocs/ tells it to put it in that folder)
4. put in your username and password you created when you set up WebDAV.
5. Click Publish.

Now that we have the calendar published to your computer, we need to tell PHPiCalendar where to get that Calendar. To do that we need to edit the configuration file for PHPiCalendar. Normally, we would do that with pico in terminal. However, for some reason when pico is used to edit the config file it destroys the calendar, and you have to re-copy the config file.
1. Open a finder window and navigate to the location that you pasted your PHPiCalendar files.
2. Hold down "Control" and click on "config.inc.php" Select "Open with" and choose "Text edit" from the list, or if it isn't there, click other, and navigate to "Text Edit" in the Applications folder.
3. Look for the line that starts with "$calendar_path".
4. In between the quotation marks put in "/Library/WebServer/Documents/DAVdocs/" (don't forget this is case sensitive)

Now you can save this, and go to your domain you chose from before. This should bring up your calendar you just published. If it doesn't, you need to double-check my instructions. Also if you want to publish more than one calendar, just follow my instructions for publishing calendars, and put them all in that same folder.

You may want to look through the PHPiClanedar configuration file and see if there are any other options you would like to change. One of the best features of PHPiCalendar is that it is highly customizable. And all of that is done in it's configuration file. After each line there is an explanation of what that line does. experiment with it, and try different things. I would suggest making a back up after each successful attempt so you don't lose everything.

Password Protecting Your Calendar

We are down to the final step. And this step is optional. If you don't want to password protect your website, don't worry about doing this. But if you do, here are the steps.

First thing we need to do is tell Apache that we are going to password protect some directories.
1. Open Terminal (/Applications/Utilities/)
2. Type in "cd /etc/httpd/"
3. Type in "sudo pico httpd.conf"
4. Type in your password.
5. Hold down "Control (CTRL)" and hit "w"
6. Type in "AllowOverride none"
7. Change "None" to "All"
8. Hold down "Control (CTRL)" and hit "x"
9. Hit "y"
10. Hit "Return"

Now Apache will look for authentication files in websites directories. We made one earlier. The ".htaccess" file. But before it will start looking for those we need to restart apache.
1. Type in "sudo apachectl graceful restart"
2. Type in Password if it asks for it.

If you got everything correct, you will see the message:
"/usr/sbin/apachectl graceful: httpd gracefully restarted
/usr/sbin/apachectl restart: httpd restarted
"
after you type in your password. If you see this, everything is working fine, if you see an error message, go back over my instructions thus far, and double check everything. Now we need to create the ".htaccess" files in the folders we are going to protect. (incidentally, you can put this file in any folder that you want password protected from the web.)
1. In Terminal, type in "cd /path/to/your/PHPiCalendar/files/"
2. Type "pico .htaccess"
3. Paste in the following text:

AuthUserFile /private/etc/httpd/.htpasswd
AuthGroupFile /dev/null
AuthName "Friends Only"
AuthType Basic


require valid-user


Now you will probably want another username and password to get to your calendars, then you want to get to your WebDAV folders. To do that follow these steps:
1. Open Terminal
2. Type in "sudo htpasswd -c .htpasswd username" Change "username" to whatever username you want to use, and hit "Return"
3. If it asks for "Password" put in your account password, if it asks for "New Password" then it is asking for the password you want to use for the username you are creating.
4. It will ask you to Re-Type New Password, just retype that password.

Now that we have password authentication on our calendar, we need to change a few things in PHPiCalendar. First, open the configuration file again.
1. Open a finder window and navigate to the location that you pasted your PHPiCalendar files.
2. Hold down "Control" and click on "config.inc.php" Select "Open with" and choose "Text edit" from the list, or if it isn't there, click other, and navigate to "Text Edit" in the Applications folder.
3. Look for the line that starts with "$auth_method" and change "ftp" to "none".
4. Save this file and close it.
5. In that same finder window you opened the configuration file from, open the folder "functions"
6. Hold down "Control" and click on "calendar_functions.php" Select "Open with" and choose "Text edit" from the list, or if it isn't there, click other, and navigate to "Text Edit" in the Applications folder.
7. Look for this line "if (isset($_SERVER['PHP_AUTH_USER'])) {" (It should be around the 26th line)
8. Change that line to this "if ((isset($_SERVER['PHP_AUTH_USER'])) && ($allow_login == 'yes')) {"
9. Save and close it.

Now test your calendar by opening Safari, and typing in that domain. You should get a username/password prompt, and when you type that in, you should get your calendar.

That's it. A long and tough process, but all together not too bad. It beats paying $100 so you can do this on .Mac's servers. If you have any questions or problems, post them to the forums, here is a link directly to a thread I started for this topic.

Page 1, Page 2, Page 3

January 8 2004, 10:41 AM EDT, by




Comments:
Name:
URL or e-Mail: (optional)
Comment: (HTML ok)

iMac G5_468x60
MacMini_02

 Site Links
 Deep Thoughts
Sometimes life seems like a dream, especially when I look down and see that I forgot to put on my pants.

 Around Da Web
iProng:
iPhone steals show at CTIA Wireless 2007
DLO offers dual cover fashion case for iPod
AT&T received 1M inquiries on iPhone
MacDailyNews:
Ars Technica in-depth review: Apple TV ?impressed all those who touched it?
Inside Apple?s Mac OS X 10.5 Leopard Server OS
The chips inside Apple TV
Think Secret:
Adobe Creative Suite 3 pricing revealed
 Olde Stuff
2 Guys Podcast Feed
Greatest American Hero
iAir
Scary Ballmer
Space Game
 We Like:
 • 2 Guys
 • Apple.com

 Side Projects
Jonahan
  • JediPoker.net
  • Jonahan.com
  • iProng
  • MacProng
iKen
  • MacIdiot
Jedbeck
  • Jedbeck.com
J.P.
  • Baby Ashley Project