Skip to content

Instantly share code, notes, and snippets.

@yegusa
Last active January 4, 2019 01:51
Show Gist options
  • Save yegusa/645ce453bbd7f7a2c1b733682000c6c1 to your computer and use it in GitHub Desktop.
Save yegusa/645ce453bbd7f7a2c1b733682000c6c1 to your computer and use it in GitHub Desktop.
Omeka Classic2.6.1をVirtualBox+vagrant+ubuntu16.04にインストールする方法 ref: https://qiita.com/yegusa/items/0a3b9d4a3723b0dd98f0
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
locale.name = “ja” # "" -> "ja"というように修正する
[databese]
host = "localhost" # XXXXXXX --> localhost
username = "omeka_user" # XXXXXXX --> omeka_user
password = "upw_omeka2018" # XXXXXXX --> upw_omeka2018
dbname = "omeka_db" # XXXXXXX --> omeka_db
prefix = "omeka_"
charset = "utf8"
;port = ""
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
$ mkdir vagrantwork
$ mkdir vagrantwork/vagrantwork20181227-2
$ cd vagrantwork/vagrantwork20181227-2
$ vagrant init bento/ubuntu-16.04
$ cat /etc/apache2/mods-available/rewrite.load
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
$sudo vi /etc/apache2/sites-enabled/000-default.conf
$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart
$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
service apache2 restart
$ sudo service apache2 restart
$ sudo ufw app list
Apache
Apache Full
Apache Secure
OpenSSH
$ sudo apt-get install mysql-server
After this operation, 162 MB of additional disk space will be used.
Do you want to continue? [Y/n]Y
New password for the MySQL "root" user: omeka2018
Repeat password for the MySQL "root" user: omeka2018
$ sudo mysql -u root -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'omeka2018';
mysql> FLUSH PRIVILEGES;
mysql> exit
$ mysql -u root -p
Enter password:omeka2018
mysql> exit
$ sudo mysql_secure_installation
Enter password for user root: omeka2018
Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: N
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : N (rootパスワードを変えたいなら Y)
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? (Press y|Y for Yes, any other key for No) : y
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? (Press y|Y for Yes, any other key for No) :y
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? (Press y|Y for Yes, any other key for No) :y
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :y
$ vi Vagrantfile
$ sudo apt-get -y install php php-gd php-mbstring php-common php-mysql php-imagick php-xml libapache2-mod-php php-curl php-tidy php-zip
$ sudo vi /etc/apache2/mods-enabled/dir.conf
$ sudo service apache2 restart
$ sudo service apache2 restart
$ sudo service apache2 status
$ sudo vi /var/www/html/info.php
$ sudo rm /var/www/html/info.php
$ sudo rm /var/www/html/info.php
$ sudo apt-get -y install imagemagick
$ mysql -u root -p
Enter password: omeka2018 (rootのパスワード)
mysql> CREATE DATABASE omeka_db CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'omeka_user'@'localhost' IDENTIFIED BY 'upw_omeka2018';
GRANT ALL PRIVILEGES ON omeka_db.* TO 'omeka_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
mysql> CREATE DATABASE omeka_db CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'omeka_user'@'localhost' IDENTIFIED BY ‘upwomeka2018';
'> GRANT ALL PRIVILEGES ON omeka_db.* TO 'omeka_user'@'localhost';
'> FLUSH PRIVILEGES;
'> EXIT;
'>
'>
$ mysql -u root -p
Enter password: omeka2018 (rootのパスワード)
mysql> CREATE DATABASE omeka_db CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'omeka_user'@'localhost' IDENTIFIED BY 'upw_omeka2018';
GRANT ALL PRIVILEGES ON omeka_db.* TO 'omeka_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
$ vagrant up
mysql> CREATE DATABASE omeka_db CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'omeka_user'@'localhost' IDENTIFIED BY ‘upwomeka2018';
'> GRANT ALL PRIVILEGES ON omeka_db.* TO 'omeka_user'@'localhost';
'> FLUSH PRIVILEGES;
'> EXIT;
'>
'>
$ sudo apt-get install wget
$ sudo apt-get install zip unzip
$ wget https://github.com/omeka/Omeka/releases/download/v2.6.1/omeka-2.6.1.zip
$ unzip omeka-2.6.1.zip
$ cd /var/www/html/
$ cd /var/www/html/
$ sudo mv index.html ~/index.html.org
$ sudo mv ~/omeka-2.6.1/* /var/www/html
$ sudo mv ~/omeka-2.6.1/.htaccess /var/www/html
$ sudo chown -R www-data:www-data * ./
$ sudo service apache2 restart
$sudo vi ./db.ini
$ vagrant up
$ vagrant ssh
$sudo vi ./db.ini
$ echo grub-pc hold | sudo dpkg --set-selections
$ vagrant ssh
$ echo grub-pc hold | sudo dpkg --set-selections
sudo apt-get -y update
sudo apt-get -y upgrade
$ sudo apt-get -y update
$ sudo apt-get -y install apache2
$ sudo apt-get -y update
$ sudo apt-get -y upgrade
$ sudo apt-get -y update
$ sudo apt-get -y install apache2
$ sudo apt-get install apache2-doc
<?php
phpinfo();
?>
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 80, host: 8084
# a)↑の冒頭の#を消す、適宜host: の値を修正ここでは8080から8084 に
config.vm.network "forwarded_port", guest: 22, host: 2224
# b)↑を追加
  #3メモリの設定(メモリを倍にする(2048MBに))
config.vm.provider "virtualbox" do |vb| # c) これの冒頭の#を消す
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = "2048" # d) 冒頭の # を消し, 1024 を2048に変える
end # e) これの冒頭の#を消す
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment