LoginSignup
2
0

More than 5 years have passed since last update.

Ubuntu 17.10 へ ownCloud をインストール (後編)

Posted at

インストールウィザードの実施

 Dataディレクトリの指定

You should locate your ownCloud data directory outside of your Web root if you are using an HTTP server other than Apache,

apache以外を使っていたら、webルート以外に置け、とのこと。

It is best to configure your data directory location at installation, as it is difficult to move after installation. You may put it anywhere; in this example is it located in /var/oc_data. This directory must already exist, and must be owned by your HTTP user (see Set Strong Directory Permissions).

apacheを使っているが、念のため上記の指定ディレクトリに設定する。自分の環境だと無かったので、生成して権限変更。

$ sudo mkdir /var/oc_data
$ sudo chown www-data:www-data /var/oc_data

mariadbがおすすめとのことなので、インストール

$ sudo apt install mariadb-server-10.1
* mariadb-serverだとなぜか依存関係でエラーが発生するので、バージョンを指定する

$ sudo apt install mariadb-server

Webサイトにアクセスしてインストールウィザードを実行

ownCloudのユーザー名、パスワードを入力。データフォルダは任意。
データベースのユーザー名・パスワードはrootを指定。
セットアップを完了する前に、データベースを起動しておくこと。

上記を入力し、セットアップを完了を実行する。
 
 

インストール後の作業

セキュリティを保持するため、下記を実行すること。ocdataなどのパスは適宜変更するべし。

#!/bin/bash
ocpath='/var/www/owncloud'
ocdata='/var/www/owncloud/data'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ocdata
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640
find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocdata}/
#chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
 then
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocdata}/.htaccess ]
 then
  chmod 0644 ${ocdata}/.htaccess
  chown ${rootuser}:${htgroup} ${ocdata}/.htaccess
fi

アップグレード時の作業

こちらを参照
https://doc.owncloud.org/server/latest/admin_manual/maintenance/update.html#set-updating-permissions-label

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0