Debian 5 How-To Guide

Reference: www.debian.org

Table of Contents



How to Find Linux Version


$ lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 9.10
Release:	9.10
Codename:	karmic
  


How to Install Downloaded Debian Package

Reference: newlinuxuser

You cannot always find the application in the apt-get. Sometimes, you need to download a Debian package and install it yourself. When you do, use the dpkg utility to install the downloaded Debian package for you.

  1. Start up the [Root Terminal].
  2. Use the dpkg command.

    dpkg -i ~/Downloads/vnc/libvncserver-dev_0.9.3.dfsg.1-1_i386.deb



How to Use VNC

Reference: wikipedia

  1. On the Debian server, start up the [Root Terminal].
  2. Install x11vnc if not already installed.

    apt-get install x11vnc

  3. On the Linux client, install [vinagre] or some VNC client if not already installed.
  4. On the Debian server, in the [Root Terminial]...

    -- Setup a password and remember where the password is saved. --
    x11vnc -storepasswd

    -- Run the x11vnc service on the server --
    x11vnc -rfbauth ~/.vnc/passwd

  5. On the Linux client, start [vinagre]. If you can find wher vinagre is installed, you can try /usr/bin directory first.

    [/usr/bin]$ vinagre



How to Install LAMP on Debian 5

Reference:

  1. On the Debian server, install Apache in the [Root Terminal] as shown below.

    apt-get install apache2

  2. You can also install the Open SSL as shown below.

    apt-get install openssl ssl-cert

  3. In a [Root Terminal], install MySQL as shown below.

    apt-get install mysql-server

    Upon the installation completion, MySQL server starts itself. You can try out MySQL right away with MySQL client as shown below.

    mysql -p
    show databases;
    exit

  4. In a [Root Terminal], install PHP as shown below.

    apt-get install php5

    It is likely that you need to reboot before testing your new PHP install. You also need to create a "phptest.php" test script file in your /var/www directory with the following codes.

    <?php phpinfo(); ?>

    Test your PHP in your web browser by going to the web page http://localhost/phptest.php as shown below.

    Successful PHP result.

    If Firefox is trying to download the "phptest.php", then you can try to install [phpmyadmin] first as written in the section below.

  5. To test MySQL with PHP, we need to prepare a test database and a test PHP script. The followings show how to create a test database with a test table and some dummy data.

    mysql> CREATE USER readonly IDENTIFIED BY 'ReAd0nly';

    mysql> CREATE USER readonly IDENTIFIED BY 'ReAd0nly';
    Query OK, 0 rows affected (0.43 sec)

    mysql> CREATE DATABASE test;
    Query OK, 1 row affected (0.00 sec)

    mysql> USE test;
    Database changed

    mysql> CREATE TABLE items ( name VARCHAR(32) );
    Query OK, 0 rows affected (0.42 sec)

    mysql> CREATE DATABASE test;
    Query OK, 1 row affected (0.00 sec)

    mysql> INSERT INTO items VALUES ( 'chair' );
    Query OK, 1 row affected (0.44 sec)

    mysql> INSERT INTO items VALUES ( 'window' );
    Query OK, 1 row affected (0.00 sec)

    mysql> INSERT INTO items VALUES ( 'laptop' );
    Query OK, 1 row affected (0.00 sec)

    mysql> GRANT SELECT ON test.* TO 'readonly';
    Query OK, 0 rows affected (0.00 sec)

  6. Before you proceed any furthur, we still need to make PHP to work with MySQL.

    Instead of working through the setup between PHP and MySQL, we can take the shortcut by install PHPMyAdmin. The installation will take care of the configuration between PHP and MySQL. To install PHPMyAdmin, do the following in a [Root Terminal].

    apt-get install phpmyadmin

  7. You can test the new PHP-MySQL with the following.

    mysql -u readonly -pReAd0nly

    You can then test the PHP-MySQL script - "phptest-mysql.php". The codes of this test script can be found at phptest-mysql.php.txt.

  8. You can also test the phpmyadmin on-line utility by going to http://localhost/phpmyadmin.



How to Mount Debian 5 Server Directory on a Linux Client

Reference:

Mounting a remote Linux directory on a Linux client should be easy (even without SAMBA server). Just make sure your Linux support NFS as shown below.

Make sure you have the needed NFS components on your Linux system.