Compare commits
No commits in common. "master" and "Release_V1.0" have entirely different histories.
master
...
Release_V1
@ -3,7 +3,7 @@ FROM ubuntu:20.04
|
|||||||
# install necessary packages
|
# install necessary packages
|
||||||
RUN \
|
RUN \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
DEBIAN_FRONTEND="noninteractive" apt-get install apache2 php libapache2-mod-php php-mysql php-xdebug imagemagick libimage-exiftool-perl -y
|
DEBIAN_FRONTEND="noninteractive" apt-get install apache2 php libapache2-mod-php php-mysql php-xdebug imagemagick -y
|
||||||
# rm -rf /var/lib/apt/lists/*
|
# rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# define volumes
|
# define volumes
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
_ServerName_
|
# The ServerName directive sets the request scheme, hostname and port that
|
||||||
|
# the server uses to identify itself. This is used when creating
|
||||||
|
# redirection URLs. In the context of virtual hosts, the ServerName
|
||||||
|
# specifies what hostname must appear in the request's Host: header to
|
||||||
|
# match this virtual host. For the default virtual host (this file) this
|
||||||
|
# value is not decisive as it is used as a last resort host regardless.
|
||||||
|
# However, you must set it for any further virtual host explicitly.
|
||||||
|
ServerName
|
||||||
|
|
||||||
ServerAdmin webmaster@localhost
|
ServerAdmin webmaster@localhost
|
||||||
DocumentRoot /var/www/html
|
DocumentRoot /var/www/html
|
||||||
|
@ -7,24 +7,19 @@ $dbconn = mysqli_connect(SQL_IP, SQL_USER, SQL_PASS);
|
|||||||
|
|
||||||
if (PHW_DB_GRANTED) {
|
if (PHW_DB_GRANTED) {
|
||||||
$create_database_query = 'CREATE DATABASE IF NOT EXISTS ' . SQL_DB . ';';
|
$create_database_query = 'CREATE DATABASE IF NOT EXISTS ' . SQL_DB . ';';
|
||||||
if (mysqli_query($dbconn, $create_database_query)) {
|
$use_database_query = 'USE ' . SQL_DB . ';';
|
||||||
|
if (mysqli_query($dbconn, $create_database_query) && mysqli_query($dbconn, $use_database_query)) {
|
||||||
echo "Adatbázis létrehozva." . PHP_EOL;
|
echo "Adatbázis létrehozva." . PHP_EOL;
|
||||||
} else {
|
} else {
|
||||||
echo "Hiba az adatbázis létrehozása során: " . mysqli_error($dbconn) . PHP_EOL;
|
echo "Hiba az adatbázis létrehozása során: " . mysqli_error($dbconn) . PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// az adatbázis kiválasztása
|
|
||||||
$use_database_query = 'USE ' . SQL_DB . ';';
|
|
||||||
mysqli_query($dbconn, $use_database_query);
|
|
||||||
|
|
||||||
|
|
||||||
$create_tables_queries = "
|
$create_tables_queries = "
|
||||||
/*DROP TABLE IF EXISTS `publish_table`;/**/
|
/*DROP TABLE IF EXISTS `publish_table`;/**/
|
||||||
CREATE TABLE IF NOT EXISTS `publish_table` (
|
CREATE TABLE IF NOT EXISTS `publish_table` (
|
||||||
`No` int NOT NULL AUTO_INCREMENT,
|
`No` int NOT NULL AUTO_INCREMENT,
|
||||||
`Author` varchar(45) NOT NULL,
|
`Author` varchar(45) NOT NULL,
|
||||||
`AuthorGroup` varchar(45) NOT NULL,
|
|
||||||
`Title` varchar(45) NOT NULL,
|
`Title` varchar(45) NOT NULL,
|
||||||
`Description` text,
|
`Description` text,
|
||||||
`Image_FileName` varchar(45) NOT NULL,
|
`Image_FileName` varchar(45) NOT NULL,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# generate revisor's password hash
|
# generate revisor's password hash
|
||||||
PHW_REVIS_PWD_HASH=$(php -r "echo password_hash('${PHW_REVIS_PWD}', PASSWORD_DEFAULT);")
|
PHW_REVIS_PWD_HASH=$(php -r "echo password_hash("${PHW_REVIS_PWD}", PASSWORD_DEFAULT);")
|
||||||
|
|
||||||
# generate globals.php from environment variables
|
# generate globals.php from environment variables
|
||||||
cd /var/www/html
|
cd /var/www/html
|
||||||
@ -20,10 +20,10 @@ chown -R www-data:www-data ARTWORKS
|
|||||||
cat /database_init.php | php -d display_errors=on -d error_reporting=-1
|
cat /database_init.php | php -d display_errors=on -d error_reporting=-1
|
||||||
|
|
||||||
# substitute server name
|
# substitute server name
|
||||||
sed -i "s|_ServerName_|ServerName ${PHW_SERVER_NAME}|g" /etc/apache2/sites-available/000-default.conf
|
sed -i "s|ServerName|ServerName ${PHW_SERVER_NAME}|g" /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
# remove index.html
|
# remove index.html
|
||||||
rm -f /var/www/html/index.html
|
rm /var/www/html/index.html
|
||||||
|
|
||||||
# start webserver
|
# start webserver
|
||||||
/usr/sbin/apache2ctl -D FOREGROUND
|
/usr/sbin/apache2ctl -D FOREGROUND
|
||||||
|
2
wwwdata
2
wwwdata
@ -1 +1 @@
|
|||||||
Subproject commit af9ee79751ec619f27e67cab7f919997e60a00f5
|
Subproject commit 5a46f394f01bd29f6ed93b057b78ad41ded8e21c
|
Loading…
x
Reference in New Issue
Block a user