Vous êtes sur la page 1sur 4

--------------------------------------------------------CONFIGURAO DO OWNCLOUD 8.

1 NO CENTOS 7
--------------------------------------------------------1. Configurar IP e nome do Host
1.1. Altere seus dados de rede
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
1.2. Coloque um hostname para o computador incluindo os parametros abaix
o no arquivo network
# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=aqui_colocamos_o_nome
2. Instalar os pacotes necessrios para configurao do sistema
# yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom
php-mbstring php-gd php-pdo wget
3. Destivar o SELinux caso no utilize o mesmo
O OwnCloud funciona sem desativar, porm o envio de e-mail no funcionar.
3.1. Permita o OwnCloud usar gravar dados pelo SELinux
# setsebool -P httpd_unified 1
3.2. Ou desative definitivamente o SELinux
# vim /etc/selinux/config
Mudar o parmetro SELINUX=enforcing para SELINUX=disabled
4. Configurar os programas recm instalado
4.1. Libere o acesso do Apache no Firewall
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload
4.2. Inicie os servios do Apache e MariaDB
# systemctl start httpd.service
# systemctl start mariadb.service
4.3. Configure os servios para iniciar automaticamente com o Linux
# systemctl enable httpd.service
# systemctl enable mariadb.service
5. Instalar SSL para acesso via https
5.1. Instalar o mod-ssl para o Apache via yum
# sudo yum install mod_ssl

5.2. Criar uma pasta para armazenar o certificado


# sudo mkdir /etc/httpd/ssl
5.3. Criar um novo certificado
# sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyo
ut /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt
Onde:
-openssl : This is the basic command line tool for creating and
managing OpenSSL certificates, keys, and other files.
-req -x509: This specifies that we want to use X.509 certificate
signing request (CSR) management. The "X.509" is a public key infrastructure st
andard that SSL and TLS adhere to for key and certificate management.
-nodes
: This tells OpenSSL to skip the option to secure our
certificate with a passphrase. We need Apache to be able to read the file, witho
ut user intervention, when the server starts up. A passphrase would prevent this
from happening, since we would have to enter it after every restart.
-days 365 : This option sets the length of time that the certifi
cate will be considered valid. We set it for one year here.
-newkey rsa:2048: This specifies that we want to generate a new
certificate and a new key at the same time. We did not create the key that is re
quired to sign the certificate in a previous step, so we need to create it along
with the certificate. The rsa:2048 portion tells it to make an RSA key that is
2048 bits long.
-keyout : This line tells OpenSSL where to place the generated
private key file that we are creating.
-out
: This tells OpenSSL where to place the certificate th
at we are creating.
Preencher os dados conforme solicitado:
Country Name (2 letter code) [XX]:BR
State or Province Name (full name) []:ESTADO
Locality Name (eg, city) [Default City]:CIDADE
Organization Name (eg, company) [Default Company Ltd]:EM
PRESA LTDA
Organizational Unit Name (eg, section) []:DEPTO TI
Common Name (eg, your name or your server's hostname) []
:OWNCLOUD
Email Address []:webmaster@example.com
5.4. Ajustar o certificado
# sudo vi /etc/httpd/conf.d/ssl.conf
Na seo <VirtualHost _default_:443> alterar os parametros:
DocumentRoot "/var/www/example.com/public_html"
ServerName owncloud

(ou o que foi digitado em Common

Name acima)
SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key
5.7. Ajustar o certificado para habilitar o Strict Transport para direci

onar toda solicitao para a porta SSL


# sudo vi /etc/httpd/conf.d/ssl.conf
Na seo <VirtualHost _default_:443> adicionar logo aps o parametro S
erverName:
Header always add Strict-Transport-Security "max-age=157
68000; includeSubDomains; preload"
5.6. Ativar o certificado reiniciando o Apache
# sudo apachectl restart
Testar o Certificado acessando o caminho https://example.com/ pe
lo Browser
6. Instalar o OwnCloud 7 Server
# cd /etc/yum.repos.d/
# wget http://download.opensuse.org/repositories/isv:ownCloud:community/
CentOS_7/isv:ownCloud:community.repo
# yum install owncloud
6.1. Permitir o acesso do WebServer a pasta do OwnCloud
# chown -R apache.apache /var/www/html/owncloud/
7. Configurar o banco de dados MariaDb
7.1. Conectar ao MySQL
# mysql -u root -p
7.2. Criar um novo Database
MariaDB> create database clouddb;
7.3. Criar um novo usurio com permisso de escrita no novo Database, nesse
passo dever ser definida a
senha de acesso ao banco
MariaDB> grant all on clouddb.* to 'clouddbuser'@'localhost' ide
ntified by 'senha';
8. Configurar o Apache
# vi /etc/httpd/conf.d/owncloud.conf
Inclua os seguintes parametros:
<IfModule mod_alias.c>
Alias /owncloud /var/www/html/owncloud
</IfModule>
<Directory /var/www/html/owncloud >
Options Indexes FollowSymLinks

AllowOverride All
Order allow,deny
allow from all
</Directory>
8.1. Reiniciar o Apache
# systemctl restart httpd.service
9. Configure o OwnCloud
9.1. Acessar o endereo
http://your-ip-address/owncloud
9.2. Criar um usurio e senha de administrador
9.3. Escolher a pasta de armazenamento dos dados em nuvem
9.4. Conectar ao banco de dados MariaDb preenchendo os dados em tela
Username:
Password:
Database:
Host
:

cloddbuser
a senha que criou no passo 7.3
clouddb
localhost

9.5. Clicar em "Finish"


10. O sistema ser direcionado a tela de boas-vindas do OwnCloud
11. Configuracao final
Inserir a listagem de domnios confiveis
# vi /var/www/html/owncloud/config/config.php
Inclua os endereos que sero usados para acesso ao servidor no parametro 't
rusted_domains' conforme exemplo:
OBS: No remova nenhuma virgula da estrutura e coloque um endereo por linha
.
'trusted_domains' =>
array (
0 => '192.168.0.42',
1 => '191.36.208.34:9999',
2 => '177.47.247.214:9999',
),

HAVE FUN!!!

Vous aimerez peut-être aussi