Skip to content

Instantly share code, notes, and snippets.

@taniguti
Last active May 8, 2019 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save taniguti/750bac4b786be6428d649c5f98d410ce to your computer and use it in GitHub Desktop.
Save taniguti/750bac4b786be6428d649c5f98d410ce to your computer and use it in GitHub Desktop.
create calendarserver
sudo enable for calendarserver
sudo -iu calendarserver
git clone https://github.com/apple/ccs-calendarserver.git
echo "source CalendarServer/environment.sh" > .profile
cd ccs-calendarserver
export USE_OPENSSL=1
sudo ./bin/package /Users/calendarserver/CalendarServer
cd /Library/Server/
sudo chown -R calendarserver:staff Calendar\ and\ Contacts/
cd Calendar\ and\ Contacts/Data/Database.xpg/cluster.pg
pms01:cluster.pg calendarserver$ ls
PG_VERSION pg_hba.conf pg_replslot pg_subtrans postgresql.conf
base pg_ident.conf pg_serial pg_tblspc postmaster.opts
global pg_logical pg_snapshots pg_twophase
pg_clog pg_multixact pg_stat pg_xlog
pg_dynshmem pg_notify pg_stat_tmp postgresql.auto.conf
pms01:cluster.pg calendarserver$ mv postgresql.conf postgresql.conf.orig
pms01:cluster.pg calendarserver$ ls
PG_VERSION pg_hba.conf pg_replslot pg_subtrans postgresql.conf.orig
base pg_ident.conf pg_serial pg_tblspc postmaster.opts
global pg_logical pg_snapshots pg_twophase
pg_clog pg_multixact pg_stat pg_xlog
pg_dynshmem pg_notify pg_stat_tmp postgresql.auto.conf
pms01:cluster.pg calendarserver$
touch postgresql.conf
pms01:~ calendarserver$ cd CalendarServer/
pms01:CalendarServer calendarserver$ sudo chown -R `whoami` .
pms01:CalendarServer calendarserver$ ls -l
total 4
drwxr-xr-x 31 calendarserver staff 992 Aug 4 00:38 bin
-rw-r--r-- 1 calendarserver staff 684 Aug 4 00:38 environment.sh
drwxr-xr-x 2 calendarserver staff 64 Aug 4 00:38 lib
drwxr-xr-x 3 calendarserver staff 96 Aug 4 00:32 roots
drwxr-xr-x 8 calendarserver staff 256 Aug 4 00:33 virtualenv
pms01:CalendarServer calendarserver$ mkdir conf run logs
cd ~/ccs-calendarserver/contrib/conf
sudo cp org.calendarserver.plist /Library/LaunchAgents
cp calendarserver.plist ~/CalendarServer/conf
mkdir -p ~/CalendarServer/certs
cd ~/CalendarServer/certs/
ls
calendarserver.cert.pem calendarserver.chain.pem calendarserver.key.pem
pms01:certs calendarserver$
sudo find /var/run/caldavd -user _calendar -exec chown calendarserver:staff {} \;
sudo find /var/run -user _calendar -exec chown calendarserver:staff {} \;
---
Take 2
---
ladmin@pms01:~/[3234]$ sudo serveradmin status calendar
calendar:setStateVersion = 1
calendar:readWriteSettingsVersion = 1
calendar:state = "RUNNING"
calendar:contactsState = "RUNNING"
calendar:calendarState = "RUNNING"
ladmin@pms01:~/[3235]$ sudo serveradmin status addressbook
addressbook:state = "RUNNING"
addressbook:setStateVersion = 1
addressbook:readWriteSettingsVersion = 1
ladmin@pms01:~/[3236]$ sudo serveradmin stop addressbook
addressbook:state = "STOPPED"
addressbook:setStateVersion = 1
addressbook:readWriteSettingsVersion = 1
ladmin@pms01:~/[3237]$ sudo serveradmin stop calendar
calendar:setStateVersion = 1
calendar:readWriteSettingsVersion = 1
calendar:state = "STOPPED"
calendar:contactsState = "STOPPED"
calendar:calendarState = "STOPPED"
ladmin@pms01:~/[3238]$ sudo serveradmin status addressbook
addressbook:state = "STOPPED"
addressbook:setStateVersion = 1
addressbook:readWriteSettingsVersion = 1
ladmin@pms01:~/[3239]$ sudo serveradmin status calendar
calendar:setStateVersion = 1
calendar:readWriteSettingsVersion = 1
calendar:state = "STOPPED"
calendar:contactsState = "STOPPED"
calendar:calendarState = "STOPPED"
ladmin@pms01:~/[3240]$ pg_config --version
PostgreSQL 9.4.15
ladmin@pms01:~/[3241]$
brew install postgresql@9.5p
o migrate existing data from a previous minor version (9.0-9.4) of PostgreSQL, see:
https://www.postgresql.org/docs/9.5/static/pgupgrade.html
postgresql exex status:
/Applications/Server.app/Contents/ServerRoot/usr/bin/postgres_real
-c listen_addresses=
-c unix_socket_directories=/var/run/caldavd/PostgresSocket
-c shared_buffers=165
-c max_connections=110
-c standard_conforming_strings=on
-c unix_socket_permissions=0770
-c log_lock_waits=TRUE
-c deadlock_timeout=10
-c log_line_prefix=%m [%p]
-c log_directory=/Library/Server/Calendar and Contacts/Logs
-c log_truncate_on_rotation=on
-c log_filename=postgresql_%w.log
-c log_rotation_age=1440
-c logging_collector=on
-c log_line_prefix=%t
xpostgres
-c listen_addresses=
-c unix_socket_directories=/var/run/caldavd/PostgresSocket
-c shared_buffers=165
-c max_connections=110
-c standard_conforming_strings=on
-c unix_socket_permissions=0770
-c log_lock_waits=TRUE
-c deadlock_timeout=10
-c log_line_prefix=%m [%p]
-c log_directory=/Library/Server/Calendar and Contacts/Logs
-c log_truncate_on_rotation=on
-c log_filename=postgresql_%w.log
-c log_rotation_age=1440
-c logging_collector=on
-c log_line_prefix=%t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment