Skip to content

Instantly share code, notes, and snippets.

@anistark
Last active September 20, 2016 07:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anistark/5313ffd9b367499ab344 to your computer and use it in GitHub Desktop.
Save anistark/5313ffd9b367499ab344 to your computer and use it in GitHub Desktop.
LAMP Setup

Install Apache

sudo apt-get update
sudo apt-get install apache2

Install Mysql

sudo apt-get install mysql-server php5-mysql

Install Php

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-gd php5-curl

Once above is done, enable index.php as on the index files.

sudo nano /etc/apache2/mods-enabled/dir.conf

It will look like this:

<IfModule mod_dir.c>

    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>

Change to:

<IfModule mod_dir.c>

    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

</IfModule>
sudo service apache2 restart

Install phpMyAdmin

The easiest way to install phpmyadmin is through apt-get:

sudo apt-get install phpmyadmin apache2-utils

During the installation, phpMyAdmin will walk you through a basic configuration. Once the process starts up, follow these steps:

Select Apache2 for the server Choose YES when asked about whether to Configure the database for phpmyadmin with dbconfig-common Enter your MySQL password when prompted Enter the password that you want to use to log into phpmyadmin After the installation has completed, add phpmyadmin to the apache configuration.

sudo nano /etc/apache2/apache2.conf

Add the phpmyadmin config to the file.

Include /etc/phpmyadmin/apache.conf

Restart apache:

sudo service apache2 restart

Install Composer (in ubuntu globally) [Optional]

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Now you can install php packages using composer :

composer install

Additional Settings :

Mcrypt setup :

sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment