忘れがちなことを、つらつらと...

俺的備忘録を公開してみるテスト

CentOS 6.6 にowncloud 8 をインストールしたときのメモ

備忘録(絶賛修正中!)

前提条件

仮想環境上に、CentOS 6.6 minimalでインストール

まずは準備!

リポジトリ追加

# yum install epel-release -y
# yum install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm -y
# cd /etc/yum.repos.d/
# yum install wget -y
# wget http://download.opensuse.org/repositories/isv:ownCloud:community/CentOS_CentOS-6/isv:ownCloud:community.repo
# vi isv:ownCloud:community.repo

enabled=1
  ↓
enabled=0

更新

# yum upgrade -y
# reboot

不要サービス停止(※物理サーバーの場合は考えたほうがいい)

# chkconfig --level 0123456 auditd off
# chkconfig --level 0123456 blk-availability off
# chkconfig --level 0123456 ip6tables off
# chkconfig --level 0123456 kdump off
# chkconfig --level 0123456 lvm2-monitor off
# chkconfig --level 0123456 mdmonitor off
# chkconfig --level 0123456 netfs off
# chkconfig --level 0123456 rdisc off
# chkconfig --level 0123456 restorecond off
# chkconfig --level 0123456 saslauthd off

IPv6無効

# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
# echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
# sysctl -p

ファイアーウォール設定

# vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m multiport -p tcp --dport 80,443 -j ACCEPT  ← 追加
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

# service iptables restart

MySQLを設定する

# yum install mysql-server mysql-devel mysqlclient mysql --enablerepo=remi -y
# chkconfig mysqld on
# service mysqld start
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): ← 初期rootパスワードは空なのでそのままEnter
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] ← 設定するのでそのままEnter
New password:          ← パスワード設定
Re-enter new password:   ← 上と同じパスワード設定
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] ← そのままEnter
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] ← そのままEnter
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] ← そのままEnter
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] ← そのままEnter
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!