centos 搭建 darwin calendar 服务器
方法一(官网方法):
useradd caluser ----为日历服务器建立一个新用户,方便管理
passwd caluser -----新用户更改密码
su caluser
mkdir ~/CalendarServer ---- 创建一个专门存放安装包的文件夹
cd ~/CalendarServer
svn co http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk/ CalendarServer-------下载源代码
./run -s # 什么也没发生。。。
./run # 什么也没发生
感觉可能是python版本版本不对,目前是2.4. 只是感觉不对,没有依据。放弃此方法。
方法二(自强方法):
出处:http://www.productionmonkeys.net/guides/calendar-server/darwin-calendar-and-contact-server
1 修改文件系统格式
/etc/fstab
/dev/sda1 / ext3 defaults,user_xattr 1 1
mkdir -p /var/calData/data
chown daemon:daemon /var/calData/documents
chown daemon:daemon /var/calData/data
wget http://www.sqlite.org/sqlite-autoconf-3071200.tar.gz
tar zxf sqlite-autoconf-3071200.tar.gz
cd sqlite-autoconf-3071200
make
make install
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar zxf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr
make
make install
echo '/usr/lib/python2.7' >> /etc/ld.so.conf.d/python2.7.conf
ldconfig
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
svn co http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk PyKerneros
cd PyKerneros
export PATH=$PATH:/usr/kerberos/bin
python setup.py build
python setup.py install
svn co http://svn.calendarserver.org/repository/calendarserver/PyOpenDirectory/trunk PyOpenDirectory
cd PyOpenDirectory
python setup.py build
python setup.py install
passwd calendaruser
su calendaruser
cd ~/calendar
svn co http://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk CalendarServer
svn co http://svn.calendarserver.org/repository/calendarserver/CalDAVClientLibrary/trunk CalDAVClientLibrary
./run -s
su calendaruser
./run
yum
install
sqlite-devel -y
wget peak.telecommunity.com
/dist/ez_setup
.py
python2.6 ez_setup.py
easy_install pysqlite
# setup installation root
mkdir -p /opt/CalendarServer/etc/caldavd
mkdir -p /opt/CalendarServer/var/run/caldavd
mkdir -p /opt/CalendarServer/var/log/caldavd
cd /home/calendaruser/calendar/CalendarServer
./run -v -i /opt/CalendarServer
cp conf/servertoserver-test.xml /opt/CalendarServer/etc/caldavd/servertoserver.xml
cp conf/auth/accounts.xml /opt/CalendarServer/etc/caldavd/accounts.xml
cp conf/caldavd-test.plist /opt/CalendarServer/etc/caldavd/caldavd.plist
cp conf/sudoers.plist /opt/CalendarServer/etc/caldavd/sudoers.plist
<!-- Data root --> <key>DataRoot</key> <string>/var/calData/data</string> <!-- Document root --> <key>DocumentRoot</key> <string>/var/calData/documents</string> <!-- XML File Directory Service --> <key>DirectoryService</key> <dict> <key>type</key> <string>twistedcaldav.directory.xmlfile.XMLDirectoryService</string> <key>params</key> <dict> <key>xmlFile</key> <string>/opt/CalendarServer/etc/caldavd/accounts.xml</string> </dict> </dict> <!-- Principals that can pose as other principals --> <key>SudoersFile</key> <string>/opt/CalendarServer/etc/caldavd/sudoers.plist</string> <!-- Wikiserver authentication (Mac OS X) --> <!-- COMMENT THIS SECTION OUT <key>Wiki</key> <dict> <key>Enabled</key> <true/> <key>Cookie</key> <string>sessionID</string> <key>URL</key> <string>http://127.0.0.1/RPC2</string> <key>UserMethod</key> <string>userForSession</string> <key>WikiMethod</key> <string>accessLevelForUserWikiCalendar</string> </dict> --> <key>LogRoot</key> <string>Logs</string> <!-- Apache-style access log --> <key>AccessLogFile</key> <string>/opt/CalendarServer/var/log/caldavd/access.log</string> <key>RotateAccessLog</key> <false/> <!-- Server activity log --> <key>ErrorLogFile</key> <string>/opt/CalendarServer/var/log/caldavd/error.log</string> <!-- Server process ID file --> <key>PIDFile</key> <string>/opt/CalendarServer/var/run/caldavd/caldavd.pid</string> <!-- Process management --> <key>UserName</key> <string>daemon</string> <key>GroupName</key> <string>daemon</string> <!-- iSchedule protocol options --> <key>iSchedule</key> <dict> <key>Enabled</key> <false/> <key>AddressPatterns</key> <array> </array> <key>Servers</key> <string>/opt/CalendarServer/etc/caldavd/servertoserver.xml</string> </dict> <!-- For child-master IPC. [empty = use tcp] --> <key>ControlSocket</key> <string>/opt/CalendarServer/var/run/caldavd/caldavd.sock</string> <!-- Twisted --> <key>Twisted</key> <dict> <key>twistd</key> <string>/opt/CalendarServer/usr/bin/twistd</string> </dict>
16 启动!
/opt/CalendarServer/usr/bin/caldavd -T /opt/CalendarServer/usr/bin/twistd -f /etc/caldavd/caldavd.plist -X
17 运行时
.....CalendarServer/run -n
可能遇到的问题是
1 python2.7.3 ImportError: No module named twisted.scripts.twistd————安装twisted,或者指定twisted路径
2 python2.7.3 找不到_sqlite3模块——重装安装sqlite-devel之后,重新编译安装python2.7.3