How to install Apache on Ubuntu (all versions) the following command will only install Apache not PHP & MySQL as well which are commonly referred to as “LAMP” (Linux Apache MySQL & PHP). If you require a full LAMP setup on Ubuntu please follow our Ubuntu Install LAMP guide.
Install Apache on Ubuntu by running the following command:
apt-get install apache2
Which should give you a similar output to:
Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert Suggested packages: apache2-doc apache2-suexec apache2-suexec-custom The following NEW packages will be installed apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert 0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 3,491kB of archives. After this operation, 11.5MB of additional disk space will be used. Do you want to continue [Y/n]?
Ubuntu Start Apache
After install Apache on Ubuntu you can start it with the following command:
/etc/init.d/apache2 start
Which should give you the following console output:
* Starting web server apache2
Providing you don’t have a firewall in place you should now be able to view the Apache test page by typing in your servers IP address in a web browser.