How To Setup a LAMP Server on Debian Linux 8 (Jessie)

How To Setup a LAMP Server on Debian Linux 8 (Jessie)

A LAMP (Linux, Apache, MySQL, PHP) server is a popular stack of open-source software used to run dynamic web applications. Here is how you can set up a LAMP server on Debian Linux 8 (Jessie):

  1. Install Apache web server:

To install the Apache web server on Debian, run the following command:

sudo apt-get install apache2
Sou‮:ecr‬www.lautturi.com

This will install Apache and start the Apache service.

  1. Install MySQL database server:

To install the MySQL database server on Debian, run the following command:

sudo apt-get install mysql-server

During the installation, you will be prompted to set a password for the MySQL root user.

  1. Install PHP:

To install PHP on Debian, run the following command:

sudo apt-get install php5 libapache2-mod-php5

This will install PHP and the Apache PHP module, which allows Apache to process PHP scripts.

  1. Configure PHP:

To configure PHP, you need to edit the PHP configuration file php.ini. You can find the configuration file in the /etc/php5/apache2 directory.

Open the php.ini file in a text editor and make any necessary changes. For example, you can increase the memory_limit or upload_max_filesize values to allow PHP to handle larger files.

  1. Restart Apache:

After you have installed and configured PHP, you need to restart Apache to apply the changes. Run the following command to restart Apache:

sudo service apache2 restart
  1. Test the LAMP server:

To test the LAMP server, create a PHP script and place it in the /var/www/html directory. For example, you can create a script called info.php with the following contents:

<?php
phpinfo();
?>

Then, open a web browser and visit http://localhost/info.php. You should see a page displaying the PHP information and configuration details.

Created Time:2017-10-29 22:08:32  Author:lautturi