Install Apache on Debian based Linux

Install, configure and use
Apache, PHP, MySQL
on Linux and Windows.
 

Install Apache on Debian based Linux


Attention! To install Apache form your Linux distributions you must have root access privilidges and connection to the Internet (preferable) or your Linux distribution DVD disk.
This page shows you how to install Apache Web Server on Ubuntu / Debian Linux (DEB based ditsros).
First of all you need to run a terminal and become root. In most of distributions you can simply do su command like this:
username@box ~ $ su
In Ubuntu Linux or any other Linux with reasonable sense of deafault seurity settings you might what to do sudo su instead of su.
username@box ~ $ sudo su
Now you should enter you root password and be very carefull, because starting from this point you are running all commands as root.
Now if you do not have two options: install from your Linux distribution DVD or directly from Internet. Instaling from Internet is a preferable option, because there are very high chancies that DVD version is relativley old and Internet version has new version of the application. If you still want to use your DVD as an installation source, then you need to putt it into DVD drive.
New you need to update system application source database to make sure that you will get Apaceh from the erigth source. It is done by
apt-get update
command. After running the command you should see somthing similar on the display:
username@boxname ~ $ apt-get update
Get: 1 http://security.ubuntu.com dapper-security Release.gpg [191B]
Hit http://security.ubuntu.com dapper-security Release
Get: 2 http://archive.ubuntu.com dapper Release.gpg [189B]
Get: 3 http://archive.ubuntu.com dapper-updates Release.gpg [191B]
Hit http://archive.ubuntu.com dapper Release
Hit http://archive.ubuntu.com dapper-updates Release
Get: 4 http://archive.canonical.com dapper-commercial Release.gpg [191B]
Hit http://archive.canonical.com dapper-commercial Release
Hit http://security.ubuntu.com dapper-security/main Packages
Hit http://security.ubuntu.com dapper-security/restricted Packages
Hit http://security.ubuntu.com dapper-security/main Sources
Hit http://archive.ubuntu.com dapper/main Packages
Hit http://archive.ubuntu.com dapper/restricted Packages
Hit http://archive.ubuntu.com dapper/main Sources
Hit http://security.ubuntu.com dapper-security/restricted Sources
Hit http://archive.ubuntu.com dapper/restricted Sources
Hit http://archive.ubuntu.com dapper-updates/main Packages
Get: 5 http://archive.ubuntu.com dapper-updates/restricted Packages [14B]
Hit http://archive.ubuntu.com dapper-updates/main Sources
Get: 6 http://archive.ubuntu.com dapper-updates/restricted Sources [14B]
Hit http://archive.canonical.com dapper-commercial/main Packages
Fetched 32B in 0s (35B/s)
Reading package lists... Done
username@boxname ~ $
The URLs and data got (downloaded) may vary from system to system.
Now your system is ready tfor Apache installation. All that you need to now is runing the follwing command:
apt-get install apache
. You will some the response similar to this one:
username@boxname ~ $ apt-get install apache
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
apache-common apache2-utils libapr0
Suggested packages:
apache-doc apache-ssl apache-perl
The following NEW packages will be installed
apache apache-common apache2-utils libapr0
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 1445kB of archives.
After unpacking 4473kB of additional disk space will be used.
Do you want to continue [Y/n]?
You need to agree by pressing "y" to continue with installation.
Please, wait until installation would be completed. As soon as you will receive command promt back you can start using Apache. It is installed, up and running. It is configured to server defaults web site, which is useless excpet testing that Apache is actually running.
To test it, fire up your local browser and type
http://localhost
in address bar. You should see apache deafult welcome site running on your box.
Now you can leave root account by
exit
command.