2025-01-14 18:32:33 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-01-06 13:28:12 +01:00
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
2025-01-14 18:32:33 +01:00
|
|
|
# Author: MickLesk (Canbiz)
|
|
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://wordpress.org/
|
|
|
|
|
|
2025-03-24 14:20:56 +01:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2025-01-14 18:32:33 +01:00
|
|
|
color
|
|
|
|
|
verb_ip6
|
|
|
|
|
catch_errors
|
|
|
|
|
setting_up_container
|
|
|
|
|
network_check
|
|
|
|
|
update_os
|
|
|
|
|
|
2025-08-14 22:51:44 +02:00
|
|
|
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="common,snmp,imap,mysql" PHP_APACHE="YES" setup_php
|
2025-06-18 12:03:00 +02:00
|
|
|
setup_mariadb
|
2025-12-09 16:03:13 +01:00
|
|
|
MARIADB_DB_NAME="wordpress_db" MARIADB_DB_USER="wordpress" setup_mariadb_db
|
2025-01-14 18:32:33 +01:00
|
|
|
|
|
|
|
|
msg_info "Installing Wordpress (Patience)"
|
2025-12-09 16:03:13 +01:00
|
|
|
cd /var/www/html
|
2025-05-28 14:45:53 +02:00
|
|
|
curl -fsSL "https://wordpress.org/latest.zip" -o "latest.zip"
|
2025-05-28 11:25:13 +02:00
|
|
|
$STD unzip latest.zip
|
2025-01-14 18:32:33 +01:00
|
|
|
chown -R www-data:www-data wordpress/
|
2025-12-09 16:03:13 +01:00
|
|
|
cd /var/www/html/wordpress
|
2025-01-14 18:32:33 +01:00
|
|
|
find . -type d -exec chmod 755 {} \;
|
|
|
|
|
find . -type f -exec chmod 644 {} \;
|
|
|
|
|
mv wp-config-sample.php wp-config.php
|
2025-12-09 16:03:13 +01:00
|
|
|
sed -i -e "s|^define( 'DB_NAME', '.*' );|define( 'DB_NAME', '$MARIADB_DB_NAME' );|" \
|
|
|
|
|
-e "s|^define( 'DB_USER', '.*' );|define( 'DB_USER', '$MARIADB_DB_USER' );|" \
|
|
|
|
|
-e "s|^define( 'DB_PASSWORD', '.*' );|define( 'DB_PASSWORD', '$MARIADB_DB_PASS' );|" \
|
2025-05-27 15:32:22 +02:00
|
|
|
/var/www/html/wordpress/wp-config.php
|
2025-11-22 17:27:13 +01:00
|
|
|
rm -rf /var/www/html/latest.zip
|
2025-01-14 18:32:33 +01:00
|
|
|
msg_ok "Installed Wordpress"
|
|
|
|
|
|
|
|
|
|
msg_info "Setup Services"
|
2025-03-24 14:20:56 +01:00
|
|
|
cat <<EOF >/etc/apache2/sites-available/wordpress.conf
|
2025-01-14 18:32:33 +01:00
|
|
|
<VirtualHost *:80>
|
|
|
|
|
ServerName yourdomain.com
|
|
|
|
|
DocumentRoot /var/www/html/wordpress
|
|
|
|
|
|
|
|
|
|
<Directory /var/www/html/wordpress>
|
|
|
|
|
AllowOverride All
|
|
|
|
|
</Directory>
|
|
|
|
|
|
|
|
|
|
ErrorLog \${APACHE_LOG_DIR}/error.log
|
|
|
|
|
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
|
|
|
|
|
|
|
|
|
</VirtualHost>
|
|
|
|
|
EOF
|
|
|
|
|
$STD a2ensite wordpress.conf
|
|
|
|
|
$STD a2dissite 000-default.conf
|
|
|
|
|
systemctl reload apache2
|
|
|
|
|
msg_ok "Created Services"
|
|
|
|
|
|
|
|
|
|
motd_ssh
|
|
|
|
|
customize
|
2025-11-22 17:27:13 +01:00
|
|
|
cleanup_lxc
|