DAViCal: Difference between revisions
Jump to navigation
Jump to search
(Created page with "EL 8/9 Install OS // Disable selinux, update & reboot # sed -i-e "s|^SELINUX=.*$|SELINUX=disabled|" /etc/selinux/config # cat /etc/selinux/config # setenforce 0 # getenforce # yum -y update // Install PostgreSQL and dependencies # yum -y install httpd git php php-pgsql php-gettext postgresql-server perl-DBD-Pg perl-YAML // Install DAViCal calendar and contacts server # cd /usr/share # git clone https://gitlab.com/davical-project/davical.git && \ git cl...") |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
EL 8/9 | [[Calendar|Back]] | ||
EL 8/9 | |||
// Disable selinux, update & reboot | // Disable selinux, update & reboot | ||
# sed -i-e "s|^SELINUX=.*$|SELINUX=disabled|" /etc/selinux/config | # sed -i-e "s|^SELINUX=.*$|SELINUX=disabled|" /etc/selinux/config | ||
Line 7: | Line 6: | ||
# setenforce 0 | # setenforce 0 | ||
# getenforce | # getenforce | ||
# yum -y update | # yum -y update<br> | ||
// Install PostgreSQL and dependencies | // Install PostgreSQL and dependencies | ||
# yum -y install httpd git php php-pgsql php-gettext postgresql-server perl-DBD-Pg perl-YAML | # yum -y install httpd git php php-pgsql php-gettext postgresql-server perl-DBD-Pg perl-YAML<br> | ||
// Install DAViCal calendar and contacts server | // Install DAViCal calendar and contacts server | ||
# cd /usr/share | # cd /usr/share | ||
# git clone https://gitlab.com/davical-project/davical.git && \ | # git clone https://gitlab.com/davical-project/davical.git && \ | ||
git clone https://gitlab.com/davical-project/awl.git && \ | git clone https://gitlab.com/davical-project/awl.git && \ | ||
rm -rf ./davical/.git/ && rm -rf ./awl/.git/ | rm -rf ./davical/.git/ && rm -rf ./awl/.git/<br> | ||
// PostgreSQL initialization | // PostgreSQL initialization | ||
# /usr/bin/postgresql-setup initdb | # /usr/bin/postgresql-setup initdb<br> | ||
// PostgreSQL user database configuration | // PostgreSQL user database configuration | ||
# file=/var/lib/pgsql/data/pg_hba.conf | # file=/var/lib/pgsql/data/pg_hba.conf | ||
Line 28: | Line 23: | ||
# awk -v n=$num -v s="local davical davical_app trust\nlocal davical davical_dba trust" \ | # awk -v n=$num -v s="local davical davical_app trust\nlocal davical davical_dba trust" \ | ||
'NR == n {print s} {print}' $file.bak > $file | 'NR == n {print s} {print}' $file.bak > $file | ||
# cat $file | # cat $file<br> | ||
// PostgreSQL service enable and start | // PostgreSQL service enable and start | ||
# systemctl enable | # systemctl enable --now postgresql && systemctl status postgresql<br> | ||
// Create PostgreSQL DAViCal database <span style="color:red">(Save password which is output after database creation)</span> | |||
// Create PostgreSQL DAViCal database (Save password which is output after database creation) | # sudo -u postgres /usr/share/davical/dba/create-database.sh<br> | ||
# sudo -u postgres /usr/share/davical/dba/create-database.sh | |||
// If this is a migration import database from old server | // If this is a migration import database from old server | ||
(On old server) | (On old server) | ||
Line 43: | Line 35: | ||
# sudo -u postgres dropdb davical | # sudo -u postgres dropdb davical | ||
# sudo -u postgres createdb davical | # sudo -u postgres createdb davical | ||
# sudo -u postgres psql davical < /root/davical.psql | # sudo -u postgres psql davical < /root/davical.psql<br> | ||
// Create Apache and DAViCal configuration directories | // Create Apache and DAViCal configuration directories | ||
# mkdir /etc/httpd/sites-available && mkdir /etc/httpd/sites-enabled && mkdir /etc/davical | # mkdir /etc/httpd/sites-available && mkdir /etc/httpd/sites-enabled && mkdir /etc/davical<br> | ||
// Create DAViCal virtual host in Apache, enable the site, and start Apache | // Create DAViCal virtual host in Apache, enable the site, and start Apache | ||
# tee -a /etc/httpd/sites-available/davical2.whitehorsetc.com.conf <<END | # tee -a /etc/httpd/sites-available/davical2.whitehorsetc.com.conf <<END | ||
<VirtualHost *:80> | <VirtualHost *:80> | ||
DocumentRoot /usr/share/davical/htdocs | DocumentRoot /usr/share/davical/htdocs | ||
DirectoryIndex index.php index.html | DirectoryIndex index.php index.html | ||
Line 65: | Line 55: | ||
php_value error_reporting "E_ALL & ~E_NOTICE" | php_value error_reporting "E_ALL & ~E_NOTICE" | ||
php_value default_charset "utf-8" | php_value default_charset "utf-8" | ||
</VirtualHost> | </VirtualHost> | ||
END | END<br> | ||
# cat /etc/httpd/sites-available/davical2.whitehorsetc.com.conf | # cat /etc/httpd/sites-available/davical2.whitehorsetc.com.conf | ||
# ln -s /etc/httpd/sites-available/davical2.whitehorsetc.com.conf \ | # ln -s /etc/httpd/sites-available/davical2.whitehorsetc.com.conf \ | ||
/etc/httpd/sites-enabled/davical2.whitehorsetc.com.conf | /etc/httpd/sites-enabled/davical2.whitehorsetc.com.conf | ||
# ls -l /etc/httpd/sites-enabled | # ls -l /etc/httpd/sites-enabled | ||
# cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak | # cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak<br> | ||
# tee -a /etc/httpd/conf/httpd.conf <<END | |||
# tee -a /etc/httpd/conf/httpd.conf <<END | # Include the virtual host configurations: | ||
# Include the virtual host configurations: | IncludeOptional sites-enabled/*.conf | ||
IncludeOptional sites-enabled/*.conf | END<br> | ||
END | |||
# cat /etc/httpd/conf/httpd.conf | # cat /etc/httpd/conf/httpd.conf | ||
# systemctl enable | # systemctl enable --now httpd && systemctl status httpd<br> | ||
// Configure DAViCal to connect to database | // Configure DAViCal to connect to database | ||
# tee -a /etc/davical/davical2.whitehorsetc.com-conf.php <<END | # tee -a /etc/davical/davical2.whitehorsetc.com-conf.php <<END | ||
<?php | <?php | ||
\$c->domain_name = "davical2.whitehorsetc.com"; | \$c->domain_name = "davical2.whitehorsetc.com"; | ||
\$c->sysabbr = 'DAViCal'; | \$c->sysabbr = 'DAViCal'; | ||
Line 90: | Line 76: | ||
\$c->system_name = "Example DAViCal Server"; | \$c->system_name = "Example DAViCal Server"; | ||
\$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app'; | \$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app'; | ||
?> | ?> | ||
END | END<br> | ||
# cat /etc/davical/davical2.whitehorsetc.com-conf.php<br> | |||
# cat /etc/davical/davical2.whitehorsetc.com-conf.php | |||
Create DNS entry for your DAViCal Calendar & Contact server, | Create DNS entry for your DAViCal Calendar & Contact server, | ||
browse to it, and enter users and groups: http://davical2.whitehorsetc.com/ | browse to it, and enter users and groups: http://davical2.whitehorsetc.com/ | ||
Use 'admin' and password output at database creation (noted above in | Use 'admin' and password output at database creation (noted above in red font) to log in<br> | ||
*Note: 1) Replace 'davical2.whitehorsetc.com' wherever found with your hostname | *Note: 1) Replace 'davical2.whitehorsetc.com' wherever found with your hostname | ||
2) Select items in red (tee to END), paste in terminal, and return | 2) Select items in red (tee to END), paste in terminal, and return | ||
3) DAViCal CalDav Store | 3) DAViCal CalDav Store | ||
4) Https security should be implemented over the internet | 4) Https security should be implemented over the internet<br> | ||
Text version of this outline...possibly, for a script<br> | |||
Text version of this outline...possibly, for a script | |||
Clients: | Clients: | ||
1) Outlook (CalDav plugin necessary. CalDav Synchronizer) | 1) Outlook (CalDav plugin necessary. CalDav Synchronizer) | ||
2) Thunderbird (Lightning) | 2) Thunderbird (Lightning) | ||
3) One Calendar | 3) One Calendar<br> | ||
// List databases (Linux command line) | // List databases (Linux command line) | ||
# sudo -u postgres psql -l | # sudo -u postgres psql -l |
Latest revision as of 08:16, 4 April 2024
EL 8/9 // Disable selinux, update & reboot # sed -i-e "s|^SELINUX=.*$|SELINUX=disabled|" /etc/selinux/config # cat /etc/selinux/config # setenforce 0 # getenforce # yum -y update
// Install PostgreSQL and dependencies # yum -y install httpd git php php-pgsql php-gettext postgresql-server perl-DBD-Pg perl-YAML
// Install DAViCal calendar and contacts server # cd /usr/share # git clone https://gitlab.com/davical-project/davical.git && \ git clone https://gitlab.com/davical-project/awl.git && \ rm -rf ./davical/.git/ && rm -rf ./awl/.git/
// PostgreSQL initialization # /usr/bin/postgresql-setup initdb
// PostgreSQL user database configuration # file=/var/lib/pgsql/data/pg_hba.conf # mv $file $file.bak # num=`grep -n "# TYPE DATABASE USER ADDRESS METHOD" $file.bak \ | awk -F: '{print $1}'` && ((num++)) # awk -v n=$num -v s="local davical davical_app trust\nlocal davical davical_dba trust" \ 'NR == n {print s} {print}' $file.bak > $file # cat $file
// PostgreSQL service enable and start # systemctl enable --now postgresql && systemctl status postgresql
// Create PostgreSQL DAViCal database (Save password which is output after database creation) # sudo -u postgres /usr/share/davical/dba/create-database.sh
// If this is a migration import database from old server (On old server) # pg_dump davical > davical.psql # scp davical.psql root@'new server ip':/root (On new server) # sudo -u postgres dropdb davical # sudo -u postgres createdb davical # sudo -u postgres psql davical < /root/davical.psql
// Create Apache and DAViCal configuration directories # mkdir /etc/httpd/sites-available && mkdir /etc/httpd/sites-enabled && mkdir /etc/davical
// Create DAViCal virtual host in Apache, enable the site, and start Apache # tee -a /etc/httpd/sites-available/davical2.whitehorsetc.com.conf <<END <VirtualHost *:80> DocumentRoot /usr/share/davical/htdocs DirectoryIndex index.php index.html ServerName davical2.whitehorsetc.com ServerAlias davical2.whitehorsetc.com Alias /images/ /usr/share/davical/htdocs/images/ <Directory /usr/share/davical/htdocs/> AllowOverride None Require all granted </Directory> php_value include_path /usr/share/awl/inc php_value magic_quotes_gpc 0 php_value register_globals 0 php_value error_reporting "E_ALL & ~E_NOTICE" php_value default_charset "utf-8" </VirtualHost> END
# cat /etc/httpd/sites-available/davical2.whitehorsetc.com.conf # ln -s /etc/httpd/sites-available/davical2.whitehorsetc.com.conf \ /etc/httpd/sites-enabled/davical2.whitehorsetc.com.conf # ls -l /etc/httpd/sites-enabled # cp -p /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
# tee -a /etc/httpd/conf/httpd.conf <<END # Include the virtual host configurations: IncludeOptional sites-enabled/*.conf END
# cat /etc/httpd/conf/httpd.conf # systemctl enable --now httpd && systemctl status httpd
// Configure DAViCal to connect to database # tee -a /etc/davical/davical2.whitehorsetc.com-conf.php <<END <?php \$c->domain_name = "davical2.whitehorsetc.com"; \$c->sysabbr = 'DAViCal'; \$c->admin_email = 'postmaster@whitehorsetc.com'; \$c->system_name = "Example DAViCal Server"; \$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app'; ?> END
# cat /etc/davical/davical2.whitehorsetc.com-conf.php
Create DNS entry for your DAViCal Calendar & Contact server, browse to it, and enter users and groups: http://davical2.whitehorsetc.com/ Use 'admin' and password output at database creation (noted above in red font) to log in
*Note: 1) Replace 'davical2.whitehorsetc.com' wherever found with your hostname 2) Select items in red (tee to END), paste in terminal, and return 3) DAViCal CalDav Store 4) Https security should be implemented over the internet
Text version of this outline...possibly, for a script
Clients: 1) Outlook (CalDav plugin necessary. CalDav Synchronizer) 2) Thunderbird (Lightning) 3) One Calendar
// List databases (Linux command line) # sudo -u postgres psql -l // Database commands from psql # sudo -u postgres psql postgres=# help You are using psql, the command-line interface to PostgreSQL. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit // List databases postgres=# \l // Access database for manipulation postgres=# \c 'database'