Owncloud 5 on Centos 6.4 apache-mysql

How to install owncloud 5 on you centos 6.4 server with mysql and apache to serve it.

First install packages and service needed.

yum -y install mysql-server httpd php php-mysql unzip wget php-json php-xml php-mbstring php-zip php-gd curl php-curl php-pdo mod_ssl

Set apache and mysql to start at boot

chkconfig httpd on
chkconfig mysqld on

Start them up

/etc/init.d/httpd start
/etc/init.d/mysqld start

Make a new file called /tmp/setup_owncloud.sql and put this in the file (Ore past it in the mysql shell)

CREATE DATABASE owncloud;
GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'adshjkahdj!223dasdadsasd99uioiuiods';
FLUSH PRIVILEGES;

run the file

mysql -u root < setup_owncloud.sql

TIME for installing OWNCLOUD

So now you can get owncloud from oen repo or downlod the files you can choose.
I downloaded the tar file and use. But read more on owncloud pageĀ http://owncloud.org/install/

Fix folders

cd /var/www/html

Download owncloud

wget http://download.owncloud.org/community/owncloud-5.0.12.tar.bz2

Set permissions

chown apache:apache -R owncloud/

Create Apache config with vhosts

<VirtualHost *:80>
 ServerAdmin webmaster@elino.net
 ServerName owncloud.elino.net
 ServerAlias owncloud
 DocumentRoot /var/www/owncloud
 <Directory />
 AllowOverride All
 </Directory>
 <Directory /var/www/owncloud>
 AllowOverride All
 Order allow,deny
 allow from all
 </Directory>
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn
 CustomLog logs/own_access.log combined
</VirtualHost>
<VirtualHost *:443>
 ServerAdmin webmaster@elino.net
 ServerName owncloud.elino.net
 DocumentRoot /var/www/owncloud
 SSLEngine On
SSLCertificateFile /etc/httpd/ssl/apache.crt
 SSLCertificateKeyFile /etc/httpd/ssl/apache.key
 <Directory />
 Options FollowSymLinks
 AllowOverride All
 </Directory>
 <Directory /var/www/owncloud>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 allow from all
 </Directory>
 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn
 CustomLog logs/own_access.log combined
</VirtualHost>

Setup https

mkdir /etc/httpd/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt

 

Set up Owncloud

Now its time to set up owncloud surf to you domin for owncloud and press advanced. Put you mysql settings in there that vi created. And choose where to have you data folder.