Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F1669763
Rosario Docker PHP GIMP Italia provision
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
valerio.bozzolan
Nov 30 2022, 22:47
2022-11-30 22:47:59 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Rosario Docker PHP GIMP Italia provision
View Options
#!/bin/sh
# die in case of any error
set
-e
# CONFIG: original zip file
ZIPFILE_BEFORE
=
"DUMP GIMPITALIA 2.zip"
# CONFIG: what we find after extraction
CONTENT_ARCHIVE_DIR
=
"DUMP GIMPITALIA"
CONTENT_ARCHIVE
=
"gimpitalia.it.tar.bz2"
CONTENT_DUMPONE
=
"lazzameb_gimpitalia.sql"
MARIADB_USER
=
'lazzameb_gimpitalia'
MARIADB_DBNM
=
'lazzameb_gimpitalia'
MARIADB_PSWD
=
'<REDACTED>'
# CONFIG: webserver base document root
WEB_DOCUMENT_ROOT
=
"/var/www/html"
# MUST to run apt install
#sudo apt-get update
# SHOULD: install security patches
export
DEBIAN_FRONTEND
=
noninteractive
sudo
apt-get
upgrade
--yes
# MUST
sudo
apt-get
install
--yes
apache2
libapache2-mod-php
php-mysql
php-xml
mariadb-server
unzip
# MUST remove shit
sudo
rm
--force
/var/www/html/index.html
# MUST allow write on some directories
sudo
chown
--recursive
www-data:
/var/www/html/cache/
# MUST extract shit
unzip
"
$ZIPFILE_BEFORE
"
# MUST enter in the unzipped directory
cd
"
$CONTENT_ARCHIVE_DIR
"
# MUST: extract shit in the unzipped directory
tar
-xf
"
$CONTENT_ARCHIVE
"
# MUST: move shit to the web document root
sudo
mv
gimpitalia.it/forum/*
/var/www/html
# MUST create database and a dedicated user
sudo
mysql
--execute
=
"CREATE USER \`
$MARIADB_USER
\`@localhost IDENTIFIED BY '
$MARIADB_PSWD
'"
sudo
mysql
--execute
=
"CREATE DATABASE \`
$MARIADB_DBNM
\`"
sudo
mysql
--execute
=
"GRANT ALL PRIVILEGES ON \`
$MARIADB_DBNM
\`.* TO \`
$MARIADB_USER
\`@localhost"
# MUST import database
sudo
mysql
"
$MARIADB_DBNM
"
<
"
$CONTENT_DUMPONE
"
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
176460
Default Alt Text
Rosario Docker PHP GIMP Italia provision (1 KB)
Attached To
Mode
P21 Rosario Docker PHP GIMP Italia provision
Attached
Detach File
Event Timeline
Log In to Comment