Jumat, 30 Januari 2015

Owncloud Di Centos 5 DB Nginx

Membuat Cloud Storage dengan Owncloud Di Centos 5

persiapan server,
Centos 5 bit, Nginx, PHP, MySQL dan OpenSSL
Tahapan Install :
1. update server
yum update
2. Install Repo
#EPEL
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm
#IUS Community
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
#Install repos
rpm -Uvh epel-release-1-1.ius.el5.noarch.rpm ius-release-1.0-6.ius.el5.noarch.rpm
atau
wget wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-13.ius.el5.noarch.rpm
rpm -Uvh ius-release-1.0-13.ius.el5.noarch.rpm
edit :
vi /etc/yum.repos.d/ius.repo
#Comment out this line:
mirrorlist=http://dmirr.iuscommunity.org/mirrorlist?repo=ius-el5&arch=$basearch
#Add this line:
baseurl=http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/$basearch
3. install ntp
yum install ntp -y
service ntpd start
chkconfig ntpd on
4. isntall php
# yum 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
or
yum install php53u-fpm php53u-pecl-apc
5. 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
6. # service php-fpm start
chkconfig php-fpm on
7.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
8. install nginx webserver
# yum install nginx -y && service nginx start && chkconfig nginx on
# cd /etc/nginx/conf.d/
# nano virtual.conf
masukan script di bawah ini :
#
# A virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# redirect http to https.
server {
listen 80;
server_name owncloud.penymun.com;
return 301 https://$server_name$request_uri; # enforce https
}
server {
listen 443 ssl;
server_name cloud.example.com;
ssl_certificate /etc/nginx/certs/momot-cloud.crt;
ssl_certificate_key /etc/nginx/certs/momot-cloud.key;
# Path to the root of your installation
root /var/www/owncloud;
client_max_body_size 10G; # set max upload size
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
index index.php;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location / {
# The following 2 rules are only needed with webfinger
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ index.php;
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 = 404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_param HTTPS on;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
# Or use unix-socket with ‘fastcgi_pass unix:/var/run/php5-fpm.sock;’
}
# Optional: set long EXPIRES header on static assets
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
# Optional: Don’t log access to assets
access_log off;
}
}
9. 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
# service nginx restart
10. 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
11. test akses
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
12 jika problem di modul php
yum install php53u-pdo php53u-gd php53u-mbstring

Tidak ada komentar:

Posting Komentar