LAMP instalation on Ubuntu quick command info

Enter command in order from top to bottom to get everything installed 😉
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

sudo nano /etc/apache2/mods-enabled/dir.conf

Add index.php to the beginning of index files. The page should now look like this:

DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm

PHP Modules

PHP also has a variety of useful libraries and modules that you can add onto your virtual server. You can see the libraries that are available.

apt-cache search php5-

Once you decide to install the module, type:

sudo apt-get install name of the module

To set this up, first create a new file:

sudo nano /var/www/info.php

Add in the following line:

Then Save and Exit.

Restart apache so that all of the changes take effect:

sudo service apache2 restart

sudo nano /etc/hosts Change the file to read: 127.0.0.1 localhost ‘IP’ ‘server name’ ‘hostname’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s