〇nextcloudの画面
〇構築方法
1.以下のVagrantfileを使用して、nextcloud13.04とPostgreSQL10がインストールされた仮想マシン(Debian Stretch/9.4)を構築できます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.4"
config.vm.hostname = "db94nextcloud1304pg10"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db94nextcloud1304pg10"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.105", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.105", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install postgresql
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
apt-get -y install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get upgrade
apt-get -y install postgresql-10
echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf
#sed -i 's/host.*all.*all.*127.0.0.1/#host all all 127.0.0.1/g' /etc/postgresql/10/main/pg_hba.conf
echo "host all all 127.0.0.1/32 password" >> /etc/postgresql/10/main/pg_hba.conf
echo "host all all 192.168.1.0/24 password" >> /etc/postgresql/10/main/pg_hba.conf
echo "host all all 192.168.55.0/24 password" >> /etc/postgresql/10/main/pg_hba.conf
su - postgres << EOF
createdb -T template0 --locale=ja_JP.UTF-8 --encoding=UTF8 nextcloud
psql -c "
alter user postgres with password 'postgres';
create user nextcloud with password 'nextcloud';
grant all privileges on database nextcloud to nextcloud;
"
EOF
echo "postgres:postgres" | chpasswd
systemctl restart postgresql.service
apt-get -y install apache2 libapache2-mod-php7.0
apt-get -y install php7.0-gd php7.0-json php7.0-pgsql php7.0-curl php7.0-mbstring
apt-get -y install php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip
apt-get -y install unzip
# install nextcloud
wget https://download.nextcloud.com/server/releases/nextcloud-13.0.4.zip
unzip nextcloud-13.0.4.zip
mv nextcloud /opt/nextcloud
chown -R www-data:www-data /opt/nextcloud
ln -s /opt/nextcloud /var/www/html
service apache2 restart
echo 'access http://192.168.1.105/nextcloud/'
echo 'user: nextcloud password:nextcloud db:nextcloud, host: localhost:5432'
SHELL
end
2.ブラウザからhttp://192.168.1.105/nextcloud/にアクセスして、初期設定を行います。管理者の情報の他、以下の情報を指定します。
DB user: nextcloud, DB password: nextcloud, DB: nextcloud, DB host: localhost:5432
○関連情報
・Nextcloudに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿