Have you ever set the hostname on your Ubuntu installation only to want to change later? Here is an easy way to accomplish this and only requires changing a single line in a configuration file.
To begin, open the file /etc/hostname:
1
sudo vim /etc/hostname Change the text in that file to what you would like your new hostname to be and reboot your computer.
When I’m working on a new project, I often find myself wanting to setup a subdomain (e.g. http://myproject.dev) in my local environment to use while doing development. If you’re using XAMPP (or standalone Apache), this is actually a pretty easy thing to do.
These instructions should work in both Windows and Linux environments. I’ll attempt to make notes where things differ.
Step 1 Setting up subdomains requires using a VirtualHost in Apache.