2018年2月27日火曜日

VagrantでTiny Tiny RSSとMySQLをインストールした仮想マシン(Debian Stretch/9.3)を構築する

Tiny Tiny RSSはPHP製のフィードリーダーです。
以下のVagrantfileを使用して、Tiny Tiny RSSとMySQLがインストールされた仮想マシン(Debian Stretch/9.3 )を構築する事ができます。
仮想マシン構築後、ブラウザからhttp://192.168.55.101/ttrss/にアクセスして初期設定を行います。

Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "bento/debian-9.3"
  config.vm.hostname = "db93tinytinyrss"
  config.vm.provider :virtualbox do |vbox|
     vbox.name = "db93tinytinyrss"
     vbox.cpus = 2
     vbox.memory = 2048
     vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
  end
config.vm.network "private_network", ip: "192.168.55.101", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.101", :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 mysql
wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
export DEBIAN_FRONTEND=noninteractive
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
dpkg -i mysql-apt-config_0.8.9-1_all.deb
apt-get update
apt-get -y install mysql-server
mysql -uroot -e "CREATE DATABASE ttrss DEFAULT CHARACTER SET utf8;"
mysql -uroot -e "CREATE USER ttrss@localhost IDENTIFIED BY 'ttrss';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON ttrss.* TO 'ttrss'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"


# install PHP
apt-get -y install apache2 apache2-bin libapache2-mod-php7.0 php7.0-mysql php7.0-mbstring php7.0-xml php7.0-json php7.0-intl php7.0-gd php7.0-curl


# install Tiny Tiny RSS
wget https://git.tt-rss.org/fox/tt-rss/archive/master.tar.gz
tar xvfz master.tar.gz
mv tt-rss /opt/ttrss


chown -R www-data:www-data /opt/ttrss
sudo ln -s /opt/ttrss/ /var/www/html/
service apache2 restart

cat << EOF >> /etc/systemd/system/ttrss.service
[Unit]
Description=ttrss_backend
After=network.target mysql.service postgresql.service

[Service]
User=www-data
ExecStart=/opt/ttrss/update_daemon2.php

[Install]
WantedBy=multi-user.target
EOF
systemctl enable ttrss.service
systemctl start ttrss.service

echo 'access http://192.168.55.101/ttrss/'
echo 'default user: admin  default password: password'
echo 'sample rss: http://serverarekore.blogspot.com/feeds/posts/default'
SHELL
end

○Tiny Tiny RSSの初期設定画面1


○Tiny Tiny RSSの初期設定画面2


○Tiny Tiny RSSの画面



○関連情報
・Tiny Tiny RSSに関する他の記事はこちらを参照してください。

0 件のコメント:

コメントを投稿