Skip to content

Commit c5580bf

Browse files
authored
smaller fixes (#69)
1 parent 746af46 commit c5580bf

File tree

5 files changed

+23
-14
lines changed

5 files changed

+23
-14
lines changed

apps/adminer.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ fi
5656

5757
cat << ADMINER_CREATE > "$ADMINER_CONF"
5858
server {
59-
listen 443 ssl http2;
60-
listen [::]:443 ssl http2;
59+
listen 444 ssl http2;
60+
listen [::]:444 ssl http2;
6161
6262
## Your website name goes here.
6363
# server_name example.com;
@@ -136,7 +136,7 @@ The script will exit."
136136
exit 1
137137
else
138138
msg_box "Adminer was sucessfully installed and can be reached here:
139-
http://$ADDRESS:81
139+
https://$ADDRESS:444
140140
You can download more plugins and get more information here:
141141
https://www.adminer.org
142142
Your MariaDB connection information can be found in $WPATH/wp-config.php

lets-encrypt/activate-tls.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ server {
143143
ssl_session_cache shared:SSL:50m;
144144
ssl_session_tickets off;
145145
# Diffie-Hellman parameter for DHE ciphersuites, recommended 4096 bits
146-
ssl_dhparam $DHPARAMS;
146+
ssl_dhparam $DHPARAMS_TLS;
147147
# intermediate configuration. tweak to your needs.
148148
ssl_protocols TLSv1.2 TLSv1.3;
149149
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
@@ -186,12 +186,12 @@ server {
186186
location ~* \.php$ {
187187
location ~ \wp-login.php$ {
188188
allow $GATEWAY/24;
189-
#allow $ADDRESS;
190-
#allow $WAN4IP;
189+
allow $ADDRESS;
190+
allow $WAN4IP;
191191
deny all;
192192
include fastcgi.conf;
193193
fastcgi_intercept_errors on;
194-
fastcgi_pass unix:/var/run/php/php7.2-fpm-wordpress.sock;
194+
fastcgi_pass unix:$PHP_FPM_SOCK;
195195
}
196196
fastcgi_split_path_info ^(.+\.php)(/.+)$;
197197
try_files \$uri =404;

static/change_db_pass.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ debug_mode
1616
# Change MARIADB Password
1717
if mysqladmin -u root password "$NEWMARIADBPASS" > /dev/null 2>&1
1818
then
19-
msg_box "Your new MARIADB root password is: $NEWMARIADBPASS
19+
msg_box "Your new MariaDB root password is: $NEWMARIADBPASS
2020
Please keep it somewhere safe.
2121
2222
To login to MariaDB,, simply type 'mysql -u root' from your CLI.

static/welcome.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<h6><a href="https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W7jILePiqQz3_Msw/wordpress-vm?currentPageId=W7jILePiqQz3_Ms7" target="_blank" rel="noopener">Login details</a></h6>
2525
<p><strong>Note:</strong> Webmin is installed when you run the setup script. To access Webmin externally you have to open port 10000 in your router.</p>
2626
<hr />
27-
<h3><a href=":81">Access Adminer</a></h3>
27+
<h3><a href=":444">Access Adminer</a></h3>
2828
<p><strong>Note:</strong> Please accept the warning in the browser if you connect via HTTPS.<br /><strong>Note:</strong> You have to remove the ending slash (/) for the port number to work.</p>
2929
<h6><a href="https://docs.hanssonit.se/s/W6fMouPiqQz3_Mog/virtual-machines-vm/d/W7jILePiqQz3_Msw/wordpress-vm?currentPageId=W7jILePiqQz3_Ms8" target="_blank" rel="noopener">Login details</a></h6>
3030
<p><strong>Note:</strong> Your external IP is set as approved, all other access is forbidden.</p>

wordpress-startup-script.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fi
9696
true
9797
SCRIPT_NAME="Wordpress startup script"
9898
# shellcheck source=lib.sh
99-
source /var/scripts/fetch_lib.sh
99+
source /var/scripts/fetch_lib.sh
100100

101101
# Check for errors + debug code and abort if something isn't right
102102
# 1 = ON
@@ -152,8 +152,7 @@ msg_box"This script will do the final setup for you
152152
- Create a new WP user
153153
- Upgrade the system
154154
- Activate TLS (Let's Encrypt)
155-
- Install Adminer
156-
- Change system timezone
155+
- Install different apps of your liking
157156
- Set new password to the Linux system (user: wordpress)
158157
159158
############### T&M Hansson IT AB - $(date +"%Y") ###############"
@@ -258,8 +257,14 @@ echo "WP PASS: $NEWWPADMINPASS"
258257

259258
# Change servername in Nginx
260259
server_name=$(echo "$FQDN" | cut -d "/" -f3)
261-
sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$HTTP_CONF"
262-
sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$TLS_CONF"
260+
if [ -f "$SITES_ENABLED"/"$HTTP_CONF" ]
261+
then
262+
sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$HTTP_CONF"
263+
fi
264+
if [ -f "$SITES_ENABLED"/"$TLS_CONF" ]
265+
then
266+
sed -i "s|# server_name .*|server_name $server_name;|g" "$SITES_ENABLED"/"$TLS_CONF"
267+
fi
263268
restart_webserver
264269

265270
# Show current administrators
@@ -344,6 +349,10 @@ LOGIN:
344349
Login to Wordpress in your browser:
345350
- IP: $ADDRESS
346351
- Hostname: $(hostname -f)
352+
353+
If you get access 'Forbidden' while accessing wp-login.php, please allow your IP in:
354+
$SITES_ENABLED/your_active.conf
355+
347356
### PLEASE HIT OK TO REBOOT ###"
348357

349358
# Reboot

0 commit comments

Comments
 (0)