Skip to content

Commit

Permalink
Don't set hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hansson authored Jul 4, 2017
1 parent 141a67d commit 6ecc68e
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions wordpress-startup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,6 @@ EOMSTART
any_key "Press any key to start the script..."
clear

# Set hostname and ServerName
echo "Setting hostname..."
FQN=$(host -TtA "$(hostname -s)"|grep "has address"|awk '{print $1}') ; \
if [[ "$FQN" == "" ]]
then
FQN=$(hostname -s)
echo "Current hostname is: $FQN.localdomain"
fi
sudo sh -c "echo 'ServerName $FQN' >> /etc/apache2/apache2.conf"
sudo hostnamectl set-hostname "$FQN"
service apache2 restart
cat << ETCHOSTS > "/etc/hosts"
127.0.1.1 "$FQN.localdomain" "$FQN"
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ETCHOSTS

# VPS?
if [[ "no" == $(ask_yes_or_no "Do you run this script on a *remote* VPS like DigitalOcean, HostGator or similar?") ]]
then
Expand Down

0 comments on commit 6ecc68e

Please sign in to comment.