Share the Knowledge
RSS icon Home icon
  • How to change the hostname of your Ubuntu server

    Posted on November 9th, 2011 webmaster No comments         Print Print

    This post is really more of a note to myself as I’m sure I’ll be doing this again.  But hopefully someone else will stumble upon this and find it useful :) .

    I have a VPS hosted on Rackspace running Ubuntu 10.04 LTS server edition.  I wanted to change the hostname as I originally named it the name of the application I was working on, but I’m now planning on using it for multiple things.  I wanted the name to be more generic.

    Step 1. Type in the following command.

     sudo hostname newhostname 

    Step 2. Edit the /etc/hostname file and replace the text there with the new hostname and save it.

     sudo vi /etc/hostname 

    Step 3. Edit the /etc/hosts file and replace the old hostname references to the new hostname, then save it.

     sudo vi /etc/hosts 

    Step 4. Logout and log back in

    It will now show user@newhostname in the command prompt, typing hostname will now show the new hostname, and pinging the new hostname will resolve to something.

    Source: http://linuxservertutorials.blogspot.com/2009/02/how-to-change-hostname-in-ubuntu-server.html

  • How to allow remote connections to your PostgreSQL 9.0 database server on Ubuntu 10.04 LTS

    Posted on September 8th, 2011 webmaster No comments         Print Print

    Change directory to /etc/postgresql/9.0/main and modify the following configs (I know you’re sick of hearing this, but I recommend you back up your original configs before making any changes):

    postgresql.conf

    In “Connections and Authentication” section:

    From

    
    #listen_addresses = 'localhost'
    #password_encryption = on
    

    To

    
    listen_addresses = '*'
    password_encryption = on
    

    pg_hba.conf

    From

    host    all    all    127.0.0.1/32    md5
    host    all    all    ::1/128    md5
    

    To

    host    all    all    0.0.0.0/0   md5
    host    all    all    ::0/0    md5
    

    Restart the ssh daemon: /etc/init.d/ssh restart

  • Errors when installing the Python ‘lxml’ library using pip on Ubuntu

    Posted on August 28th, 2011 webmaster No comments         Print Print

    I thought I’d post this here, this is the second time I ran into this issue on Ubuntu and forgot what I did the first time.

    If you get errors about things missing when you do ‘sudo pip install lxml’ on Ubuntu, you’ll probably need to install the following development packages (source):

    • sudo apt-get install python-dev
    • sudo apt-get install libxml2-dev
    • sudo apt-get install libxslt1-dev

    You may also want to do ‘sudo pip install lxml –upgrade’ if pip tells you that it’s already installed but you know it wasn’t properly installed.