https://wiki.diasporafoundation.org/api.php?action=feedcontributions&user=Jates&feedformat=atomdiaspora* project wiki - User contributions [en]2024-03-29T14:44:12ZUser contributionsMediaWiki 1.39.3https://wiki.diasporafoundation.org/wiki/index.php?title=Template:Installation/Preparation/CentOS&diff=10238Template:Installation/Preparation/CentOS2018-03-25T07:59:39Z<p>Jates: /* Install packages */ added cmake dependency</p>
<hr />
<div>=== Install packages ===<br />
<br />
Download and install the latest epel release. <!--rpm from http://download.fedoraproject.org/pub/epel/{{#var:version}}/x86_64/<br />
at the time of this article, the latest was {{#switch: {{#var:version}}|6=6.8|7=7.8}}.--> As root run:<br />
<br />
{{#tag:syntaxhighlight|<br />
yum install epel-release<br />
|lang=bash}}<br />
<br />
Then as root run:<br />
<br />
{{#tag:syntaxhighlight|<br />
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}}}}<br />
|lang=bash}}<br />
<br />
=== {{#ifeq: {{#var:version}}|6|Install|Activate}} Redis ===<br />
{{#ifeq: {{#var:version}}|6|<br />
To get Redis >=2.8 in CentOS 6, you need an external repository. This enables additional repositories with all its implications. As root run:<br />
<br />
{{#tag:syntaxhighlight|<br />
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm<br />
|lang=bash}}<br />
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>.<br />
<!-- '''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>.--><br />
<br />
To install and activate Redis, as root run:<br />
{{#tag:syntaxhighlight|<br />
yum install redis<br />
chkconfig --level 3 redis on<br />
service redis start<br />
|lang=bash}}<br />
|<br />
CentOS does not enable and start services automatically, so you need to do this manually. As root run:<br />
<br />
{{#tag:syntaxhighlight|<br />
systemctl enable redis<br />
systemctl start redis<br />
|lang=bash}}<br />
}}<br />
<br />
=== Install the database ===<br />
<br />
{{#ifeq: {{#var:version}}<br />
| 6<br />
| {{#switch: {{#var:DB}}<br />
| postgres=<br />
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.<br />
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>.<br />
{{#tag:syntaxhighlight|<br />
# IPv4 local connections: <br />
host all all 127.0.0.1/32 ident<br />
# IPv6 local connections: <br />
host all all ::1/128 ident<br />
}}<br />
Restart PostgreSQL.<br />
| mysql=<br />
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].<br />
After installation, the server needs to be enabled and started. As root run:<br />
{{#tag:syntaxhighlight|<br />
chkconfig --level 3 mysqld on<br />
service mysqld start<br />
|lang=bash}}<br />
}}<br />
|<br />
If you do not have it installed already, {{#switch: {{#var:DB}}<br />
| mysql=<br />
[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.<br />
| postgres=<br />
run as root:<br />
{{#tag:syntaxhighlight|<br />
yum install postgresql-server postgresql-contrib<br />
postgresql-setup initdb<br />
systemctl enable postgresql<br />
systemctl start postgresql<br />
}}<br />
| mariadb=<br />
[https://mariadb.com/blog/installing-mariadb-10-centos-7-rhel-7 follow this guide].<br />
}}<br />
}}<br />
{{#ifeq: {{#var:version}}|6|<br />
=== Install curl ===<br />
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:<br />
<br />
{{#tag:syntaxhighlight|<br />
rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/city-fan.org-release-1-13.rhel6.noarch.rpm<br />
yum install curl libcurl-devel<br />
|lang=bash}}<br />
<!--'''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>.--><br />
}}<br />
<br />
=== Creating a user for diaspora* ===<br />
<br />
As root run:<br />
{{#tag:syntaxhighlight|<br />
adduser diaspora<br />
chmod 755 /home/diaspora<br />
su - diaspora<br />
cd ~<br />
|lang=bash}}<br />
<noinclude><br />
[[Category:Installation-Templates]]<br />
</noinclude></div>Jates