Membuat Cloud Storage dengan Owncloud Di Centos 6.5

Requirement :

1. centos 5.6
2. Nginx, PHP, MySQL dan OpenSSL

Tahap instalasi :

petama kita tambahkan repo EPEL di centos server kita, dan install ntp server

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# yum install ntp -y && service ntpd start && chkconfig ntpd on

install PHP
# yum –enablerepo=epel install php-fpm php-gd php-ldap php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mbstring php-mcrypt php-shout php-snmp php-soap php-tidy php-mysql

edit php.ini dan ubah menjadi

# nano /etc/php.ini

post_max_size = 100M
cgi.fix_pathinfo = 0
upload_max_filesize = 100M
date.timezone = “Asia/Jakarta”

edit php-fm agar listen di unix socket

# nano /etc/php-fpm.d/www.conf

;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock

# service php-fpm start && chkconfig php-fpm on

buat database owncloud di mysql server

# CREATE DATABASE owncloud;
# GRANT ALL ON owncloud.* TO ‘user’@’localhost’ IDENTIFIED BY ‘Penyamun007’;
# FLUSH PRIVILEGES;
# exit;

database yang kita buat “owncloud” user = user dan passowrd nya = Penyamun007

install nginx webserver
# yum install nginx -y && service nginx start && chkconfig nginx on
# cd /etc/nginx/conf.d/
# nano virtual.conf

masukaan script di bawah :

#################################################

# redirect http to https.
server {
listen 80;
server_name owncloud.penyamun.com;
rewrite ^ https://$server_name$request_uri? permanent; # enforce https
}
# owncloud (ssl/tls)
server {
listen 443 ssl;
ssl_certificate /etc/nginx/certs/momot-cloud.crt;
ssl_certificate_key /etc/nginx/certs/momot-cloud.key;
server_name owncloud.penyamun.com;
root /var/www/owncloud;
index index.php;
client_max_body_size 64M; # set maximum upload size
# deny direct access
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
# default try order
location / {
try_files $uri $uri/ @webdav;
}
# owncloud WebDAV
location @webdav {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
# enable php
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
}
}

setting SSL untuk HHTPS (pastikan openssl sudah ter install)

# cd /etc/nginx/
# mkdir certs
# touch momot-cloud.crt && touch momot-cloud.key
# openssl req -newkey rsa:2048 -x509 -days 365 -nodes -keyout /etc/nginx/certs/momot-cloud.key -out /etc/nginx/certs/momot-cloud.crt

dan isikan untuk info sertivicate ssl dan next2

reload service nginx

# service nginx restart

dan step terakhir install owncloud

install owncloud
# wget http://download.owncloud.org/community/owncloud-4.5.10.tar.bz2
# tar xjf owncloud-4.5.10.tar.bz2

# mv owncloud /var/www/
# mkdir -p /var/www/owncloud/data
# chmod 770 /var/www/owncloud/data
# chown -R root:apache /var/www/owncloud

login https://IP-SERVER
user = administrator pass = database

dan dy settingan untuk Mysql
user = user , pass = Penyamun007, namedb= owncloud ( sesuai yang kita buat dan setting di mysql )
Finis

About the Author

Leave a Reply