How to Install & Configure LAMP Server On Ubuntu 14.04
Step: 1. Bind Hosts File :
# vi /etc/hosts
192.168.1.250 ser1.domain.com ser1
-- Save & Quit (:wq)
Step: 2. Install Apache2 Server :
# apt-get update
# apt-get -y install apache2 apache2-utils
<<<<<<How to Find your Server’s IP address>>>>>
# ifconfig eth0 | grep inet | awk '{ print $2 }'
Step: 3. Install MySQL Server :
# apt-get -y install mysql-server libapache2-mod-auth-mysql
Note: Once you have installed MySQL, we should activate it with this command :
# mysql_install_db
Step: 4. Set MySQL Root Password :
# mysql_secure_installation
# service mysql restart
Step: 5. Install PHP 5.5 :
# apt-get -y install php5 php5-dev libapache2-mod-php5 php5-mcrypt php5-mysql php5-cli \
php5-common php5-curl php5-gd php5-imap php5-imagick php5-intl php5-ldap \
php5-memcache php5-memcached php5-snmp php5-xcache php5-xmlrpc
# vi /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
-- Save & Quit (:wq)
Step: 6. Search PHP Modules (Optional) :
# apt-cache search php5-
# apt-get -y install php5-json
Step: 7. See PHP on your Server :
# vi /var/www/html/info.php
<?php
phpinfo();
?>
-- Save & Quit (:wq)
http://ip_address/info.php
Or
# php -v
Step: 8. Download & Install phpMyAdmin (To Access MySQL Server Graphically) :
# cd /var/www/html
# wget http://jaist.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.10/phpMyAdmin-4.0.10-english.tar.gz
# tar -zxvf phpMyAdmin-4.0.10-english.tar.gz
# mv phpMyAdmin-4.0.10-english pma
# rm -rf phpMyAdmin-4.0.10-english.tar.gz
# cd pma/
# mv config.sample.inc.php config.inc.php
# service apache2 restart
# service mysql restart
Step: 9. Configure phpMyAdmin with MD5 Password Protected :
# vi /etc/apache2/sites-available/pma.domain.com.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/pma
ServerName pma.anything.com
# ServerAlias www.pma.domain.com
# Authorize for setup
<Directory /var/www/html/pma/setup>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /home/secure/.htpasswd
</IfModule>
Require valid-user
</Directory>
<Directory /var/www/html/pma>
Options All Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
-- Save & Quit (:wq)
# mkdir /home/secure/
# htpasswd -c /home/secure/.htpasswd pmaadmin
# cd /etc/apache2/sites-enabled/
# ln -s /etc/apache2/sites-available/pma.domain.com.conf pma.domain.com.conf
Or
# a2ensite pma.domain.com
# service apache2 restart
http://pma.domain.com
Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog
0 comments:
Post a Comment