This commit is contained in:
Jarosław Karcewicz 2022-05-11 18:03:58 +02:00
parent 828fa6940d
commit f8616e4121
2 changed files with 5 additions and 6 deletions

8
multivm/Vagrantfile vendored
View File

@ -11,7 +11,7 @@ Vagrant.configure("2") do |config|
config.vm.box_check_update = false
config.vm.provision "shell",
path: "standard.sh"
path: "https://gitea.adminakademia.pl/adminakademia/lpic-305-306/raw/branch/master/multivm/standard.sh"
config.vm.define "web" do |web|
@ -19,16 +19,16 @@ Vagrant.configure("2") do |config|
web.vm.network "forwarded_port", guest: 80, host: 8080
web.vm.network "private_network", ip: "10.10.0.2"
web.vm.provision "shell",
path: "apachephp.sh"
path: "https://gitea.adminakademia.pl/adminakademia/lpic-305-306/raw/branch/master/multivm/apachephp.sh"
end
config.vm.define "db" do |db|
db.vm.hostname = "websrv"
db.vm.hostname = "dbsrv"
db.vm.network "private_network", ip: "10.10.0.3"
db.vm.provision "shell",
path: "mariadb.sh"
path: "https://gitea.adminakademia.pl/adminakademia/lpic-305-306/raw/branch/master/multivm/mariadb.sh"
end

View File

@ -7,12 +7,11 @@ sudo apt -y install mariadb-server mariadb-client
sudo mysql -e "UPDATE mysql.user SET Password = PASSWORD('Zaq12wsx') WHERE User = 'root'"
sudo mysql -e "DELETE FROM mysql.user WHERE User='';"
sudo mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
sudo mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1', '10.10.0.2');"
sudo mysql -e "DROP DATABASE IF EXISTS test;"
sudo mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';"
sudo mysql -e "use mysql; update user set plugin='' where User='root';"
sudo mysql -u root -e "CREATE DATABASE IF NOT EXISTS baza_test;"
sudo mysql -u root -e "SHOW DATABASES;"
sudo mysql -e "flush privileges;"