以下のVagrantfileを使用して、ResourceSpaceとMySQLをインストールした仮想マシン(CentOS7.4)を構築できます。
仮想マシン構築後、ブラウザからhttp://192.168.1.109/resourcespace/にアクセスして初期設定を行います。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-7.4"
config.vm.hostname = "co74resourcespace"
config.vm.provider :virtualbox do |vbox|
vbox.name = "co74resourcespace"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.109", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.109", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
localectl set-locale LANG=ja_JP.UTF-8
# mysqlのインストール
sudo yum -y remove mariadb-libs
yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
yum -y install yum-utils
#yum-config-manager --disable mysql57-community
#yum-config-manager --enable mysql56-community
yum -y install mysql mysql-devel mysql-server mysql-utilities
sudo systemctl enable mysqld.service
sudo systemctl start mysqld.service
# change password and create users and databases.
chkconfig mysqld on
service mysqld start
export MYSQL_ROOTPWD='Root123#'
export MYSQL_PWD=`cat /var/log/mysqld.log | awk '/temporary password/ {print $NF}'`
mysql -uroot --connect-expired-password -e "SET PASSWORD = PASSWORD('$MYSQL_ROOTPWD');"
export MYSQL_PWD=$MYSQL_ROOTPWD
export MYSQL_ROOTPWD='root'
mysql -uroot --connect-expired-password -e "UNINSTALL PLUGIN validate_password;"
mysql -uroot --connect-expired-password -e "SET PASSWORD = PASSWORD('$MYSQL_ROOTPWD'); FLUSH PRIVILEGES;"
mysql -uroot -proot -e "CREATE DATABASE resourcespace DEFAULT CHARACTER SET utf8;"
export MYSQL_PWD=$MYSQL_ROOTPWD
mysql -uroot -proot -e "CREATE USER resourcespace@localhost IDENTIFIED BY 'resourcespace';"
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON resourcespace.* TO 'resourcespace'@'localhost';"
mysql -uroot -proot -e "FLUSH PRIVILEGES;"
# install apache2
yum -y install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install --enablerepo=remi,remi-php71 httpd php php-devel php-mbstring php-mysqli php-gd php-xml php-zip php-json php-zip
yum -y install php-bcmath php-curl php-cli php-pear
# install dependencies
yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
yum -y localinstall https://forensics.cert.org/cert-forensics-tools-release-el7.rpm
yum -y install subversion antiword ffmpeg perl-Image-ExifTool ImageMagick xpdf
# install resourcespace
mkdir /opt/resourcespace
cd /opt/resourcespace
svn co http://svn.resourcespace.com/svn/rs/releases/8.2 .
mkdir filestore
chmod 777 filestore
chmod -R 777 include
ln -s /opt/resourcespace /var/www/html
service httpd restart
cat << EOF >> /etc/cron.daily/resourcespace
#!/bin/sh
wget -q -r http://localhost/pages/tools/cron_copy_hitcount.php
EOF
sed -i -e 's/memory_limit = 128M/memory_limit = 256M/' /etc/php.ini
sed -i -e 's/post_max_size = 8M/post_max_size = 128M/' /etc/php.ini
sed -i -e 's/upload_max_filesize = 2M/upload_max_filesize = 128M/' /etc/php.ini
service httpd restart
echo 'access http://192.168.1.109/resourcespace/'
echo 'user: resourcespace password:resourcespace db:resourcespace'
SHELL
end
〇ResourceSpaceの初期設定画面
〇ResourceSpaceの画面
0 件のコメント:
コメントを投稿