CentOS 6上安装ownCloud教程

lisahost.com

基于CentOS 6.6 64位,SSH下操作,root权限。
使用的是apache、php、mysql。

1、升级系统

yum update -y

2、安装PHP 5.6

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install httpd php56w php56w-mysql php56w-dom php56w-mbstring php56w-gd php56w-pdo php56w-gd php56w-json php56w-xml php56w-zip curl php56w-curl sqlite -y

3、安装MySQL

yum install mysql mysql-server -y
service mysqld start
mysql_secure_installation

4、编辑 /etc/httpd/conf/httpd.conf
在 下,把 AllowOverride None 修改为 AllowOverride All。
保存。
5、创建数据库
登录mysql

mysql -u root -p

创建数据库(oc_db为创建的数据库,your_root_password为数据库root用户的密码)

CREATE DATABASE oc_db;
GRANT ALL PRIVILEGES ON oc_db.* TO 'root'@'localhost' IDENTIFIED BY 'your_root_password';
FLUSH PRIVILEGES;

退出mysql

CTRL + C

6、启动apache

service httpd start

7、下载owncloud 8.0.4
进入apache目录

cd /var/www/html

下载owncloud

wget https://download.owncloud.org/community/owncloud-8.0.4.zip
unzip owncloud*
rm -rf owncloud-8.0.4.zip
cd owncloud
mv * /var/www/html

8、设置目录权限

chown -R apache.apache /var/www/html/

9、使用IP或者域名,进行web安装,安装说明即可。

  1. .htaccess伪静态,放在根目录:

    # Version: 8.0.4
    SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
    RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    php_value upload_max_filesize 513M
    php_value post_max_size 513M
    php_value memory_limit 512M
    php_value mbstring.func_overload 0
    php_value always_populate_raw_post_data -1
    php_value default_charset 'UTF-8'
    php_value output_buffering off
      SetEnv htaccessWorking true
    RewriteEngine on
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
    RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
    RewriteRule ^\.well-known/carddav /remote.php/carddav/ [R]
    RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R]
    RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L]
    RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L]
    RewriteRule ^remote/(.*) remote.php [QSA,L]
    RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
    RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz
    DirectoryIndex index.php index.html
    AddDefaultCharset utf-8
    Options -Indexes
            ModPagespeed Off
        Header set Cache-Control "max-age=7200, public"
    

via:https://extravm.com/billing/index.php/knowledgebase/21/Install-ownCloud-on-CentOS-6.html

    所有主机信息仅是为及时分享并收录,不做推荐!