![]() You can then proceed to plugin installation. Now we can simply use psql from root account. su - postgres -c 'createuser -d -s -r root createdb -O root root' While we need postgres user peer authentication to work for the DirectAdmin PostgreSQL plugin you may prefer to manage PostgreSQL as root. Facilitate your work with PostgreSQLĪs a server admin you may want to have faster access to PostgreSQL client. Similarly you can add PostgreSQL support to other PHP versions. perl -0777 -i.bak -pe 's|^(\./configure \\)$(?!\s*-with-pgsql)|$1\n\t-with-pgsql=/usr/pgsql-12 -with-pdo-pgsql=/usr/pgsql-12 \\|ms' /usr/local/directadmin/custombuild/custom/php/configure.php73įor CentOS 8 the line in configure.php73 should be -with-pgsql=/usr -with-pdo-pgsql=/usr. ![]() To know where is include run dirname $(/usr/pgsql-12/bin/pg_config -includedir). In this case ‘include’ directory is in /usr/pgsql-12 so we use this value. \cp -fp /usr/local/directadmin/custombuild/configure/php/configure.php73 /usr/local/directadmin/custombuild/custom/phpĪdd your -with-pgsql= -with-pdo-pgsql= line to custom/php/configure.php73. Mkdir -p /usr/local/directadmin/custombuild/custom/php usr/local/directadmin/custombuild/configure/php/configure.php73 build used_configs | grep 'PHP (default) configuration' | awk '' In our case default PHP uses configure.php73 and the customized file is not existing so we copy it. If you already have it there please add this line -with-pgsql=/usr/pgsql-12 -with-pdo-pgsql=/usr/pgsql-12 to the file. Now check default PHP version and copy configure.phpXX of the version to custom directory. Yum -y install postgresql12-devel -enablerepo=centos-sclo-rh Yum-config-manager -disable centos-sclo-rh & echo "devel installed" || echo "devel missing" Cloudlinux users may use cloudlinux-scl-release to get libpqxx-devel. ![]() Pure Red Hat users need to download and install centos-release-scl-rh RPM manually. Below yum command section is not needed for CentOS 8 as we already have libpq-devel installed. This is not needed for the plugin itself but for users who may need to access their PostgreSQL databases from PHP. Enabling PostgreSQL support in default PHP You may also use su - postgres -c '/usr/pgsql-12/bin/pg_ctl reload' to reload DB server. #sed -i 's/ident$/md5/' /var/lib/pgsql/data/pg_hba.conf # centos8 Replace ident with md5 in pg_hba.conf sed -i 's/ident$/md5/' /var/lib/pgsql/12/data/pg_hba.conf Su - postgres -c 'psql -tA -c "SHOW data_directory "' Su - postgres -c 'psql -c "SELECT version()"' #systemctl enable -now postgresql # centos8 usr/pgsql-12/bin/postgresql-12-setup initdb Let’s now find where psql resides, init DB server and start it. For example to install postgis you would run yum install postgis30_12. ![]() You may also need to install database extensions if any of the databases to be restored used them. #dnf install postgresql-server postgresql12-contrib libpq-devel # centos8 ![]() #dnf module enable postgresql:12 # centos8 Yum -y install postgresql12-server postgresql12-contrib EPEL is another prerequisite so start with: yum -y install epel-release yum-utilsĮnsure you have latest pgdg repo to avoid broken dependencies: yum remove pgdg-redhat-repoĭefault used to be all repos enabled including pgdg-common so let’s disable uneeded ones: yum-config-manager -disable pgdg11 pgdg10 pgdg96 pgdg95 See how you can install PostgreSQL 12 and build related PHP module. To use Directadmin PostgreSQL plugin you will first need to ensure PostgreSQL server is installed as well as PostgreSQL support in PHP exists. Published on in Control Panels Databases Non-Javaĭebian/Ubuntu users please see this tutorial. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |