A “LAMP” stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP.
In this guide, we’ll get a LAMP stack installed on an Ubuntu 14.04 Droplet. Ubuntu will fulfill our first requirement: a Linux operating system.
Note: The LAMP stack can be installed automatically on your Droplet by adding this script to its User Data when launching it. Check out this tutorial to learn more about Droplet User Data.
Before you begin with this guide, you should have a separate, non-root user account set up on your server. You can learn how to do this by completing steps 1-4 in the initial server setup for Ubuntu 14.04.
The Apache web server is currently the most popular web server in the world, which makes it a great default choice for hosting a website.
We can install Apache easily using Ubuntu’s package manager, apt
. A package manager allows us to install most software pain-free from a repository maintained by Ubuntu. You can learn more about how to use apt
here.
For our purposes, we can get started by typing these commands:
sudo apt-get update
sudo apt-get install apache2
Since we are using a sudo
command, these operations get executed with root privileges. It will ask you for your regular user’s password to verify your intentions.
Afterwards, your web server is installed.
You can do a spot check right away to verify that everything went as planned by visiting your server’s public IP address in your web browser (see the note under the next heading to find out what your public IP address is if you do not have this information already):
<pre> http://<span class=“highlight”>your_server_IP_address</span> </pre>
You will see the default Ubuntu 14.04 Apache web page, which is there for informational and testing purposes. It should look something like this:
If you see this page, then your web server is now correctly installed.
If you do not know what your server’s public IP address is, there are a number of ways you can find it. Usually, this is the address you use to connect to your server through SSH.
From the command line, you can find this a few ways. First, you can use the iproute2
tools to get your address by typing this:
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
This will give you one or two lines back. They are both correct addresses, but your computer may only be able to use one of them, so feel free to try each one.
An alternative method is to use an outside party to tell you how it sees your server. You can do this by asking a specific server what your IP address is:
curl http://icanhazip.com
Regardless of the method you use to get your IP address, you can type it into your web browser’s address bar to get to your server.
Now that we have our web server up and running, it is time to install MySQL. MySQL is a database management system. Basically, it will organize and provide access to databases where our site can store information.
Again, we can use apt
to acquire and install our software. This time, we’ll also install some other “helper” packages that will assist us in getting our components to communicate with each other:
sudo apt-get install mysql-server php5-mysql
Note: In this case, you do not have to run sudo apt-get update
prior to the command. This is because we recently ran it in the commands above to install Apache. The package index on our computer should already be up-to-date.
During the installation, your server will ask you to select and confirm a password for the MySQL “root” user. This is an administrative account in MySQL that has increased privileges. Think of it as being similar to the root account for the server itself (the one you are configuring now is a MySQL-specific account however).
When the installation is complete, we need to run some additional commands to get our MySQL environment set up securely.
First, we need to tell MySQL to create its database directory structure where it will store its information. You can do this by typing:
sudo mysql_install_db
Afterwards, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit. Start the interactive script by running:
sudo mysql_secure_installation
You will be asked to enter the password you set for the MySQL root account. Next, it will ask you if you want to change that password. If you are happy with your current password, type “n” for “no” at the prompt.
For the rest of the questions, you should simply hit the “ENTER” key through each prompt to accept the default values. This will remove some sample users and databases, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.
At this point, your database system is now set up and we can move on.
PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get information, and hand the processed content over to our web server to display.
We can once again leverage the apt
system to install our components. We’re going to include some helper packages as well:
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
This should install PHP without any problems. We’ll test this in a moment.
In most cases, we’ll want to modify the way that Apache serves files when a directory is requested. Currently, if a user requests a directory from the server, Apache will first look for a file called index.html
. We want to tell our web server to prefer PHP files, so we’ll make Apache look for an index.php
file first.
To do this, type this command to open the dir.conf
file in a text editor with root privileges:
sudo nano /etc/apache2/mods-enabled/dir.conf
It will look like this:
<pre> <IfModule mod_dir.c> DirectoryIndex index.html index.cgi index.pl <span class=“highlight”>index.php</span> index.xhtml index.htm </IfModule> </pre>
We want to move the PHP index file highlighted above to the first position after the DirectoryIndex
specification, like this:
<pre> <IfModule mod_dir.c> DirectoryIndex <span class=“highlight”>index.php</span> index.html index.cgi index.pl index.xhtml index.htm </IfModule> </pre>
When you are finished, save and close the file by pressing “CTRL-X”. You’ll have to confirm the save by typing “Y” and then hit “ENTER” to confirm the file save location.
After this, we need to restart the Apache web server in order for our changes to be recognized. You can do this by typing this:
sudo service apache2 restart
To enhance the functionality of PHP, we can optionally install some additional modules.
To see the available options for PHP modules and libraries, you can type this into your system:
apt-cache search php5-
The results are all optional components that you can install. It will give you a short description for each:
php5-cgi - server-side, HTML-embedded scripting language (CGI binary)
php5-cli - command-line interpreter for the php5 scripting language
php5-common - Common files for packages built from the php5 source
php5-curl - CURL module for php5
php5-dbg - Debug symbols for PHP5
php5-dev - Files for PHP5 module development
php5-gd - GD module for php5
. . .
To get more information about what each module does, you can either search the internet, or you can look at the long description in the package by typing:
<pre> apt-cache show <span class=“highlight”>package_name</span> </pre>
There will be a lot of output, with one field called Description-en
which will have a longer explanation of the functionality that the module provides.
For example, to find out what the php5-cli
module does, we could type this:
apt-cache show php5-cli
Along with a large amount of other information, you’ll find something that looks like this:
. . .
SHA256: 91cfdbda65df65c9a4a5bd3478d6e7d3e92c53efcddf3436bbe9bbe27eca409d
Description-en: command-line interpreter for the php5 scripting language
This package provides the /usr/bin/php5 command interpreter, useful for
testing PHP scripts from a shell or performing general shell scripting tasks.
.
The following extensions are built in: bcmath bz2 calendar Core ctype date
dba dom ereg exif fileinfo filter ftp gettext hash iconv libxml mbstring
mhash openssl pcntl pcre Phar posix Reflection session shmop SimpleXML soap
sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader
xmlwriter zip zlib.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
Description-md5: f8450d3b28653dcf1a4615f3b1d4e347
Homepage: http://www.php.net/
. . .
If, after researching, you decide you would like to install a package, you can do so by using the apt-get install
command like we have been doing for our other software.
If we decided that php5-cli
is something that we need, we could type:
sudo apt-get install php5-cli
If you want to install more than one module, you can do that by listing each one, separated by a space, following the apt-get install
command, like this:
<pre> sudo apt-get install <span class=“highlight”>package1</span> <span class=“highlight”>package2</span> <span class=“highlight”>…</span> </pre>
At this point, your LAMP stack is installed and configured. We should still test out our PHP though.
In order to test that our system is configured properly for PHP, we can create a very basic PHP script.
We will call this script info.php
. In order for Apache to find the file and serve it correctly, it must be saved to a very specific directory, which is called the “web root”.
In Ubuntu 14.04, this directory is located at /var/www/html/
. We can create the file at that location by typing:
sudo nano /var/www/html/info.php
This will open a blank file. We want to put the following text, which is valid PHP code, inside the file:
<?php
phpinfo();
?>
When you are finished, save and close the file.
Now we can test whether our web server can correctly display content generated by a PHP script. To try this out, we just have to visit this page in our web browser. You’ll need your server’s public IP address again.
The address you want to visit will be:
<pre> http://<span class=“highlight”>your_server_IP_address</span>/info.php </pre>
The page that you come to should look something like this:
This page basically gives you information about your server from the perspective of PHP. It is useful for debugging and to ensure that your settings are being applied correctly.
If this was successful, then your PHP is working as expected.
You probably want to remove this file after this test because it could actually give information about your server to unauthorized users. To do this, you can type this:
sudo rm /var/www/html/info.php
You can always recreate this page if you need to access the information again later.
Now that you have a LAMP stack installed, you have many choices for what to do next. Basically, you’ve installed a platform that will allow you to install most kinds of websites and web software on your server.
Some popular options are:
Note: We will be updating the links above to our 14.04 documentation as it is written.
<div class=“author”>By Justin Ellingwood</div>
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Thanks man. great tutorial
fera …infelismente não conseguir instalar :(
You can do this in a lot less steps
Thanks for sharing. Great shortcut to installing LAMP
There is no harm in installing step by step. It helps us understand what and why we are installing and this article have done it really well. Cheers to Justin :)
Cool Nice shortcut by the way. Helps in critical situations :)
Friggin awesome LOL. I’m a developer…I have to configure enough stuff. This was great.
The only thing I would add to the list is:
Deu tudo certo mas, no phpmyadmin estar aparecendo esta mensagem
A extensão mcrypt não está presente. Por favor, verifique a configuração do PHP.´´ em fim, não sei se isso tem a ver com a configuração pois não consigo achar o erro ,se alguém poder me ajudar eu agradeço desde já,abrç
Following the tutorial and getting the following issue:
ubuntu@host:~$ sudo mysql_install_db FATAL ERROR: Could not find my-default.cnf
If you compiled from source, you need to run ‘make install’ to copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top level of the extracted archive, or pass the --basedir option pointing to that location.
Any ideas on what basedir should be?
mysql_install_db FATAL ERROR: Could not find ./bin/my_print_defaults
pkg_info | grep -i mysql
mysql-client-5.5.9 Multithreaded SQL database (client) mysql-server-5.5.9 Multithreaded SQL database (server)
/usr/local/bin/mysql_install_db
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run ‘make install’ to copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top level of the extracted archive, or pass the --basedir option pointing to that location.
Solution:
// look for binary path.
which mysql_install_db
/usr/local/bin/mysql_install_db
// look for binary path.
which my_print_defaults
/usr/local/bin/my_print_defaults
// set basedir to /usr/local
/usr/local/bin/mysql_install_db --basedir=/usr/local
Posted by Jun Hsieh at 9:45 AM Labels: FreeBSD, MySQL
@robertoramospereira: You need to install the mcrypt extension. Run:
<pre> sudo apt-get install php5-mcrypt sudo php5enmod mcrypt </pre>
See: https://www.digitalocean.com/community/articles/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04
I should mention I installed mysql-server-5.6.
@rich
I’d strongly recommend that you use the default mysql-server package, and not the mysql-server-5.6 one.
@andrewsb, any particular reason for the recommendation, other than to work with the instructions provided? I’m keen to have 5.6 for innodb with full text search, and 5.6 is the only way to get it right now…
@rich: 5.6 is in Ubuntu’s “universe” repository while 5.5 is in “main.” That means that 5.5 will receive updates and security support for the life of Ubuntu 14.04. 5.6 is maintained by the community and only will receive updates on a best effort basis. I’ve been able to reproduce your problem using 5.6, and I believe it is a bug in the package.
@andrewsb, thanks for that!
I am setting LAMP up on ubuntu 14.04 64bit and I go through all these steps, but I keep getting this error every time I restart the apache server
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using mydomain.com. Set the ‘ServerName’ directive globally to suppress this message
This is my third attempt doing this on new droplets and I get the same results every time. I never had this issue on Ubuntu 12.04
@emailspade:
That message is just a warning. To suppress it, edit “/etc/apache2/sites-enabled/000-default.conf” and set “ServerName” to your domain name.
Nevermind, think I may have solved it by adding “ServerName localhost” to the apache2.conf file located in /etc/apache2/
Andrew SB, aparece exatamente isso `php5-mcrypt já é a versão mais nova. php5-mcrypt configurado para instalar manualmente. Os seguintes pacotes foram instalados automaticamente e já não são necessários: fonts-dejavu-extra icedtea-netx-common java-common libgif4 ttf-dejavu-extra tzdata-java Utilize ‘apt-get autoremove’ para os remover. 0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 12 não atualizados.
Did you also run: (or via Google translate) Será que você também corre:
<pre> sudo php5enmod mcrypt </pre>
Venho usando o ubuntu desda da versão 10.04 nunca tive problema com isso , resolvi usar a nova versão 14.04 ,mas estou tendo este probleminha
Spin up an Ubuntu 14.04 droplet and install LAMP using Overcast:
Spin up a preconfigured LAMP Ubuntu 12.04 droplet using Overcast:
http://andrewchilds.github.io/overcast/
@ac: Thanks for sharing that! It looks like an interesting tool.
Doesn’t work - I get blank page or it shows PHP code instead of interpreting it - this following is output of error log - http://pastebin.com/gtcAu1MT
i can’t write info.php
error writing /var/www/html/info.php no such directory
what should I do?
I got, it. Thank you, for your tutorial. :)
Great tutorial! Thanks.
What advantages do we have when installing the stack parts one by one? In other words: is there any reason we shouldn’t just use “sudo tasksel install lamp-server”?
Thanks in advance.
Note that mod_auth_mysql is deprecated in Apache 2.4. Use mod_dbm instead.
Thank you for this wonderful tutorial! This is one of the best getting-started guides on the web right now! :)
I have two virtual hosts on Ubuntu 14.04 LTS by following the tutorial here https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
Is this going to make a difference on how to install the programs on this tutorial?
I got to step 4 and it is not verifying the php5.
So I updated and installed apache, but when I type the ip address in my browser to verify, I do not get the apache ubuntu default page like the tutorial shows.
All I get is:
"It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet."
I followed the steps very carefully so I do not understand what I did wrong… if anybody has any tips, that would be very much appreciated. Thanks.
I also cannot save the file <?php phpinfo; ?>
It gives me an error and says that there is no such file or directory.
@justin3993: It sounds like you are using Ubuntu 12.04 If that’s the case, follow this article instead:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
It’s very similar, but there are a few differences including the different default page. Also, files should be saved to /var/www/ instead of /var/www/html
Hiii
i had install vm ware work station and nd installing red hat linux 6 but the moment when i power on some message is poping like this
" Software virtualization is incompatible with long mode on this platform. Disabling long mode. Without long mode support, the virtual machine will not be able to run 64 bit code. For more details see http://vmware.com/info?id=152."
And whem i m clicking ok on the dialouge box then again another message is poping ot like this "Unable to open kernel device “\.\VMCIDev\VMX”: Overlapped I/O operation is in progress. Did you reboot after installing VMware Workstation?
Module DevicePowerOn power on failed."
pls help me out if somebody knows i want to install redhat linux
i can’t write info.php
error writing /var/www/html/info.php no such directory
what should I do?
I got, it. Thank you, for your tutorial. :)
Great tutorial! Thanks.
What advantages do we have when installing the stack parts one by one? In other words: is there any reason we shouldn’t just use “sudo tasksel install lamp-server”?
Thanks in advance.
Note that mod_auth_mysql is deprecated in Apache 2.4. Use mod_dbm instead.
Thank you for this wonderful tutorial! This is one of the best getting-started guides on the web right now! :)
I have two virtual hosts on Ubuntu 14.04 LTS by following the tutorial here https://www.digitalocean.com/community/articles/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts
Is this going to make a difference on how to install the programs on this tutorial?
I got to step 4 and it is not verifying the php5.
So I updated and installed apache, but when I type the ip address in my browser to verify, I do not get the apache ubuntu default page like the tutorial shows.
All I get is:
"It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet."
I followed the steps very carefully so I do not understand what I did wrong… if anybody has any tips, that would be very much appreciated. Thanks.
I also cannot save the file <?php phpinfo; ?>
It gives me an error and says that there is no such file or directory.
@justin3993: It sounds like you are using Ubuntu 12.04 If that’s the case, follow this article instead:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
It’s very similar, but there are a few differences including the different default page. Also, files should be saved to /var/www/ instead of /var/www/html
Hiii
i had install vm ware work station and nd installing red hat linux 6 but the moment when i power on some message is poping like this
" Software virtualization is incompatible with long mode on this platform. Disabling long mode. Without long mode support, the virtual machine will not be able to run 64 bit code. For more details see http://vmware.com/info?id=152."
And whem i m clicking ok on the dialouge box then again another message is poping ot like this "Unable to open kernel device “\.\VMCIDev\VMX”: Overlapped I/O operation is in progress. Did you reboot after installing VMware Workstation?
Module DevicePowerOn power on failed."
pls help me out if somebody knows i want to install redhat linux
nice work (y) thank you :)
andy.vishwakarma: Hi Andy. Installing Red Hat Linux on a VMware Workstation is a bit off topic here, but you might want to check out: https://www.vmware.com/support/ws3/doc/ws32_guestos21.html
ok astarr thank u for support :-)
can any one can help " How fix this error what steps to follow to install Red Hat Linux on a vmware Workstation"
Hello everybody! I’m a new Ubuntu User, and I’m trying to install Wordpress on my computer using LAMP. At this moment I got problems identifying my IP address. When I put on the terminal this line, ip addr show eth0 | grep inet | awk ‘{ print $2; }’ | sed ‘s//.*$//’ my computer doesn’t do anything, so I tried the other way (curl http://icanhazip.com) which give me the number, yet on the Four step (http://your_server_IP_address/info.php) when I put it, my browser opens a page in which my modem ask me for a username and a password to log me in on the router. Any Help?
@manuel.fernando.camperos: Since you’re on a home computer behind a router, your external IP address will be the router. For testing on your local network, you’ll want your internal IP address. Maybe you’re on wifi so there’s no <code>eth0</code> ? What’s the output of <code>ip addr show</code> ?
thaks for tutorial. :) my web server apache working perfect now
Thanks so much for the detailed and step by step tutorial. One of the best tutorials i have ever read on this subject.
As another user said, libapache2-mod-auth-mysql is deprecated with versions of Apache >= 2.4. I’d suggest removing it from this article as it’s not needed unless you’re authenticating users with Apache against MySQL.
@amanda.folson: Thanks, I’ve fixed it.
Excellent docs! Every step worked as described!
Is the “LAMP on Ubuntu 14.04” option under applications / create droplet page, just an automated version of the steps above, or is there more to doing it step by step this way.
Just wanted to say that this was a great tutorial. Very thorough and I appreciate all of the options and extras that were explained.
I’ve tried a few times to set up a local development environment with no success. This tutorial got me through it all in about 20 minutes.
Cheers!
@hello: Yes, it’s just an automated version of this tutorial.
Justin,
I just wanted to say that I’ve used these instructions multiple times and they work perfectly each time. If you follow them, they work.
Also, this is typical of the help I’ve found on DigitalOcean. Not only is it a great place to get on the Cloud but they give great assistance too!
And no, I’m not affiliated with the company at all and yes, I did live through the problems on NYC2 these last couple of weeks.
Please keep up the good work!
Great tutorial! /hi-five
O.O
Sadly, at
Try looking up mysql password reset. I got a lot of useful troubleshooting from ubuntu’s website.
Very clearly written. Thanks.!
Thanks for this tutorial !
THANK YOU! EXCELLENT!
Hello,
Thank you for this tutorial. This is the first time i find a thorough tutorial for Linux. most tutorials assume that you know what they know. I followed the document through and all was great until the last stage where I need to test the PHP. When I try to reach the info.php file the browser shows nothing, just a blank page.
Any suggestions?
Thanks again.
hello,
at the beginning of step 2 after the command:
I get nothing of questions to fill in a password for the root user of the database and this is necessary because I have to fill in a password when I run:
What goes wrong?
This is soooooooo helpful. Thank you so much!
getting “invalid operation apache2” when putting in: sudo apt-get apache2
The command should be
In order to log into MySQL to secure it, we’ll need the current password for the root user. If you’ve just installed MySQL, and you haven’t set the root password yet, the password will be blank, so you should just press enter here.
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO) Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
I’ve tried pressing enter, and my root password, no luck… any help?
I was running into the same issue and was able to reset the MySQL root password with this tutorial, and then log in successfully: http://www.2daygeek.com/how-to-recover-mysql-root-password/.
Good stuff! I have a question.
At which point can we choose the Apache MPM, i.e. prefork, worker, or event?
I believe the default that comes with Ubuntu 14.04 is MPM Event, which would be excellent. However, I created a droplet from the Ubuntu 14.04 LAMP image, and now I see that it is configured for the old Prefork MPM.
I did try to disable Prefork, and enable Event, but when I restarted Apache, I got a configuration test error that my PHP module is not thread safe, and that it should be recompiled. How can I fix this?
Thanks!
Thanks for tutorial!
This comment has been deleted
Thank you. Good explain. But also you should explain to set up phpmyadmin in this title. Because all of visitors (me too) apply to your expression then asking to why phpmyadmin not working (Because nobody had not install phpmyadmin). if you want to explain install and set up phpmyadmin, you will know. :)
Seems to be a great tutorial… But
sudo apt-get update
itself is not working on my kernel…it says, failed to fetch http:// … could not resolve ‘mirrors.digitalocean.com’ … There are more lines in a similar way… Please help me out… Thanks…
Can you please post the full error? What are the contents of
/etc/resolv.conf
?Is your droplet connected to the internet? What’s the output of:
Hey @kamaln7 thanks. But, It got resolved… I raised a Ticket for support and they resolved it. Some internal issue I guess.
Really a great tutorial!
Combined with the tutorial about installing Wordpress, I was able to move my websites from a Windows 2003 server to an Ubuntu 14.04 server while changing the URL in the process.
Followed your instructions and now I have managed to install everything. Thanks!
Hello,
I am going to be using php to be creating mysql databases and manipulating the tables in there. Do i need to install any of the additional modules suggested.
I am quite new at this and help/advice is most welcome.
Thanks.
MY LAMP is up and running.
Bravo!! Great tutorial! .This is the first tutorial that I can complete all the step without fault.
One line installation…
sudo apt-get install lamp-server^
And you’re done!
Awesome Tutorial!!! ^_^
everything seems to be working ok but after I create the test php script and issue this command all I get is a blank page: http://your_server_IP_address/info.php does anyone know what the problem may be? thanks
Brilliant tutorial, thanks so much for creating and sharing it!
Anyone looking to automate the step where you modify the Apache config to prioritize
index.php
overindex.html
can use this command:Hi peepz, anybody here can help me install PHP 5.3.2 in my Ubuntu 14.04 ? This tutrorial install PHP 5.5.9 and it’s not what I need right now. Thanks in advance!!!
(( * Restarting web server apache2
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message)) what does that mean?
My installation of apache2 is incomplete, and after a lot of googling, purging, and reinstalling I am still in the same place. During installation my console prints
Setting up apache2 (2.4.7-1ubuntu4.1) … Enabling module mpm_event. cp: cannot stat ‘/usr/share/apache2/default-site/index.html’: No such file or directory dpkg: error processing package apache2 (–configure): subprocess installed post-installation script returned error exit status 1 Processing triggers for ureadahead (0.100.0-16) … Processing triggers for ufw (0.34~rc-0ubuntu2) … Errors were encountered while processing: apache2 E: Sub-process /usr/bin/dpkg returned an error code (1) imperialsoup@imperialsoup:~$
Any help with this would be deeply appreciated, I’d like to get this install over with so I can continue with the tutorial.
Thanks sir… Amazing Tutorial I followed everything and now I can manage my web server on ubuntu server and running smoothly…
Hi, everyone,
If you can’t install mysql-core because of a dpkg error that causes an error code 1 - "dpkg: dependency problems prevent configuration of mysql-server-5.5: - try this fix, from here:
http://askubuntu.com/questions/550742/problems-installing-mysql-on-ubuntu-14-04
It worked for me. Here are his instructions:
1.Make sure mysql is entirely removed/purged a) sudo apt-get remove --purge mysql-server mysql-client mysql-common b) sudo apt-get remove --purge mysql-server-5.5 mysql-client-5.5 mysql-server-core-5.5 mysql-client-core-5.5 c) sudo apt-get autoremove d) sudo apt-get autoclean e) sudo rm -rf /var/lib/mysql f) sudo rm -rf /etc/mysql g) sudo deluser mysql
2.sudo apt-get dist-upgrade
3.sudo reboot
[And then continue on to installing php…]
Simple informative and does the job. Sometimes you just need to get the packages installed first and worry about technical details afterwards.
amazing. Thanks man.
To confirm that modphp was working correctly, I had to reformat the info.php file into a one-liner
<?php phpinfo(); ?>
As three lines my screen was blank.
Thanks for a great tutorial!
Great tutorial. Thank you for the easy to follow instructions.
With Ubuntu 14.04 after installing Apache you may get the error message: “AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. Set the ‘ServerName’ directive globally to suppress this message”
If so edit this file: /etc/apache2/apache2.conf (sudo nano /etc/apache2/apache2.conf) and at the bottom of the file insert this “ServerName localhost” (without the quotes). Save the file, restart Apache (service apache2 restart) and the error message should be gone.
Thats what worked for me.
You forgot a little step to enable mcrypt:
at least, I needed to do it.