Make sure to check out Setup for Apple Users, for some specific server configuration adjustments which act to simplify the configuration experience for Apple (including iPhone) users and some general troubleshooting.
Native CalDAV support in iOS was introduced with software relase 3.0 in july 2009. DAViCal 0.9.7 was released shortly afterwards to support this. OS release 3.1 fixed some bugs and introduced some new ones, and DAViCal release 0.9.7.2 is needed to work with this.
Instructions for configuring the iPhone to use a DAViCal server are on the client configuration pages, here.
Since iOS 7 CardDAV-Accounts can simply be created over the devices interface. For iOS versions older than 7.0 CardDav-Accounts could only be set up via iPhone configuration utility.
Your database has to be prepared for iOS' seperated queries on VEVENT and VTODO collections! Recent DAViCal installations should automatically create proper collections but older databases might need a manual patch.
For proper CalDAV support you'll need at least DAViCal v0.9.9.7. It has been reported (cannot find the link, but I can confirm this) that the path to the collection should omit the collection name and the trailing slash, thus making the path end in <server>/davical/caldav.php/<username> (provided the server is not set up to serve clean URL's)--Vincent 08:47, 18 November 2011 (UTC).