Ubuntu

Ubuntu

Introduction

Linux is an alternative to operating systems like Windows or the Mac OS. Linux is also free and comes in many distributions. For the purposes of this page, Ubuntu is the distribution of choice and also ranks rather high on the DistroWatch.

Getting Started

Installation & Setup

Here are some quick steps for installing and setting up of the Ubuntu (7.x and above) distribution on your machine:

Server Install

  1. Visit the Ubuntu web site and download the server ISO CD image.
  2. Once downloaded, burn the ISO file to CD, and reboot to start the installation process.
  3. Pick the server install from the main menu and follow the install screen prompts.
  4. When asked to detect keyboard, skip this and pick your country settings instead.
  5. When asked to to setup your hard disk pick “Guided - use entire disk”.
  6. When asked for automatic software updates, choose manual.
  7. When asked what software to install after the core has been installed choose: LAMP. It won’t work but pick it anyway. You’ll need to follow the Server Setup steps below to configure everything else once the installation is finished.

TIP: For static network setup, you might want to install with no connection to the network which will force manual configuration of your network during installation. The default is DHCP.

Server Setup

  1. Configure network settings (if necessary).
    1. Edit the /etc/network/interfaces file adding the ip, netmask, and gateway for your ethernet adapter.
    2. Edit the /etc/resolv.conf so that it includes the primary and secondary DNS servers.
  2. Install and configure the OpenSSH Server.
    1. Run sudo aptitude from the command line.
    2. Browse to the Not Installed Packages->net->main category.
    3. Select open-sshserver and install it.
    4. Edit the /etc/ssh/sshd_config file so that the “Banner” line is uncommented to pick up the changes.
    5. Edit the /etc/issue.net file as you see fit (maybe enter the name of your server or something clever).
    6. Restart the server: sudo /etc/init.d/ssh restart.
  3. Install and configure FTP Server.
    1. Run sudo aptitude from the command line.
    2. Browse to the Not Installed Packages->net->main category.
    3. Select vsftpd and install it.
    4. Edit the /etc/vsftpd.conf file.
      1. Set anonymous_enable=NO
      2. Set local_enable=YES
      3. Set write_enable=YES
    5. Restart the server: sudo /etc/init.d/vsftpd restart
  4. Install and configure Postfix.
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->mail->main category.
    3. Select postfix and install it.
    4. During the installation, choose “Internet Site”, when asked.
    5. Edit the /etc/postfix/main.cf config file.
    6. Reboot: postfix reload
    7. Check either the /var/log/mail.log or /var/log/mail.err logs for errors.

    Read the Ubuntu help documentation for further details if you need it. It is possible that you might need to reconfigure postfix once it has been installed. Do this by issuing sudo dpkg-reconfigure postfix from the command line.

  5. Install ImageMagick.
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->graphics->main category.
    3. Select imagemagick and install it.

    I use this mostly in conjunction with the WordPress Postie plugin for blog-by-email image resizing and rotation capabilities.

  6. Install the zip and unzip utilities. You can do this by using apt-get or simply launching aptitude and browsing to the utils category and installing zip/unzip.
  7. Install and configure PHP5.
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->web->main category.
    3. Select the following: php5, php5-cli, php5-cgi, php5-mysql, php5-gd, and php5-xmlrpc.
  8. Install and configure the Apache HTTP Server.
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->web->main category.
    3. Select apache2 and install it.
    4. Create your own Apache web directory (instead of using the defaults). Example: /web.
    5. Create a new user group that will be associated with the newly created /web directory.
    6. Create and add team members to the new “web” user group.
    7. Set group permissions on the “web” directory so the new group can access the directory.
    8. Copy the /etc/apache2/sites-available/default file to a /etc/apache2/sites-available/(your site name) file.
    9. Edit the /etc/apache2/sites-available/(your site name) file.
      1. Set the ServerName to your private or public web address. Example: ..com.
      2. Set the ServerAdmin to your personal e-mail address.
      3. Set the DocumentRoot to whatever your newly created “web” directory path name is.
      4. Rename the /var/www directory to whatever your newly created “web” directory path is.
    10. Disable the default site: sudo a2dissite.
    11. Enable your new site: sudo a2ensite.
    12. Enable any additional modules by issuing the sudo a2enmod command and picking which module(s) you want to enable. Example: rewrite.
    13. Restart the server: sudo /etc/init.d/apache2 restart.
  9. Install and configure MySQL.
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->misc->main category.
    3. Select mysql-server-5.0 and install it.
    4. Set the root password: sudo mysqladmin -u root password (your new password). You might also want to log into MySQL using the following command: mysql -u root -p. It is worthwhile to double check the root password is set.
    5. Edit the /etc/mysql/my.cnf file.
      1. Comment out the “bind-address=127.0.0.1″ line so connections can be accepted from other machines.
      2. Restart the server: sudo /etc/init.d/mysql restart
    6. Login to MySQL and create a default database: CREATE DATABASE (new database name here).
    7. Grant access to the new database for the main user or set of users who might need to access the database via MySQL Administrator or other GUI tools: GRANT ALL PRIVILEGES ON <database>.* TO "<username>"@"<host>" IDENTIFIED BY "<password>"; NOTE: <database>, <username>, <host>, and <password> should be replaced accordingly.
  10. Install and configure Samba
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->net->main category.
    3. Select and install “samba”.
    4. I strongly recommend, that if you are just wishing to use Samba to mount Windows drives, that you use the following command: apt-get install smbfs. This is because the aptitude utility will not show this as a package that can be downloaded and you can only get it by using the apt-get command.
    5. For creating mounts to Windows file systems, use the following instructions. Another source of information is Mounting SMBFS Shares Permanently found on the Just Linux web site.
    6. To test your Samba connections, use the following command: smbclient -L <windows-box> -U <username>
  11. Install and configure Subversion
    1. Run aptitude from the command line.
    2. Browse to the Not Installed Packages->devel->main category.
    3. Select and install “subversion”.
    4. Follow the subversion install notes found here.

For more information, visit the Ubuntu Help web site.

Tips and Tricks

Applications

  1. ManDVD - Use it to create customized DVD menus.