Template:Installation/Preparation/CentOS: Difference between revisions

From diaspora* project wiki
(Added MariaDB.)
(→‎Install packages: added cmake dependency)
Tags: mobile edit mobile web edit
(44 intermediate revisions by one other user not shown)
Line 1: Line 1:
=== Install packages ===
=== Install packages ===


Download and install the latest rpm from http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html
Download and install the latest epel release. <!--rpm from http://download.fedoraproject.org/pub/epel/{{#var:version}}/x86_64/
at the time of this article, the latest was 7.2 and it was as root via
at the time of this article, the latest was {{#switch: {{#var:version}}|6=6.8|7=7.8}}.--> As root run:


{{#tag:syntaxhighlight|
{{#tag:syntaxhighlight|
yum install epel-release
yum install epel-release
|lang=bash}}
|lang=bash}}
Line 12: Line 11:


{{#tag:syntaxhighlight|
{{#tag:syntaxhighlight|
yum install tar make automake gcc gcc-c++ git net-tools libcurl-devel libxml2-devel libffi-devel libxslt-devel wget redis ImageMagick nodejs {{#switch: {{#var:DB}}|mariadb=mariadb-devel|mysql=mariadb-devel|postgres=postgresql-devel}}
yum install tar make automake gcc gcc-c++ git net-tools cmake {{#ifeq: {{#var:version}}|6||libcurl-devel <nowiki/>}}libxml2-devel libffi-devel libxslt-devel wget {{#ifeq: {{#var:version}}|6||redis <nowiki/>}}ImageMagick nodejs {{#switch: {{#var:DB}}|mariadb=mariadb-devel|postgres={{#ifeq: {{#var:version}}|6||postgresql-devel}}}}
|lang=bash}}
|lang=bash}}


=== Activate Redis ===
=== {{#ifeq: {{#var:version}}|6|Install|Activate}} Redis ===
{{#ifeq: {{#var:version}}|6|
To get Redis >=2.8 in CentOS 6, you need an external repository. This enables additional repositories with all its implications. As root run:
 
{{#tag:syntaxhighlight|
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
|lang=bash}}
Activate the <tt>[remi]</tt> repository by setting <code>enabled=1</code> for the corresponding section in <tt>/etc/yum.repos.d/remi.repo</tt>.
<!-- '''Careful''': This enables additional repositories with all its implications. If you wish, you may disable these repositories to avoid undesired packages and versions to be pulled in. You can do this by setting <code>enabled=0</code> for all repos in the files <tt>/etc/yum.repos.d/remi*.repo</tt> except for the <code>[remi]</code> repository, whose setting you amend with <code>includepkgs=redis</code>.-->


To install and activate Redis, as root run:
{{#tag:syntaxhighlight|
yum install redis
chkconfig --level 3 redis on
service redis start
|lang=bash}}
|
CentOS does not enable and start services automatically, so you need to do this manually. As root run:
CentOS does not enable and start services automatically, so you need to do this manually. As root run:


Line 23: Line 37:
systemctl start redis
systemctl start redis
|lang=bash}}
|lang=bash}}
}}


=== Install the database ===
=== Install the database ===


If you do not have it installed already, run as root:
{{#ifeq: {{#var:version}}
{{#switch: {{#var:DB}}|postgres=
| 6
| {{#switch: {{#var:DB}}
  | postgres=
    CentOS 6 ships with an unsupported PostgreSQL version. Please [https://wiki.postgresql.org/wiki/YUM_Installation follow this guide] and install at least PostgreSQL 9.1, including the <code>postgresql<version>-devel</code> package.
Afterwards, as root you need to change the default authentication method by finding these lines in the file <code>/var/lib/pgsql/<version>/data/pg_hba.conf</code> and replacing <code>ident</code> with <code>md5</code>.
{{#tag:syntaxhighlight|
# IPv4 local connections:                                         
host    all            all            127.0.0.1/32            ident
# IPv6 local connections:                                         
host    all            all            ::1/128                ident
}}
Restart PostgreSQL.
  | mysql=
    CentOS 6 ships with an unsupported MySQL version. Thus, you need to install the latest stable MySQL version by using the [https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-fresh-install MySQL yum repo quick guide].
After installation, the server needs to be enabled and started. As root run:
{{#tag:syntaxhighlight|
chkconfig --level 3 mysqld on
service mysqld start
|lang=bash}}
  }}
|
If you do not have it installed already, {{#switch: {{#var:DB}}
| mysql=
[https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7 this installation guide] may help. CentOS 7 does not offer MySQL officially.
| postgres=
run as root:
{{#tag:syntaxhighlight|
{{#tag:syntaxhighlight|
yum install postgresql-server postgresql-contrib
yum install postgresql-server postgresql-contrib
Line 34: Line 74:
systemctl start postgresql
systemctl start postgresql
}}
}}
|mariadb=
| mariadb=
yum install mariadb-server mariadb
[https://mariadb.com/blog/installing-mariadb-10-centos-7-rhel-7 follow this guide].
systemctl enable mariadb
}}
systemctl start mariadb
}}
{{#ifeq: {{#var:version}}|6|
=== Install curl ===
We need a curl >=7.32 from an external repository for diaspora* to work properly. This enables additional repositories with all its implications. As root run:
 
{{#tag:syntaxhighlight|
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm
yum install curl libcurl-devel
|lang=bash}}
<!--'''Careful''': This enables additional repositories. If you wish, you may disable these repositories to avoid undesired packages and versions to be pulled in. You can do this by setting <code>enabled=0</code> for all repos in the file <tt>/etc/yum.repos.d/city-fan.org.repo</tt>.-->
}}
}}



Revision as of 07:59, 25 March 2018

Install packages

Download and install the latest epel release. As root run:

yum install epel-release

Then as root run:

yum install tar make automake gcc gcc-c++ git net-tools cmake libcurl-devel libxml2-devel libffi-devel libxslt-devel wget redis ImageMagick nodejs

Activate Redis

CentOS does not enable and start services automatically, so you need to do this manually. As root run:

systemctl enable redis
systemctl start redis

Install the database

If you do not have it installed already,


Creating a user for diaspora*

As root run:

adduser diaspora
chmod 755 /home/diaspora
su - diaspora
cd ~