Commit e0cff7b4 authored by w4t's avatar w4t

wtserver 0.14

parent f72831fd
......@@ -7,7 +7,7 @@ OS_default_PHP_back() {
InstallPhp55() {
### Install PHP 5.5.38
### https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 5.5.38 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 5.5.38 and Modules... "
apt_install build-essential libxml2-dev libxslt1-dev
apt_install libfcgi-dev libfcgi0ldbl libjpeg9-dbg libxml2-dev
......@@ -83,7 +83,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp56() {
### Install PHP 5.6.40
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 5.6.40 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 5.6.40 and Modules... "
apt_install php5.6 php5.6-cli php5.6-cgi php5.6-fpm php5.6-gd php5.6-mysql php5.6-imap php5.6-curl php5.6-intl php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-zip php5.6-mbstring php5.6-soap php5.6-opcache php5.6-common php5.6-json php5.6-readline php5.6-xml
#libicu65
......@@ -96,7 +96,7 @@ InstallPhp70() {
### Install PHP 7.0.33
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 7.0.33 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 7.0.33 and Modules... "
apt_install bphp7.0 php7.0-cli php7.0-cgi php7.0-fpm php7.0-gd php7.0-mysql php7.0-imap php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-zip php7.0-mbstring php7.0-soap php7.0-opcache php7.0-common php7.0-json php7.0-readline php7.0-xml
......@@ -117,7 +117,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp71() {
### Install PHP 7.1.33
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 7.1.33 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 7.1.33 and Modules... "
apt_install php7.1 php7.1-cli php7.1-cgi php7.1-fpm php7.1-gd php7.1-mysql php7.1-imap php7.1-curl php7.1-intl php7.1-pspell php7.1-recode php7.1-sqlite3 php7.1-tidy php7.1-xmlrpc php7.1-xsl php7.1-zip php7.1-mbstring php7.1-soap php7.1-opcache php7.1-common php7.1-json php7.1-readline php7.1-xml
......@@ -128,7 +128,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp72() {
### Install PHP 7.2.34
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 7.2.34 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 7.2.34 and Modules... "
apt_install php7.2 php7.2-cli php7.2-cgi php7.2-fpm php7.2-gd php7.2-mysql php7.2-imap php7.2-curl php7.2-intl php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-zip php7.2-mbstring php7.2-soap php7.2-opcache php7.2-common php7.2-json php7.2-readline php7.2-xml
......@@ -139,7 +139,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp73() {
### Install PHP 7.3.33
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 7.3.33 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 7.3.33 and Modules... "
apt_install php7.3 php7.3-cli php7.3-cgi php7.3-fpm php7.3-gd php7.3-mysql php7.3-imap php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl php7.3-zip php7.3-mbstring php7.3-soap php7.3-opcache php7.3-common php7.3-json php7.3-readline php7.3-xml
......@@ -150,7 +150,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp74() {
### Install PHP 7.4.33
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 7.4.33 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 7.4.33 and Modules... "
apt_install php7.4 php7.4-cli php7.4-cgi php7.4-fpm php7.4-gd php7.4-mysql php7.4-imap php7.4-curl php7.4-intl php7.4-pspell php7.4-sqlite3 php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-zip php7.4-mbstring php7.4-soap php7.4-opcache libonig5 php7.4-common php7.4-json php7.4-readline php7.4-xml
......@@ -161,7 +161,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp80() {
### Install PHP 8.0.30
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 8.0.30 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 8.0.30 and Modules... "
apt_install php8.0 php8.0-cli php8.0-cgi php8.0-fpm php8.0-gd php8.0-mysql php8.0-imap php8.0-curl php8.0-intl php8.0-pspell php8.0-sqlite3 php8.0-tidy php8.0-xsl php8.0-zip php8.0-mbstring php8.0-soap php8.0-opcache libonig5 php8.0-common php8.0-readline php8.0-xml
......@@ -172,9 +172,9 @@ echo -e "[${green}DONE${NC}]"
InstallPhp81() {
### Install PHP 8.1.31
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 8.1.31 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 8.1.31 and Modules... "
apt_install install php8.1 php8.1-cli php8.1-cgi php8.1-fpm php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml
apt_install php8.1 php8.1-cli php8.1-cgi php8.1-fpm php8.1-gd php8.1-mysql php8.1-imap php8.1-curl php8.1-intl php8.1-pspell php8.1-sqlite3 php8.1-tidy php8.1-xsl php8.1-zip php8.1-mbstring php8.1-soap php8.1-opcache libonig5 php8.1-common php8.1-readline php8.1-xml
OS_default_PHP_back
echo -e "[${green}DONE${NC}]"
......@@ -183,7 +183,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp82() {
### Install PHP 8.2.31
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 8.2.27 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 8.2.27 and Modules... "
apt_install php8.2 php8.2-cli php8.2-cgi php8.2-fpm php8.2-gd php8.2-mysql php8.2-imap php8.2-curl php8.2-intl php8.2-pspell php8.2-sqlite3 php8.2-tidy php8.2-xsl php8.2-zip php8.2-mbstring php8.2-soap php8.2-opcache libonig5 php8.2-common php8.2-readline php8.2-xml
......@@ -194,7 +194,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp83() {
### Install PHP 8.3.17
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 8.3.17 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 8.3.17 and Modules... "
apt_install php8.3 php8.3-cli php8.3-cgi php8.3-fpm php8.3-gd php8.3-mysql php8.3-imap php8.3-curl php8.3-intl php8.3-pspell php8.3-sqlite3 php8.3-tidy php8.3-xsl php8.3-zip php8.3-mbstring php8.3-soap php8.3-opcache libonig5 php8.3-common php8.3-readline php8.3-xml
......@@ -205,7 +205,7 @@ echo -e "[${green}DONE${NC}]"
InstallPhp84() {
### Install PHP 8.4.4
### https://www.howtoforge.com/ispconfig-php-debian/
echo -n -e "$IDENTATION_LVL_1 Installing PHP 8.4.4 and Modules... "
echo -n -e "$IDENTATION_LVL_2 Installing PHP 8.4.4 and Modules... "
apt_install php8.4 php8.4-cli php8.4-cgi php8.4-fpm php8.4-gd php8.4-mysql php8.4-imap php8.4-curl php8.4-intl php8.4-pspell php8.4-sqlite3 php8.4-tidy php8.4-xsl php8.4-zip php8.4-mbstring php8.4-soap php8.4-opcache libonig5 php8.4-common php8.4-readline php8.4-xmlbuild-essential libxml2-dev libxslt1-dev
......
......@@ -8,8 +8,7 @@ InstallMTA() {
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing MTA${NC}\n"
case $CFG_MTA in
"courier")
echo -n -e "$IDENTATION_LVL_1 Installing ${red}Courier ${NC}..."
echo -n -e "$IDENTATION_LVL_1 Installing ${red}Courier${NC}...\n"
echo -n -e "$IDENTATION_LVL_2 Preconfigure... "
echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections
echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections
......@@ -45,7 +44,7 @@ InstallMTA() {
echo -e "[${green}DONE${NC}]"
;;
"dovecot")
echo -n -e "$IDENTATION_LVL_1 Installing POP3/IMAP Mail server ${red}Dovecot ${NC} and Mail signing (OpenDKIM)..."
echo -n -e "$IDENTATION_LVL_1 Installing POP3/IMAP Mail server ${red}Dovecot${NC} and Mail signing (OpenDKIM)...\n"
echo -n -e "$IDENTATION_LVL_2 Installing Dovecot and dependecies... "
apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd dovecot-managesieved dovecot-antispam opendkim opendkim-tools
......
......@@ -88,60 +88,79 @@ EOF
elif [ "$CFG_WEBSERVER" == "nginx" ]; then
echo -n -e "$IDENTATION_LVL_2 Configuring Nginx for phpMyAdmin...\n"
# Nginx configuration for phpMyAdmin
cat > /etc/nginx/conf.d/phpmyadmin.conf <<EOF
cat > /etc/nginx/conf.d/phpmyadmin.conf <<'EOF'
## phpMyAdmin default nginx configuration
server {
listen 80;
server_name "";
root /usr/share/phpmyadmin;
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param HTTPS $https;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
## Images and static content is treated different
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
listen 80;
server_name _;
root /usr/share/phpmyadmin;
index index.php index.html index.htm;
# phpMyAdmin main path
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
# Manage PHP files in phpMyAdmin
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
# Manage static content in phpMyAdmin
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
location / {
index index.php;
}
## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
}
location ~ /\.ht {
deny all;
}
location ~ /(libraries|setup/frames|setup/libs) {
deny all;
return 404;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
# Upper and lower case redirection
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
# Root path management
location / {
try_files $uri $uri/ /index.php?$args;
index index.php;
}
# Static content management
location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
}
# Protect hidden files
location ~ /\.ht {
deny all;
}
# Secure libraries
location ~ /(libraries|setup/frames|setup/libs) {
deny all;
return 404;
}
# Manage PHP files in the main directory
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
EOF
......@@ -175,12 +194,18 @@ EOF
fi
echo -n -e "$IDENTATION_LVL_2 Configuring phpMyAdmin database... "
if [ "$CFG_SQLSERVER" == "MariaDB" ]; then
SQL_COMMAND="mariadb"
else
SQL_COMMAND="mysql"
fi
# Configure phpMyAdmin database
mariadb -u root -p"$CFG_MYSQL_ROOT_PWD" -e"CREATE DATABASE phpmyadmin;"
mariadb -u root -p"$CFG_MYSQL_ROOT_PWD" -e"CREATE USER 'pma'@'localhost' IDENTIFIED BY '$CFG_MYSQL_ROOT_PWD';"
mariadb -u root -p"$CFG_MYSQL_ROOT_PWD" -e"GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY '$CFG_MYSQL_ROOT_PWD' WITH GRANT OPTION;"
mariadb -u root -p"$CFG_MYSQL_ROOT_PWD" -e"FLUSH PRIVILEGES;"
mariadb -u root -p"$CFG_MYSQL_ROOT_PWD" phpmyadmin < /usr/share/phpmyadmin/sql/create_tables.sql
$SQL_COMMAND -u root -p"$CFG_MYSQL_ROOT_PWD" -e "CREATE DATABASE phpmyadmin;"
$SQL_COMMAND -u root -p"$CFG_MYSQL_ROOT_PWD" -e "CREATE USER 'pma'@'localhost' IDENTIFIED BY '$CFG_MYSQL_ROOT_PWD';"
$SQL_COMMAND -u root -p"$CFG_MYSQL_ROOT_PWD" -e "GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY '$CFG_MYSQL_ROOT_PWD' WITH GRANT OPTION;"
$SQL_COMMAND -u root -p"$CFG_MYSQL_ROOT_PWD" -e "FLUSH PRIVILEGES;"
$SQL_COMMAND -u root -p"$CFG_MYSQL_ROOT_PWD" phpmyadmin < /usr/share/phpmyadmin/sql/create_tables.sql
echo -e "[${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_2 Updating phpMyAdmin storage configuration... "
......
......@@ -296,7 +296,7 @@ EOF
InstallphpMyAdmin
fi
echo -n -e "$IDENTATION_LVL_0 ${BWhite}Installing extra PHP and Modules...${NC}\n"
echo -n -e "$IDENTATION_LVL_1 ${BWhite}Installing extra PHP and Modules...${NC}\n"
if [[ "$CFG_PHP_VERSION" == *"none"* ]]; then
echo -e "No PHP version selected for installation."
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment