// CentOS 7 minimal install centos 7 minimal // Disable seinux, update & reboot # sed -i-e "s|^SELINUX=.*$|SELINUX=disabled|" /etc/selinux/config # cat /etc/selinux/config # setenforce 0 # getenforce # yum -y update # reboot // If the most recent version of PostgreSQL is desired # rpm -ivh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm // Standard or most recent PostgreSQL version 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/ // Standard or most recent PostgreSQL version initialization # /usr/bin/postgresql-setup initdb // Standard or most recent PostgreSQL version 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 // Standard or most recent PostgreSQL version service enable and start # systemctl enable postgresql && systemctl start postgresql && systemctl status postgresql // Create davical database # 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 // Set up Apache http server # 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 < 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/ AllowOverride None Require all granted 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" 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 <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