Question

Could somebody please tell me how to install and configure LAMP on ubuntu 12.04 ? Is there a package similar to WAMP Server that is all-in-one ? I have tried to install from command line ,PHP,MySQL work but apache gives me this after sudo service apache2 restart * Restarting web server apache2
no listening sockets available, shutting down Unable to open logs Action 'start' failed.

And I think probably I did something wrong when installing !

Thank you !

Was it helpful?

Solution 2

You can follow tutorial from below link to setup LAMP on your Ubuntu 12,

http://technarco.com/ubuntu-linux/how-install-lamp-ubuntu-12

Enjoy, :)

OTHER TIPS

From this tutorial,

Run this commands in Ubuntu Terminal-

sudo apt-get install apache2

sudo apt-get install mysql-server

sudo apt-get install php5 libapache2-mod-php5

sudo /etc/init.d/apache2 restart

For Checking-

php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'

If u get-

Your PHP installation is working fine.

Then you are done.

To resolve this error, you need to stop other process using this port. In some of cases it is nginx. you can stop it

sudo /etc/init.d/nginx stop

you can install lamp server using Tasksel (Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system. This program is used during the installation process, but users can also use tasksel at any time)

check this post http://wiki.workassis.com/ubuntu-install-lamp-using-tasksel/

Step-1 : Open Terminal & Update Your System

$ sudo apt update

Step-2 : Install Apache Server

$ sudo apt install apache2

Step-3 : Enable Firewall to allow Apache requests

$ sudo ufw enable
$ sudo ufw allow in "Apache Full"

Step-4 : Install MySQL

$ sudo apt install mysql-server

Step-5 : Install PHP & Php-Mysql, Php-Apache libraries

$ sudo apt install php php-mysql libapache2-mod-php

Step-6 : Install PhpMyAdmin & Required Libraries

$ sudo apt install php-mbstring php-zip php-gd php-curl php-json
$ sudo apt install phpmyadmin

enter image description here

enter image description here

enter image description here

enter image description here

Step-7 : Restart Apache & update the system

$ sudo systemctl restart apache2
$ sudo apt update

Step-8 : Set Root User Password

$ sudo mysql
$ mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
$ mysql> exit

Step-9 : Restart Apache & MySQL

$ sudo systemctl restart mysql
$ sudo systemctl restart apache2

Step-10 : Congrats! You have successfully installed LAMP Stack. To verify Apache, Go to http://localhost To verify PhpMyAdmin, Go to http://localhost/phpmyadmin

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top