45 lines
2.0 KiB

# Wordpress install script
# Written by Joshua Mudge
# Ad Mejorem Dei Glorium
curl -s "https://gitlab.daplie.com/sysadmin/daplie-snippets/raw/master/dss/setup.sh" | bash
dss --user $USER init
#sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo apt-get install nginx unzip php7.0-fpm php-xml php-xmlrpc software-properties-common php7.0-mysql mysql-server zip php-gd -y
wget https://wordpress.org/latest.zip
sudo mkdir /var/www/wordpress
unzip latest.zip
sudo mv wordpress/* /var/www/website/
sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y python-certbot-nginx certbot
# user input required
echo "run: sudo certbot --authenticator webroot --installer nginx after configuring default_server and root directory"
#echo "run: sudo certbot certonly --webroot --webroot-path=/var/www/wordpress -d www.youdomain.com -d yourdomain.com"
echo "Update Nginx configuration in /etc/nginx/sites-enabled/ with using example configuration."
# For uploading: add this to Nginx config (/etc/nginx/nginx.conf) under the http section: client_max_body_size 100m;
# For permalinks, add: try_files $uri $uri/ /index.php?$args; in place of the other try_files in configuration.
# Change Table prefix if multiple sites.
# For uploading: sudo chown -R www-data:www-data /var/www/dir
#mysql -u root mysql -p CREATE DATABASE ideside; CREATE USER 'ideuser'@'localhost' IDENTIFIED BY 'yourpassword'; GRANT ALL PRIVILEGES ON ideside.* TO 'ideuser'@'localhost'; FLUSH PRIVILEGES;
# mysql -u root mysql -p
#CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'newpassword';
#GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';
# Create root crontab: 0 5 20 * * sudo letsencrypt renew --force-renew && sudo service nginx restart