Pages

15 June 2010

Configure LAMP For Newbies

What is LAMP ?

LAMP is an acronym for a solution stack of free, open source software, originally coined from the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software), and PHP, principal components to build a viable general purpose web server

Linux

Linux is a Unix-like computer operating system kernel. A major emphasis of Linux development is security, which makes it an appealing choice for a web-server application. Like the other LAMP components, Linux is free open-source software which means the source code is provided with operating system, which can be edited according to specific needs. Also, because Linux-based operating systems are Unix-like, a Linux server is more natively-compatible with other server-oriented platforms, such as Solaris and BSD, than non-Unix-like systems like Microsoft Windows.


Apache

Apache is a free software/open source web server, the most popular in use

MySQL

MySQL is a multithreaded, multi-user, SQL database management system (DBMS) with more than eleven million installations. Since 16 January 2008, owned by Sun Microsystems, as of 20 April 2009, Oracle Corporation has agreed to purchase Sun Microsystems.

Perl, PHP, or Python

PHP is a reflective programming language originally designed for producing dynamic web pages. PHP is used mainly in server-side application software. Perl and Python can be used similarly.


Installation of LAMP

Here I am assuming you have already installed Linux on your PC/server.

First of all we are installing Apache, Mysql-server & php

# yum install httpd mysql-server php php-mysql

# chkconfig httpd on
# chkconfig mysqld on
# service httpd restart
# service mysqld restart


Made mysql running to add user & password

# mysqladmin -u root password [your_password]

Login on to mysql-server

# mysql -uroot -p[your_password]

Now time to Publish a website with LAMP

for apache /var/www/html is default directory where you can place your own webdata
here we are creating a simple HTML file for testing.

# echo "This is my first web site" > /var/www/html/index.html

# service httpd restart

Open a web browser and type on address bar

http://localhost

Here you can see page with messege "This is me first web site"

Congrats, Now you are ready to work on LAMP

Linux FTP Server Setup

This tutorial is concentrating on setting up a real environment of FTP server.

To configure FTP server in Linux vsftpd is  a default package which I am using.

First of all install the vsftpd package on your Linux server. I am using CentOS Linux.

#yum install vsftpd

Now entering in vsftpd.conf  using vim command


#vim /etc/vsftpd/vsftpd.conf

# Allow anonymous FTP?
# anonymous_enable=YES

# Uncomment this to allow local users to log in.
local_enable=YES

Restart the vsftpd service

#chkconfig vsfftp on
#service vsftpd restart

Now create a users group named ftpusers
#groupadd ftpusers

Create a directory on root

#mkdir /www


Make the directory accessible to the ftpusers group:  
 #chmod 775 /www
#chown root:ftpusers /www


Now finally add ftp users with default directory www
#useradd -g ftpusers -d /www user01
#passwd user001

Your FTP server has configured now :

Now testing phase

login to ftp server with command mode

#ftp localhost
username - user01
password - your password

Supply pwd command to see your home directory


Always remember to add firewall exception for FTP service to access from remote client