INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP


Debian OpenLogo
Image via Wikipedia

Today I am going to talk about only installation of tools/apps required for LINUX Server. I have chosen DEBIAN, since it makes you intelligent😉.

Okay, cool, now? First thing you have to buy a hosting space, there are quite a good people who provide this service – do a quick Google.

OKAY – Now let’s say you have got the hosting space and you have selected the DEBIAN (LENNY) OS and logged into the machine – remember DEBIAN is for intelligent & its not for human-beings means most of the tools/apps will require a separate installation. You have to dive deeper to figure out the tools you want and install them – this is interesting because it let’s you know things🙂.

P.S:
This blog post is recommended for those users who knows about LINUX SERVER & shouldn’t find the meaning of Debian in the dictionary.

Let’s get the server ready……

Starting with:

Be we start installing anything, make sure you have following sources list in your aptitude source.lists file (/etc/apt/sources.list)

deb http://http.us.debian.org/debian/ lenny main contrib non-free
deb-src http://http.us.debian.org/debian/ lenny main contrib non-free
 
deb http://security.debian.org/ lenny/updates main contrib
deb-src http://security.debian.org/ lenny/updates main contrib
 

It is better to have the packages installed from debian repository instead of others. Since, debian releases security patch for all the packages installed on every occasion.

  • Init:
    • Add the following to “vi ~/.bashrc
      • “set -o vi”
      • uncomment line “alias ll=’ls -l’
    • “aptitude update” – this will take care of updating the repository lists
  • VIM
    • Install the following packages:
      • “aptitude install vim vim-runtime”
  • User creation:
    • Create an initial user with
      • “useradd -d /home/rakesh -g www-data -m -s /bin/bash rakesh”
      • “passwd rakesh”
    • “cd /home/rakesh” – dump the my user-create script (if you are interested you can copy it from here)
      • Have my own script which will create the user & add him to default “www-datagroup and a newly defined “developergroup
      • I use perl-crypt to create the password for the user and I faced a weird warning “perl: warning: Setting locale failed.” – after googling I found that perl-locales were missing and I did a debianbeauty
        • “aptitude install locales locales-all”
    • Now give the sudo access (“vi /etc/sudoers“) to developer group for “chown” & “chmod” – so that people will not trouble you to give permission on any particular folder.
      • Make sure “sudo” is installed, if not:
        • “aptitude install sudo”
  • SSH in /etc/ssh/sshd_config
    • Do not allow “root” login by disabling
      • “PermitRootLogin no”
    • If you want you can have a specific IP to allow to get access this machine
      • “AllowUsers *@<ip-address> *@<domain.com> rakesh@myowndomain.com”
    • Restart the SSH
      • “/etc/init.d/ssh restart”
  • APACHE
    • Install the following modules/packages
      • “aptitude install apache2 apachetop”
    • Enable the following modules
    • Enable the site (if any)
      • a2ensite<name of the conf file>”
        • you have to define the conf file in /etc/apache2/sites-available/<name of the conf file>
        • usually it is better to name the conf as the domain name to avoid confusion
    • To restart your apache
      • “/etc/init.d/apache2 restart’ – most of the important tools is kept under /etc/init.d/
    • ERRORS:
      • When I trying to see the phpinfo by creating a file index.php with “phpinfo()” I could not see any data in the browser, instead it just thrown me download dialog box – that means php is not enabled or apache could not understand the extension.
      • Make sure you enabled php5 by doing
        • “a2enmod php5”
      • It should enable if available or else
        • “aptitude install libapache2-mod-php5”
  • MySQL
    • Install the following things:
      • “aptitude install mysql-server mysql-client mysql-common mysqltuner”
  • PHP
    • Install the following necessary modules/packages
      • “aptitude install php5 php5-dev php5-cgi php5-mysql php5-xdebug php5-xml php-pear php5-common php5-curl php5-gd php5-imagick php-xml-parser php-xml-serializer php-apc php-auth php-log php-http php-http-upload php-pager php-date php-db”
    • ERRORS:
      • When I was trying to install APC using “pecl install APC” – I got the following error:
        • Perl is not installed – looks like it is installed hence left this.
        • Apache was not compiled with DSO support (–enable-module=so)
        • ‘apxs’ is not in your path.  Try to use –with-apxs=/path/to/apxs
          • This is missing and hence I installed
            • “aptitude install apache2-threaded-dev”
      • Error: ‘make’: command not found
        • “aptitude install make”
  • SVN
    • Install the following packages:
      • “aptitude install subversion”
  • Common Libraries– I use to dump the common libraries inside /usr/share/libraries
  • PHPMyAdmin
    • Install the following package if you want to have a PHPMyAdmin tool for administrating your MySQL
      • “aptitude install phpmyadmin”
  • Mail (SMTP)
    • Install the following packages:

Artifacts:

My create user script

#!/bin/sh
user=$1
apache=”33″
developers=”105″
passuser=”${user}!@88″
newpasswd=$(perl -e ‘print crypt($ARGV[0], “sAlT5TriNG”)’ $passuser)
createuser=’/usr/sbin/useradd’
modifyuser=’/usr/sbin/usermod’
##create and update password, then assign the apache group to the user
$createuser -d /home/$user -g $apache -m -s /bin/bash -p $newpasswd $user
#modify the user
$modifyuser -aG $developers $user

Happy Installing!

INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP

6 thoughts on “INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP

  1. Teris says:

    I have been seeking for quite a while for a proper articles or blog posts associated with this unique subject . Researching in Yahoo and google I now uncovered this great site. After reading these details I’m thrilled to enunciate that I’ve got a really good sense I discovered precisely what I needed. I’ll make sure to remember this website and look constantly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s