Linux tips and tricks

Home » Linux tips and tricks

How do I change the hostname of my RPi?

You need to do 3 things:

  1. sudo nano vi /etc/hostname. You’ll find the existing hostname in this file. Update the hostname as desitred, then save and exit.
  2. sudo nano /etc/hosts. Look for any occurrence of the old hostname in here. Update them, then save and exit.
  3. sudo reboot

This technique is derived from the website of Simon the Pi Man.


Changing the root of WordPress website

When I first installed WordPress natively, my home page appeared at http://[website name]/wordpress.  I wanted it to be at http://[website name].

Here’s what I had to do to fix it:

root@n36l:/opt/wordpress-4.5.1-0/apps/wordpress# ./bnconfig --appurl /
root@n36l:/opt/wordpress-4.5.1-0/apps/wordpress# ./bnconfig --disable_banner 1
root@n36l:/opt/wordpress-4.5.1-0# /opt/wordpress-4.5.1-0/ctlscript.sh restart apache
Syntax OK
/opt/wordpress-4.5.1-0/apache2/scripts/ctl.sh : httpd stopped
Syntax OK
/opt/wordpress-4.5.1-0/apache2/scripts/ctl.sh : httpd started at port 80
root@n36l:/opt/wordpress-4.5.1-0#

Restarting my native install of Bitnami WordPress

To restart the entire stack:

malcolm@n36l:~$ sudo -s
[sudo] password for malcolm:
root@n36l:~# cd /opt/wordpress-4.5.1-0/
root@n36l:/opt/wordpress-4.5.1-0# ./ctlscript.sh restart
Syntax OK
/opt/wordpress-4.5.1-0/apache2/scripts/ctl.sh : httpd stopped
/opt/wordpress-4.5.1-0/mysql/scripts/ctl.sh : mysql stopped
2016-05-08T23:05:00.445332Z mysqld_safe Logging to '/opt/wordpress-4.5.1-0/mysql/data/mysqld.log'.
2016-05-08T23:05:00.530074Z mysqld_safe Starting mysqld.bin daemon with databases from /opt/wordpress-4.5.1-0/mysql/data
/opt/wordpress-4.5.1-0/mysql/scripts/ctl.sh : mysql  started at port 3306
Syntax OK
/opt/wordpress-4.5.1-0/apache2/scripts/ctl.sh : httpd started at port 80
root@n36l:/opt/wordpress-4.5.1-0#