LAMP (Linux, Apache, Mysql, PHP) is the group of open source software used to make a webserver.
Installation APACHE
Step 1
sudo apt-get update
Output:
root@tutorialspots:~# sudo apt-get update Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B] Get:2 http://security.ubuntu.com precise-security Release [54.3 kB] Get:3 http://security.ubuntu.com precise-security/main amd64 Packages [554 kB] Get:4 http://security.ubuntu.com precise-security/restricted amd64 Packages [11. 6 kB] Get:5 http://security.ubuntu.com precise-security/universe amd64 Packages [125 k B] Get:6 http://security.ubuntu.com precise-security/multiverse amd64 Packages [268 2 B] Get:7 http://security.ubuntu.com precise-security/main i386 Packages [611 kB] Get:8 http://archive.canonical.com precise Release.gpg [198 B] Get:9 http://archive.canonical.com precise Release [8180 B] Get:10 http://security.ubuntu.com precise-security/restricted i386 Packages [11. 6 kB] Get:11 http://security.ubuntu.com precise-security/universe i386 Packages [133 k B] Get:12 http://security.ubuntu.com precise-security/multiverse i386 Packages [287 8 B] Get:13 http://security.ubuntu.com precise-security/main TranslationIndex [208 B] Get:14 http://security.ubuntu.com precise-security/multiverse TranslationIndex [ 199 B] Get:15 http://security.ubuntu.com precise-security/restricted TranslationIndex [ 202 B] Get:16 http://security.ubuntu.com precise-security/universe TranslationIndex [20 5 B] Get:17 http://archive.canonical.com precise/partner amd64 Packages [7034 B] Get:18 http://security.ubuntu.com precise-security/main Translation-en [240 kB] Get:19 http://archive.canonical.com precise/partner i386 Packages [7887 B] Ign http://archive.canonical.com precise/partner TranslationIndex Get:20 http://security.ubuntu.com precise-security/multiverse Translation-en [14 08 B] Get:21 http://security.ubuntu.com precise-security/restricted Translation-en [29 79 B] Get:22 http://security.ubuntu.com precise-security/universe Translation-en [79.8 kB] Get:23 http://archive.ubuntu.com precise Release.gpg [198 B] Get:24 http://archive.ubuntu.com precise-updates Release.gpg [198 B] Get:25 http://archive.ubuntu.com precise Release [49.6 kB] Ign http://archive.canonical.com precise/partner Translation-en Get:26 http://archive.ubuntu.com precise-updates Release [196 kB] Get:27 http://archive.ubuntu.com precise/main amd64 Packages [1273 kB] Get:28 http://archive.ubuntu.com precise/restricted amd64 Packages [8452 B] Get:29 http://archive.ubuntu.com precise/universe amd64 Packages [4786 kB] Get:30 http://archive.ubuntu.com precise/main i386 Packages [1274 kB] Get:31 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B] Get:32 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB] Get:33 http://archive.ubuntu.com precise/main TranslationIndex [3706 B] Get:34 http://archive.ubuntu.com precise/restricted TranslationIndex [2596 B] Get:35 http://archive.ubuntu.com precise/universe TranslationIndex [2922 B] Get:36 http://archive.ubuntu.com precise-updates/main amd64 Packages [944 kB] Get:37 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [16.1 kB] Get:38 http://archive.ubuntu.com precise-updates/universe amd64 Packages [270 kB ] Get:39 http://archive.ubuntu.com precise-updates/main i386 Packages [995 kB] Get:40 http://archive.ubuntu.com precise-updates/restricted i386 Packages [16.1 kB] Get:41 http://archive.ubuntu.com precise-updates/universe i386 Packages [279 kB] Get:42 http://archive.ubuntu.com precise-updates/main TranslationIndex [10.6 kB] Get:43 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [72 97 B] Get:44 http://archive.ubuntu.com precise-updates/universe TranslationIndex [8333 B] Get:45 http://archive.ubuntu.com precise/main Translation-en [726 kB] Get:46 http://archive.ubuntu.com precise/restricted Translation-en [2395 B] Get:47 http://archive.ubuntu.com precise/universe Translation-en [3341 kB] Get:48 http://archive.ubuntu.com precise-updates/main Translation-en [407 kB] Get:49 http://archive.ubuntu.com precise-updates/restricted Translation-en [3857 B] Get:50 http://archive.ubuntu.com precise-updates/universe Translation-en [162 kB ] Fetched 21.4 MB in 5s (3618 kB/s) Reading package lists... Done
Step 2
sudo apt-get install apache2
Output:
root@tutorialspots:~# sudo apt-get install apache2 Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: apache2-mpm-worker apache2.2-bin apache2.2-common Suggested packages: apache2-suexec apache2-suexec-custom ufw The following packages will be REMOVED: apache2-mpm-prefork The following NEW packages will be installed: apache2-mpm-worker The following packages will be upgraded: apache2 apache2.2-bin apache2.2-common 3 upgraded, 1 newly installed, 1 to remove and 42 not upgraded. Need to get 1573 kB of archives. After this operation, 6144 B of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main apache2 amd64 2.2.2 2-1ubuntu1.10 [1498 B] Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main apache2.2-common am d64 2.2.22-1ubuntu1.10 [226 kB] Get:3 http://archive.ubuntu.com/ubuntu/ precise-updates/main apache2.2-bin amd64 2.2.22-1ubuntu1.10 [1343 kB] Get:4 http://archive.ubuntu.com/ubuntu/ precise-updates/main apache2-mpm-worker amd64 2.2.22-1ubuntu1.10 [2306 B] Fetched 1573 kB in 0s (2711 kB/s) (Reading database ... 22527 files and directories currently installed.) Preparing to replace apache2 2.2.22-1ubuntu1.8 (using .../apache2_2.2.22-1ubuntu 1.10_amd64.deb) ... Unpacking replacement apache2 ... (Reading database ... 22525 files and directories currently installed.) Removing apache2-mpm-prefork ... * Stopping web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 176.31.75.56 for ServerName ... waiting [ OK ] (Reading database ... 22522 files and directories currently installed.) Preparing to replace apache2.2-common 2.2.22-1ubuntu1.8 (using .../apache2.2-com mon_2.2.22-1ubuntu1.10_amd64.deb) ... Unpacking replacement apache2.2-common ... Preparing to replace apache2.2-bin 2.2.22-1ubuntu1.8 (using .../apache2.2-bin_2. 2.22-1ubuntu1.10_amd64.deb) ... Unpacking replacement apache2.2-bin ... Selecting previously unselected package apache2-mpm-worker. Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.22-1ubuntu1.10_amd 64.deb) ... Processing triggers for man-db ... Setting up apache2.2-bin (2.2.22-1ubuntu1.10) ... Setting up apache2.2-common (2.2.22-1ubuntu1.10) ... Setting up apache2-mpm-worker (2.2.22-1ubuntu1.10) ... * Starting web server apache2 WARNING: MaxClients (10) must be at least as large as ThreadsPerChild (25). Automatically increasing MaxClients to 25. apache2: Could not reliably determine the server's fully qualified domain name, using 176.31.75.56 for ServerName [ OK ] Setting up apache2 (2.2.22-1ubuntu1.10) ...
Now, you can access your server’s IP address: http://xx.xx.xx.xx/
It works! This is the default web page for this server. The web server software is running but no content has been added, yet.
Install MYSQL
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Output
root@tutorialspots:~# sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-my sql Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 php5-common php5-fpm Suggested packages: libipc-sharedcache-perl tinyca php5-suhosin php-pear The following NEW packages will be installed: libapache2-mod-auth-mysql libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 php5-common php5-fpm php5-mysql 0 upgraded, 17 newly installed, 0 to remove and 42 not upgraded. Need to get 32.3 MB of archives. After this operation, 109 MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-common all 5. 5.46-0ubuntu0.12.04.2 [12.8 kB] Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main libmysqlclient18 am d64 5.5.46-0ubuntu0.12.04.2 [947 kB] Get:3 http://archive.ubuntu.com/ubuntu/ precise/main libnet-daemon-perl all 0.48 -1 [43.1 kB] Get:4 http://archive.ubuntu.com/ubuntu/ precise/main libplrpc-perl all 0.2020-2 [36.0 kB] Get:5 http://archive.ubuntu.com/ubuntu/ precise/main libdbi-perl amd64 1.616-1bu ild2 [849 kB] Get:6 http://archive.ubuntu.com/ubuntu/ precise/main libdbd-mysql-perl amd64 4.0 20-1build2 [106 kB] Get:7 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-client-core-5 .5 amd64 5.5.46-0ubuntu0.12.04.2 [1945 kB] Get:8 http://archive.ubuntu.com/ubuntu/ precise/main libterm-readkey-perl amd64 2.30-4build3 [28.6 kB] Get:9 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-client-5.5 am d64 5.5.46-0ubuntu0.12.04.2 [8358 kB] Get:10 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server-core- 5.5 amd64 5.5.46-0ubuntu0.12.04.2 [6113 kB] Get:11 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server-5.5 a md64 5.5.46-0ubuntu0.12.04.2 [8850 kB] Get:12 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5-common amd64 5.3.10-1ubuntu3.21 [1776 kB] Get:13 http://archive.ubuntu.com/ubuntu/ precise-updates/universe php5-fpm amd64 5.3.10-1ubuntu3.21 [3096 kB] Get:14 http://archive.ubuntu.com/ubuntu/ precise/main libapache2-mod-auth-mysql amd64 4.3.9-13ubuntu3 [22.9 kB] Get:15 http://archive.ubuntu.com/ubuntu/ precise/main libhtml-template-perl all 2.10-1 [65.0 kB] Get:16 http://archive.ubuntu.com/ubuntu/ precise-updates/main mysql-server all 5 .5.46-0ubuntu0.12.04.2 [11.0 kB] Get:17 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5-mysql amd64 5 .3.10-1ubuntu3.21 [76.6 kB] Fetched 32.3 MB in 1s (21.0 MB/s) Preconfiguring packages ... Selecting previously unselected package mysql-common. (Reading database ... 22527 files and directories currently installed.) Unpacking mysql-common (from .../mysql-common_5.5.46-0ubuntu0.12.04.2_all.deb) . .. Selecting previously unselected package libmysqlclient18. Unpacking libmysqlclient18 (from .../libmysqlclient18_5.5.46-0ubuntu0.12.04.2_am d64.deb) ... Selecting previously unselected package libnet-daemon-perl. Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.48-1_all.deb) ... Selecting previously unselected package libplrpc-perl. Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ... Selecting previously unselected package libdbi-perl. Unpacking libdbi-perl (from .../libdbi-perl_1.616-1build2_amd64.deb) ... Selecting previously unselected package libdbd-mysql-perl. Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.020-1build2_amd64.deb) ... Selecting previously unselected package mysql-client-core-5.5. Unpacking mysql-client-core-5.5 (from .../mysql-client-core-5.5_5.5.46-0ubuntu0. 12.04.2_amd64.deb) ... Selecting previously unselected package libterm-readkey-perl. Unpacking libterm-readkey-perl (from .../libterm-readkey-perl_2.30-4build3_amd64 .deb) ... Selecting previously unselected package mysql-client-5.5. Unpacking mysql-client-5.5 (from .../mysql-client-5.5_5.5.46-0ubuntu0.12.04.2_am d64.deb) ... Selecting previously unselected package mysql-server-core-5.5. Unpacking mysql-server-core-5.5 (from .../mysql-server-core-5.5_5.5.46-0ubuntu0. 12.04.2_amd64.deb) ... Processing triggers for man-db ... Setting up mysql-common (5.5.46-0ubuntu0.12.04.2) ... Selecting previously unselected package mysql-server-5.5. (Reading database ... 22905 files and directories currently installed.) Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.46-0ubuntu0.12.04.2_am d64.deb) ... Selecting previously unselected package php5-common. Unpacking php5-common (from .../php5-common_5.3.10-1ubuntu3.21_amd64.deb) ... Selecting previously unselected package php5-fpm. Unpacking php5-fpm (from .../php5-fpm_5.3.10-1ubuntu3.21_amd64.deb) ... Selecting previously unselected package libapache2-mod-auth-mysql. Unpacking libapache2-mod-auth-mysql (from .../libapache2-mod-auth-mysql_4.3.9-13 ubuntu3_amd64.deb) ... Selecting previously unselected package libhtml-template-perl. Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.10-1_all.deb) ... Selecting previously unselected package mysql-server. Unpacking mysql-server (from .../mysql-server_5.5.46-0ubuntu0.12.04.2_all.deb) . .. Selecting previously unselected package php5-mysql. Unpacking php5-mysql (from .../php5-mysql_5.3.10-1ubuntu3.21_amd64.deb) ... Processing triggers for man-db ... Setting up libmysqlclient18 (5.5.46-0ubuntu0.12.04.2) ... Setting up libnet-daemon-perl (0.48-1) ... Setting up libplrpc-perl (0.2020-2) ... Setting up libdbi-perl (1.616-1build2) ... Setting up libdbd-mysql-perl (4.020-1build2) ... Setting up mysql-client-core-5.5 (5.5.46-0ubuntu0.12.04.2) ... Setting up libterm-readkey-perl (2.30-4build3) ... Setting up mysql-client-5.5 (5.5.46-0ubuntu0.12.04.2) ... Setting up mysql-server-core-5.5 (5.5.46-0ubuntu0.12.04.2) ... Setting up mysql-server-5.5 (5.5.46-0ubuntu0.12.04.2) ... 151103 22:25:39 [Warning] Using unique option prefix key_buffer instead of key_b uffer_size is deprecated and will be removed in a future release. Please use the full name instead. 151103 22:25:39 [Note] /usr/sbin/mysqld (mysqld 5.5.46-0ubuntu0.12.04.2) startin g as process 2969 ... mysql start/running, process 3106 Setting up php5-common (5.3.10-1ubuntu3.21) ... Setting up php5-fpm (5.3.10-1ubuntu3.21) ... update-rc.d: warning: php5-fpm stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (none) Creating config file /etc/php5/fpm/php.ini with new version Setting up libapache2-mod-auth-mysql (4.3.9-13ubuntu3) ... Setting up libhtml-template-perl (2.10-1) ... Setting up mysql-server (5.5.46-0ubuntu0.12.04.2) ... Setting up php5-mysql (5.3.10-1ubuntu3.21) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
Install PHP
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
You type “y” and PHP will be installed.
Output sample:
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main apache2-mpm-prefork Get:2 http://archive.ubuntu.com/ubuntu/ precise-updates/main libapache2-mod-php5 Get:3 http://archive.ubuntu.com/ubuntu/ precise/universe libmcrypt4 amd64 2.5.8- Get:4 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5 all 5.3.10-1ub Get:5 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5-cli amd64 5.3. Get:6 http://archive.ubuntu.com/ubuntu/ precise/universe php5-mcrypt amd64 5.3.5 dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you reques apache2 depends on apache2-mpm-worker (= 2.2.22-1ubuntu1.10) | apache2-mpm-pref ork (= 2.2.22-1ubuntu1.10) | apache2-mpm-event (= 2.2.22-1ubuntu1.10) | apache2- * Stopping web server apache2 directories currently installed.) apache2: Could not reliably determine the server's fully qualified domain name, Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.22-1ubuntu1.10_a * Starting web server apache2 2-1ubuntu1.10) ... apache2: Could not reliably determine the server's fully qualified domain name, Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.3.10-1ubuntu3.21_a * Restarting web server apache2 php.ini with new version4.deb) ... apache2: Could not reliably determine the server's fully qualified domain name, ... waiting apache2: Could not reliably determine the server's fully qualified update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto m
Install PHP’s modules
You can see all of modules by the following command:
apt-cache search php5-
root@lxd1:~# apt-cache search php5- 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 php5-gmp - GMP module for php5 php5-ldap - LDAP module for php5 php5-mysql - MySQL module for php5 php5-odbc - ODBC module for php5 php5-pgsql - PostgreSQL module for php5 php5-pspell - pspell module for php5 php5-recode - recode module for php5 php5-snmp - SNMP module for php5 php5-sqlite - SQLite module for php5 php5-tidy - tidy module for php5 php5-xmlrpc - XML-RPC module for php5 php5-xsl - XSL module for php5 php5-adodb - Extension optimising the ADOdb database abstraction library php5-auth-pam - A PHP5 extension for PAM authentication php5-enchant - Enchant module for php5 php5-exactimage - fast image manipulation library (PHP bindings) php5-ffmpeg - audio and video support via ffmpeg for php5 php5-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary) php5-geoip - GeoIP module for php5 php5-imagick - ImageMagick module for php5 php5-imap - IMAP module for php5 php5-interbase - interbase/firebird module for php5 php5-intl - internationalisation module for php5 php5-lasso - Library for Liberty Alliance and SAML protocols - PHP 5 bindings php5-librdf - PHP5 language bindings for the Redland RDF library php5-mapscript - php5-cgi module for MapServer php5-mcrypt - MCrypt module for php5 php5-memcache - memcache extension module for PHP5 php5-memcached - memcached extension module for PHP5, uses libmemcached php5-midgard2 - Midgard2 Content Repository - PHP5 language bindings and module php5-ming - Ming module for php5 php5-mysqlnd - MySQL module for php5 (Native Driver) php5-ps - ps module for PHP 5 php5-radius - PECL radius module for PHP 5 php5-remctl - PECL module for Kerberos-authenticated command execution php5-rrd - rrd module for PHP 5 php5-sasl - Cyrus SASL extension for PHP 5 php5-suhosin - advanced protection module for php5 php5-svn - PHP Bindings for the Subversion Revision control system php5-sybase - Sybase / MS SQL Server module for php5 php5-tokyo-tyrant - PHP interface to Tokyo Cabinet's network interface, Tokyo Ty rant php5-uuid - OSSP uuid module for php5 php5-xcache - Fast, stable PHP opcode cacher php5-xdebug - Xdebug Module for PHP 5
You can install the modules you need by using the follow command:
sudo apt-get install list name of the modules
list name of the modules reparated by a space
Example:
sudo apt-get install php5-curl php5-gd php5-adodb php5-mcrypt
Output:
root@lxd1:~# sudo apt-get install php5-curl php5-gd php5-adodb php5-mcrypt Reading package lists... Done Building dependency tree Reading state information... Done php5-mcrypt is already the newest version. The following extra packages will be installed: libcurl3 libgd2-xpm libjpeg-turbo8 libjpeg8 librtmp0 libt1-5 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 Suggested packages: libgd-tools The following NEW packages will be installed: libcurl3 libgd2-xpm libjpeg-turbo8 libjpeg8 librtmp0 libt1-5 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 php5-adodb php5-curl php5-gd 0 upgraded, 15 newly installed, 0 to remove and 42 not upgraded. Need to get 1883 kB of archives. After this operation, 5956 kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://archive.ubuntu.com/ubuntu/ precise/main librtmp0 amd64 2.4~20110711 .gitc28f1bab-1 [57.1 kB] Get:2 http://archive.ubuntu.com/ubuntu/ precise/main libxau6 amd64 1:1.0.6-4 [83 92 B] Get:3 http://archive.ubuntu.com/ubuntu/ precise/main libxdmcp6 amd64 1:1.1.0-4 [ 12.7 kB] Get:4 http://archive.ubuntu.com/ubuntu/ precise-updates/main libxcb1 amd64 1.8.1 -1ubuntu0.2 [44.8 kB] Get:5 http://archive.ubuntu.com/ubuntu/ precise-updates/main libx11-data all 2:1 .4.99.1-0ubuntu2.3 [171 kB] Get:6 http://archive.ubuntu.com/ubuntu/ precise-updates/main libx11-6 amd64 2:1. 4.99.1-0ubuntu2.3 [764 kB] Get:7 http://archive.ubuntu.com/ubuntu/ precise-updates/main libcurl3 amd64 7.22 .0-3ubuntu4.14 [236 kB] Get:8 http://archive.ubuntu.com/ubuntu/ precise-updates/main libjpeg-turbo8 amd6 4 1.1.90+svn733-0ubuntu4.4 [112 kB] Get:9 http://archive.ubuntu.com/ubuntu/ precise/main libjpeg8 amd64 8c-2ubuntu7 [2112 B] Get:10 http://archive.ubuntu.com/ubuntu/ precise/main libxpm4 amd64 1:3.5.9-4 [3 7.0 kB] Get:11 http://archive.ubuntu.com/ubuntu/ precise/main libgd2-xpm amd64 2.0.36~rc 1~dfsg-6ubuntu2 [202 kB] Get:12 http://archive.ubuntu.com/ubuntu/ precise/main libt1-5 amd64 5.1.2-3.4ubu ntu1 [158 kB] Get:13 http://archive.ubuntu.com/ubuntu/ precise/universe php5-adodb amd64 5.04- 6 [10.4 kB] Get:14 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5-curl amd64 5. 3.10-1ubuntu3.21 [28.1 kB] Get:15 http://archive.ubuntu.com/ubuntu/ precise-updates/main php5-gd amd64 5.3. 10-1ubuntu3.21 [38.9 kB] Fetched 1883 kB in 0s (2849 kB/s) Selecting previously unselected package librtmp0. (Reading database ... 23087 files and directories currently installed.) Unpacking librtmp0 (from .../librtmp0_2.4~20110711.gitc28f1bab-1_amd64.deb) ... Selecting previously unselected package libxau6. Unpacking libxau6 (from .../libxau6_1%3a1.0.6-4_amd64.deb) ... Selecting previously unselected package libxdmcp6. Unpacking libxdmcp6 (from .../libxdmcp6_1%3a1.1.0-4_amd64.deb) ... Selecting previously unselected package libxcb1. Unpacking libxcb1 (from .../libxcb1_1.8.1-1ubuntu0.2_amd64.deb) ... Selecting previously unselected package libx11-data. Unpacking libx11-data (from .../libx11-data_2%3a1.4.99.1-0ubuntu2.3_all.deb) ... Selecting previously unselected package libx11-6. Unpacking libx11-6 (from .../libx11-6_2%3a1.4.99.1-0ubuntu2.3_amd64.deb) ... Selecting previously unselected package libcurl3. Unpacking libcurl3 (from .../libcurl3_7.22.0-3ubuntu4.14_amd64.deb) ... Selecting previously unselected package libjpeg-turbo8. Unpacking libjpeg-turbo8 (from .../libjpeg-turbo8_1.1.90+svn733-0ubuntu4.4_amd64 .deb) ... Selecting previously unselected package libjpeg8. Unpacking libjpeg8 (from .../libjpeg8_8c-2ubuntu7_amd64.deb) ... Selecting previously unselected package libxpm4. Unpacking libxpm4 (from .../libxpm4_1%3a3.5.9-4_amd64.deb) ... Selecting previously unselected package libgd2-xpm. Unpacking libgd2-xpm (from .../libgd2-xpm_2.0.36~rc1~dfsg-6ubuntu2_amd64.deb) .. . Selecting previously unselected package libt1-5. Unpacking libt1-5 (from .../libt1-5_5.1.2-3.4ubuntu1_amd64.deb) ... Selecting previously unselected package php5-adodb. Unpacking php5-adodb (from .../php5-adodb_5.04-6_amd64.deb) ... Selecting previously unselected package php5-curl. Unpacking php5-curl (from .../php5-curl_5.3.10-1ubuntu3.21_amd64.deb) ... Selecting previously unselected package php5-gd. Unpacking php5-gd (from .../php5-gd_5.3.10-1ubuntu3.21_amd64.deb) ... Processing triggers for man-db ... Processing triggers for libapache2-mod-php5 ... * Reloading web server config apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 176.31.75.56 for ServerName [ OK ] Setting up librtmp0 (2.4~20110711.gitc28f1bab-1) ... Setting up libxau6 (1:1.0.6-4) ... Setting up libxdmcp6 (1:1.1.0-4) ... Setting up libxcb1 (1.8.1-1ubuntu0.2) ... Setting up libx11-data (2:1.4.99.1-0ubuntu2.3) ... Setting up libx11-6 (2:1.4.99.1-0ubuntu2.3) ... Setting up libcurl3 (7.22.0-3ubuntu4.14) ... Setting up libjpeg-turbo8 (1.1.90+svn733-0ubuntu4.4) ... Setting up libjpeg8 (8c-2ubuntu7) ... Setting up libxpm4 (1:3.5.9-4) ... Setting up libgd2-xpm (2.0.36~rc1~dfsg-6ubuntu2) ... Setting up libt1-5 (5.1.2-3.4ubuntu1) ... Setting up php5-adodb (5.04-6) ... Setting up php5-curl (5.3.10-1ubuntu3.21) ... Setting up php5-gd (5.3.10-1ubuntu3.21) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place
Restart Apache2 service to take effect. Done!
service apache2 restart
Now, you have a LAMP stack on your server with root dir: /var/www
You can create a PHP file to test
sudo vi /var/www/phpinfo.php
type i
type
<?php phpinfo(); ?>
esc
type :w
enter
Goto the address to test your server: http://xx.xx.xx.xx/phpinfo.php
PHP Version 5.3.10-1ubuntu3.21