How to Configure LAMP on Linux Sever in Simple Steps?

In this tutorial, I would like to guide you about configuring LAMP on Linux server with a few simple steps. You don’t have to be a pro in coding to perform this action and with this simple tutorial you’d be able to accomplish this easily.

Steps to install Apache:

1) To install Apache use the command

yum install httpd

2) To configure the apache start time at system boot

chkconfig –levels 235 httpd

3) To start Apache

/etc/init.d/httpd start

You’re done with it! You have installed Apache successfully

Now ensure your IP address. It will be displayed as below

e.g.: http://192.168.1.1..

Steps to install Mysql on your server:

yum install mysql

1) To configure the mysql start time at system boot

chkconfig –levels 235 mysqld

2) To start Mysql

/etc/init.d/mysqld start

3) To set password for mysql page (http://hostname/phpmyadmin):

Run the command

mysql_secure_installation

Press y and enter

You will be asked for new password. Enter your password and press enter key

Note: The password you entered will not be visible in the command mode.

Now re-enter the password and press enter key.

By this, you have set password for mysql successfully.

Steps to install PHP:

1)      Use this command to install the latest PHP version on your server

yum install php

2)      Once you installed PHP, you need to restart the Apache using the following command

/etc/init.d/httpd restart

You’re done with it! Now the LAMP is installed successfully on your server. Now you can run PHP in your server.

Steps to install ftp access:

yum -y install vsftpd

There are certain setting needs to be modified.

To perform that use the below command to edit the vsftp configuration file.

vim /etc/vsftpd/vsftpd.conf

And press ctrl + w and find “anonymous_enable” and modify the value to “NO”

anonymous_enable=NO

Find “ascii_upload_enable” and modify like the below.

ascii_upload_enable=YES

ascii_download_enable=YES

Find “chroot_list_enable” and Uncomment the below lines by removing #.

chroot_list_enable=YES

chroot_local_user=YES

Find “chroot_list_file” and Uncomment the below lines.

chroot_list_file=/etc/vsftpd/chroot_list

Find “ls_recurse_enable” and Uncomment the below lines.

ls_recurse_enable=YES

Add the below code at the bottom of configuration file. Specify the directory path for “local_root” which you want to enable to the user as home directory. If you are not specifying any value then the ftp home directory will be assigned to user also.

local_root=public_html

use_localtime=YES

Once you have done all the changes, press ctrl + e followed by “Y” and press enter key.

Run the command

/etc/rc.d/init.d/vsftpd start

By now you’d have enabled FTP as well.

So, in short, you’d have configured LAMP on Linux server with no cost also in few minutes. If you’ve some other ways of configuring the same, add the coding via comments as it will be beneficial to readers.

Realated Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">