Thursday, January 8, 2015

How to install OwnCloud 7 on CentOS 7

I based this post on this, http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-owncloud-7-on-centos-7-rhel-7.html , but with some changes, like installing OwnCloud through the repository instead of extracting the tar archive. This way we get yum updates. There are other some minor changes.

We install with yum the prerequisites,

yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo wget


I don't like SELinux as it gave me a big headache with Samba 4 AD, and have disabled it already. The howto I am based on mentions to run this command in order to allow OwnCloud to write data, but I have not tested it:

setsebool -P httpd_unified 1


Opening ports to Apache in firewall,

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload


Start Apache and MariaDB,

systemctl start httpd.service
systemctl start mariadb.service

Auto start the service at system start-up.

systemctl enable httpd.service
systemctl enable mariadb.service

Download and setup. We first install the repo. It is the official one.

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-7/isv:ownCloud:community.repo
yum install owncloud

Setting the owner to Apache:

chown -R apache:apache /var/www/html/owncloud/

Now we create the database and the user for MariaDB:

mysql -u root -p
create database clouddb;
grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'password';

Next is configure the virtual host Apache file,

vi /etc/httpd/conf.d/owncloud.conf

Add the following,

<Directory /var/www/html/owncloud>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Restart Apache server,

systemctl restart httpd.service

And then you are good to go to https://yourserver/owncloud to further configuration. Select MySQL/MariaDB instead of SQLite.


Para este post me he basado en: http://www.itzgeek.com/how-tos/linux/centos-how-tos/install-owncloud-7-on-centos-7-rhel-7.html , pero con algunos cambios, como instalar OwnCloud a través del repostorio en vez de sólo extraer el fichero tar. De esta manera, tenemos actualizaciones con yum. Hay algún otro cambio menor.

Instalamos con yum los prerequisitos,

yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo wget


No me gusta SELinux ya que me dio muchos problemas en un AD con Samba 4, por lo que lo tengo deshabilitado. El howto en el que me baso indica ejecutar este comando para permitir a OwnCloud que pueda escribir sus propios datos. Esto no lo he testeado:

setsebool -P httpd_unified 1


Abrimos puertos para Apache en el firewall,

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload


Arrancamos Apache y MariaDB,

systemctl start httpd.service
systemctl start mariadb.service

Para que los servicios arranquen automáticamente en el botado,

systemctl enable httpd.service
systemctl enable mariadb.service

Bajamos OwnCloud y configuramos. Primero instalamos el repo. Es el oficial.

cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-7/isv:ownCloud:community.repo
yum install owncloud

Ponemos como propietario a Apache:

chown -R apache:apache /var/www/html/owncloud/

Ahora se crea la base de datos y el usuario en MariaDB:

mysql -u root -p
create database clouddb;
grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'password';

Lo siguiente es configurar el fichero de virtual host de Apache,

vi /etc/httpd/conf.d/owncloud.conf

Se añade lo siguiente,

<Directory /var/www/html/owncloud>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Reiniamos el servidor Apache,

systemctl restart httpd.service

Y a partir de aquí ya podemos ir a https://yourserver/owncloud para seguir configurando. Seleccionamos MySQL/MariaDB en vez de SQLite.

Friday, January 2, 2015

Installing Samba 4 on CentOS 7

If you try to install a Samba 4 domain controller in a CentOS 7, you will find that some essential things are missing, like the samba-tool command which is required to set up AD.

This is because RHEL uses MIT Kerberos implementation which does not support Samba AD at the moment (they are working on it) as stated in https://blog.cryptomilk.org/2014/07/09/samba-ad-dc-in-fedora-and-rhel/

But we can use SerNet's repo for CentOS 7. There is another repo available for CentOS 6 also.

Steps are:

1. Go to https://portal.enterprisesamba.com and register.
2. Download the rpms, or better configure yum repo (you will find all there, just add it to /etc/yum.repos.d ).
3. Do a yum install sernet-samba-ad sernet-samba

 [root@setovi yum.repos.d]# yum search sernet  
 Loaded plugins: fastestmirror, langpacks  
 Loading mirror speeds from cached hostfile  
  * base: ftp.cixug.es  
  * extras: ftp.cixug.es  
  * updates: ftp.cixug.es  
 ============================================= N/S matched: sernet =============================================  
 sernet-samba.x86_64 : SerNet Samba SMB/CIFS file, print and authentication server  
 sernet-samba-ad.x86_64 : SerNet Samba AD domain controller  
 sernet-samba-client.x86_64 : SerNet Samba Client Utilities  
 sernet-samba-common.x86_64 : SerNet Samba Common Files  
 sernet-samba-debuginfo.x86_64 : Debug information for package sernet-samba  
 sernet-samba-libs.x86_64 : SerNet Samba Common Library Files  
 sernet-samba-libsmbclient-devel.x86_64 : SerNet Samba header files to develop programs with smbclient support  
 sernet-samba-libsmbclient0.x86_64 : SerNet Samba client library  
 sernet-samba-winbind.x86_64 : SerNet Samba winbind daemon and tool  
 sernet-samba-libwbclient-devel.x86_64 : Libraries and Header Files to Develop Programs with wbclient Support  
  Name and summary matches only, use "search all" for everything.  
 [root@setovi yum.repos.d]#  
Si intentáis instalar un controlador de dominio Samba 4 en una CentOS 7, vais a encontraros con que faltan cosas esenciales, como el comando samba-tool con el que se configura el AD.

Esto se debe a que RHEL usa la implementación de Kerberos del MIT, que a día de hoy no soporta el AD de Samba, aunque están trabajando en ello. Más info en https://blog.cryptomilk.org/2014/07/09/samba-ad-dc-in-fedora-and-rhel/

Pero se puede usar los repos de SerNet para CentOS 7. Hay otro repo para CentOS 6 también.

Los pasos son:

1. Ir a https://portal.enterprisesamba.com y registrarse.
2. Descargar los rpms, o mejor configurar el repo (en la web encontraréis todo, sólo hay que añadirlo a /etc/yum.repos.d ).
3. Ejecutar un  yum install sernet-samba-ad sernet-samba

 [root@setovi yum.repos.d]# yum search sernet  
 Loaded plugins: fastestmirror, langpacks  
 Loading mirror speeds from cached hostfile  
  * base: ftp.cixug.es  
  * extras: ftp.cixug.es  
  * updates: ftp.cixug.es  
 ============================================= N/S matched: sernet =============================================  
 sernet-samba.x86_64 : SerNet Samba SMB/CIFS file, print and authentication server  
 sernet-samba-ad.x86_64 : SerNet Samba AD domain controller  
 sernet-samba-client.x86_64 : SerNet Samba Client Utilities  
 sernet-samba-common.x86_64 : SerNet Samba Common Files  
 sernet-samba-debuginfo.x86_64 : Debug information for package sernet-samba  
 sernet-samba-libs.x86_64 : SerNet Samba Common Library Files  
 sernet-samba-libsmbclient-devel.x86_64 : SerNet Samba header files to develop programs with smbclient support  
 sernet-samba-libsmbclient0.x86_64 : SerNet Samba client library  
 sernet-samba-winbind.x86_64 : SerNet Samba winbind daemon and tool  
 sernet-samba-libwbclient-devel.x86_64 : Libraries and Header Files to Develop Programs with wbclient Support  
  Name and summary matches only, use "search all" for everything.  
 [root@setovi yum.repos.d]#