Install LAMP on *Ubuntu within few terminal commands

There is many guides how to properly install LAMP on Ubuntu and other Debian-based Linux distros and here I come with the most simple one as possible. With few commands you will be able to install all needed components, have all required services running and things configured to your preferences.

Start with adding one source to list of your software sources, this will give you access to phpmyadmin:
sudo add-apt-repository ppa:nijel/phpmyadmin
Now update list of available software with this:
sudo apt-get update

Next step is to install all basic LAMP components, this is fairly long command because it contains names of many libraries and programs:
sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin php5-mcrypt php5-gd php5-xdebug php5-curl php5-sqlite
Installing this will take a while and during installation you will be prompt to set up your password for accessing mysql and phpmyadmin.

To (re)start apache server paste this into terminal:
sudo /etc/init.d/apache2 restart

Now we need to access phpmyadmin, right? If you can’t access this tool by simple pasting http://localhost/phpmyadmin into webbrowser you need to insert and run these two commands:
cd /var/www/
sudo ln -s /usr/share/phpmyadmin/ phpmyadmin
Since now you can access phpmyadmin from your webbrowser without problems.

During your webdevelopment journey you may face some problems like inaccessible files of your project. Since all your project files are stored (at least you should to) in /var/www/ location it is required to give to all of subfolders and files in it to bind special permission. To change permissions for this folder you need to paste and run this command in terminal:
sudo chmod -R 777 /var/www/

Since now you are fully ready to develop anything you want, have fun 😉

Advertisements
This entry was posted in Uncategorized and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

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