Sunday 6 September 2009

How to install and configure Debian Linux (LAMP server) on the Toshiba Portégé 2000 from XP

From windows XP search the internet for debian.exe which is the win32 installer for Debian.

Run the installer and follow the instructions.

When the machine reboots, select the Debian installer option. Debian will boot and the installer will load. Follow the installer instructions and make appropriate choices. Install the base system and select no packages, it’s much easier to install them afterwards.

Once the system is installed login as root.

Check for a network connection by pinging a server, type #ping www.google.com
You should be able to quit the ping by pressing q or by CTRL+C.

You can see your network config by typing #ifconfig which is similar to when you type ipconfig on a windows 2000 or XP machine.

You can list the files and folders in the current directory by using the #ls command. There are many variations to this command like #ls –la or #ls –l for example.

You can change directories with the #cd command. Change to the root folder by typing #cd /

You can see a list of running processes by typing #ps for all processes type #ps -A

Now you can install the mysql database, the apache web server and php5. The following commands should do it with the correct libraries.

#apt-get install mysql-server libapache2-mod-php5 apache2
#apt-get install php5
#apt-get install php5-mysql
#apt-get install php5-gd

Now install samba for sharing files with windows based machines.

#apt-get install samba

Now install your ssh server sshd for secure shell access to your server.

#apt-get install sshd

Now install proftpd for ftp access to your server. Note that you need to select standalone as the server type.

#apt-get install proftpd

Once completed you need to edit the proftpd configuration file ‘proftpd.conf’. To do this simply navigate to /etc/proftpd/ by typing #cd /etc/proftpd and then type #vi proftpd.conf to begin editing the file. Use the cursor keys to navigate to the entry that says ‘UseIPv6 on’ and change it to off. You do this by moving the cursor over the letters and pressing the [x] key. Once deleted press the [i] key to start inserting text, type off and then press the [ESC] key to take you out of insert mode. Now press [SHIFT] and [;] to display the vi command prompt. At the vi command prompt type :w to write the changes to the file then type :quit to exit out of vi.

***also created ftp groups and added the users not sure if that made a dif though**

You can use the following command to see if a package is installed.

#apt-cache policy

If you don’t know the package’s name you can type the following.

#apt-cache search

You can remove packages by the following command.

#aptitude purge

Now create a new user by typing the following command #adduser user1 the user1 can be replaced with any username of your choice. #su user1 will switch to the user1. After switching user account to user1 you can set the password for user1 by typing #passwd

If you want to create a new user with root powers (it is not recommended, only the user root should have full root powers for a secure system) then type #useradd -G root rootuser

If you want to modify a user and give it root powers then type #usermod -G root user1

The ‘–G’ part of the above command represents groups and the ‘root’ part represents the name of the group. By default there is a user called root and a group called root. Any user that is a member of the group ‘root’ will have full root powers over the system.

Type #cat /etc/group for a list of groups on the system.

#id will tell you what user you are logged in as
#id root will tell you what groups the user root is a member of
#id user1 will tell you what group a user is a member of.

Some important locations:
/etc/network/interfaces is the network configuration file and contains network information
/etc/init.d is the directory for scripts which are run at boot. Type #man init for details
/var/www is the apache web server folder. Web documents go here for publishing to the web

Now create and setup your database with the following commands. First you need to create the mysql root user and password by using the command below.

#mysqladmin -u root password

Now login to mysql as root by typing #mysql –u root –p you will be prompted for the password. You should now be at the mysql> prompt.

Mysql>create database ;.

create a mysql database
create a user and username

chmod g+w apache2-default

To delete a db.
drop database [database name];

No comments:

Post a Comment