sh 默认的DigitalOcean WordPress设置脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 默认的DigitalOcean WordPress设置脚本相关的知识,希望对你有一定的参考价值。

#!/bin/bash
#
# WordPress activation script
#
# This script will configure Apache with the domain
# provided by the user and offer the option to set up
# LetsEncrypt as well.

# Enable WordPress on firstlogin
mv /var/www/html /var/www/html.old
mv /var/www/wordpress /var/www/html
chown -Rf www-data:www-data /var/www/html
echo "This script will copy the WordPress instalation into"
echo "Your web root and move the existing one to /var/www/html.old"
echo "--------------------------------------------------"
echo "This setup requires a domain name.  If you do not have one yet, you may"
echo "cancel this setup, press Ctrl+C.  This script will run again on your next login"
echo "--------------------------------------------------"
echo "Enter the domain name for your new WordPress site."
echo "(ex. example.org or test.example.org) do not include www or http/s"
echo "--------------------------------------------------"
a=0
while [ $a -eq 0 ]
do
 read -p "Domain/Subdomain name: " dom
 if [ -z "$dom" ]
 then
  a=0
  echo "Please provide a valid domain or subdomain name to continue to press Ctrl+C to cancel"
 else
  a=1
fi
done
sed -i "s/\$domain/$dom/g"  /etc/apache2/sites-enabled/000-default.conf
a2enconf block-xmlrpc

service apache2 restart
cp /etc/skel/.bashrc /root
echo -en "\n\n\n"
echo "Next, you have the option of configuring LetsEncrypt to secure your new site.  Before doing this, be sure that you have pointed your domain or subdomain to this server's IP address.  You can also run LetsEncrypt certbot later with the command 'certbot --apache'"
echo -en "\n\n\n"
 read -p "Would you like to use LetsEncrypt (certbot) to configure SSL(https) for your new site? (y/n): " yn
    case $yn in
        [Yy]* ) certbot --apache; echo "WordPress has been enabled at https://$dom  Please open this URL in a browser to complete the setup of your site.";break;;
        [Nn]* ) echo "WordPress has been enabled at http://$dom  Please open this URL in a browser to complete the setup of your site.";exit;;
        * ) echo "Please answer y or n.";;
    esac

以上是关于sh 默认的DigitalOcean WordPress设置脚本的主要内容,如果未能解决你的问题,请参考以下文章

sh 简单的DigitalOcean域设置脚本

sh laravel-digitalocean.bash

sh DigitalOcean片段

sh 在DigitalOcean上设置Docker Swarm多主机群集

sh 在DigitalOcean上设置Docker Swarm多主机群集

sh Flynn安装:单节点(适用于Ubuntu 14.04 x64 @ DigitalOcean droplet)