Changing Your Server Hostname: Difference between revisions

From Sympl Wiki
Jump to navigation Jump to search
(Created page with "A number of functions in Sympl use the servers hostname to determine it's defaults, such as emails sent to unix users, the default fallback site for any unmatched sites, a...")
Tag: visualeditor
 
No edit summary
Tag: visualeditor
Line 1: Line 1:
A number of functions in Sympl use the servers [[hostname]] to determine it's defaults, such as emails sent to unix users, the default fallback site for any unmatched sites, and the default SSL certificates used for things like Email and FTP connections.
A number of functions in Sympl use the servers [[hostname]] to determine it's defaults, such as emails sent to unix users, the default fallback site for any unmatched sites, and the default SSL certificates used for things like Email and FTP connections.


<br />
This means that properly changing the server hostname can be tricky, and missing one or more elements can cause odd problems later on.
new_hostname=replace.this.with-your-new.hostname
 
Functionality for properly changing the hostname will be included in Sympl at a future date, however the following will need to be updated:
 
* System hostname
* <code>/etc/hosts</code>
* <code>/etc/ssl/ssl.*</code>
* <code>/etc/hostname</code>
* <code>/etc/mailname</code>


new_short_hostname=$( echo $new_hostname | cut -d . -f 1 )
old_hostname=$( hostname )
old_short_hostname=$( hostname -s )
sudo hostname $new_hostname
if [ ! -d /srv/$new_hostname/ ]; then mv /srv/$old_hostname/ /srv/$new_hostname/; fi
sudo sympl-ssl --verbose --force $new_hostname
sudo rm /etc/ssl/ssl.combined /etc/ssl/ssl.crt /etc/ssl/ssl.key
sudo ln -s /srv/$new_hostname/config/ssl/current/ssl.combined /etc/ssl/ssl.combined
sudo ln -s /srv/$new_hostname/config/ssl/current/ssl.crt /etc/ssl/ssl.crt
sudo ln -s /srv/$new_hostname/config/ssl/current/ssl.key /etc/ssl/ssl.key
sudo sympl-web-configure
sudo service apache2 reload
echo $new_hostname | sudo tee /etc/hostname | sudo tee /etc/mailname
[[Category:How To]]
[[Category:How To]]

Revision as of 11:59, 20 August 2019

A number of functions in Sympl use the servers hostname to determine it's defaults, such as emails sent to unix users, the default fallback site for any unmatched sites, and the default SSL certificates used for things like Email and FTP connections.

This means that properly changing the server hostname can be tricky, and missing one or more elements can cause odd problems later on.

Functionality for properly changing the hostname will be included in Sympl at a future date, however the following will need to be updated:

  • System hostname
  • /etc/hosts
  • /etc/ssl/ssl.*
  • /etc/hostname
  • /etc/mailname