install apache

Upload: alaberht

Post on 05-Oct-2015

13 views

Category:

Documents


0 download

DESCRIPTION

Install Apache

TRANSCRIPT

  • How to Install LAMP in Ubuntu Server 14.04 LTSBy ubuntucontrib On June 10, 2014

    Home1. How To2.

    How to Install LAMP in Ubuntu Server 14.04 LTS

    This tutorial will explains basic step how to install LAMP (Linux, Apache, MySQL,PHP or Perl) server in ubuntu server 14.04 LTS. The acronym LAMP is derived fromrst letters of Linux, Apache HTTP Server, MySQL, and PHP/Perl/Python.

    Linux is a Unix-like and POSIX-compliant operating system. Ubuntu Server isone of popular Linux distributions dedicated for server environment.Apache is a HTTP web server, the most popular in use. It serves webpageswhen theyre requested by the web browsers. When you type an URL on yourweb server and press Enter, the pages you see on screen is most likely servedby Apache webserver.MySQL is a database management system now owned by Oracle Corporation.It stores and organizes references to the information the webserver needs.PHP is a reective programming language, which makes it possible for allthese dierent parts to work together.

    This tutorial assumes that you have already installed Ubuntu Server 14.04 correctlyin you machine, if you need guide basic install ubuntu server 14.04 you can readhere.

    Install and Congure Apache2First, update ubuntu repository with the following command :sudo apt-get update

    Install Apache2 and all related dependencies with these command:

    Home How To News

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    1 di 11 04/02/2015 14:05

  • sudo apt-get install apache2 apache2-utils

    Once apache2 installed, modify le /etc/apache2/mods-enabled/dir.conf, with yourfavorite editor. Ill used nano command:sudo nano /etc/apache2/mods-enabled/dir.conf

    You should see the following line:

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

    Change to:

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

    Restart apache2 with following command:sudo service apache2 restart

    Now you can check out apache2 is working or not by visiting your servers public IPaddress or domain from your web browser ( http://ip_address or http://domain.com).If it work you will see the default Ubuntu 14.04 Apache web page, which is there forinformational and testing purposes. It should look something like this:

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    2 di 11 04/02/2015 14:05

  • Install and Congure MySQL ServerTo install Mysql Server package and all related package dependencies run thefollowong command:sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

    During the installation, youll be asked to setup the MySQL root user password. Thisis an administrative account in MySQL that has increased privileges, Enter thepassword and select [OK].

    After the mysql server installation complete, you need to run some command for tellMySQL to create database directory structure where it will store itsinformation. You can do this by typing the following command:sudo mysql_install_db

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    3 di 11 04/02/2015 14:05

  • Run the following command, It will be ask you to enter the password for the MySQLroot account. Next, it will ask you if you want to change that password. If you arehappy with your current password, type n for no. It also ask you to remove somesample users and databases, disable remote root logins, and load these new rules sothat MySQL immediately respects the changes you have made.sudo mysql_secure_installation

    Install and Congure PHP5To install PHP5 package and all related package dependencies run the followingcommand below. by default ubuntu server 14.04 will installed PHP 5.5 TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    4 di 11 04/02/2015 14:05

  • sudo apt-get install php5 php5-mysql php-pear php5-gd php5-mcrypt php5-curl

    Testing PHP5 and MySQLIn order to test PHP script you need to create simple PHP script in directory/var/www/html. in this case Ill create phpinfo.php:sudo touch /var/www/html/phpinfo.php

    sudo nano /var/www/html/phpinfo.php

    Add the following line into le /var/www/html/phpinfo.php

    Save and exit ( Ctrl + O, Ctrl + X)Test the php script you have made from web browser by typing in address barhttp://ip_address/phpinfo.php. It will appear like screenshot on below.

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    5 di 11 04/02/2015 14:05

  • This page basically gives you information about your server from the perspective ofPHP. It is useful for debugging and to ensure that your settings are being appliedcorrectly.Testing MySQL connection with PHP script. Create the le /var/www/html/phpmysql.php then add the following line on below. Replace the passwordwith your mysql root password have made during mysql installation:sudo touch /var/www/html/phpmysql.php

    sudo nano /var/www/html/phpmysql.php

    Now open web browser and navigate to http://ip_address/phpmysql.php, The pageshould be appear like screenshot on below:

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    6 di 11 04/02/2015 14:05

  • The following video created by LinuxScoop and is describes basic steps how toinstalling LAMP in Ubuntu Server 14.04 LTS. Original Video found here

    ConclusionNow that you have a LAMP (Linux, Apache2, Mysql 5, and PHP5) installed inUbuntu Server 14.04. Installing LAMP in ubuntu server 14.04 you can also usingsingle command:sudo apt-get install lamp-server^

    orsudo tasksel

    Then select [ * ] LAMP Server, It will install all package that needed for LAMPStack.Basically, you have installed a platform that will allow you to install web based appsin your server.Note : This tutorial have been tested on VPS DigitalOcean 512MBLink Reference: TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    7 di 11 04/02/2015 14:05

  • Ubuntu Server 14.04 Server GuideUbuntu PHP Apache MySQL

    Tags: #Apache2 #LAMP #MySQL #PHP #Ubuntu Server 14.04 #WebServer

    FacebookTwitterPin it...

    Google PlusDiggRedditLinkedinStumbleuponDeliciousEmail friend

    Related Post "How to Install LAMP in Ubuntu Server 14.04 LTS"

    Zentyal Server 4.0 : Linux Business Server Based on Ubuntu Server 14.04 LTSZentyal Server 4.0, a small Linux business

    How to Install Drupal 7.x with Apache2 + MySQl 5.5 + PHP 5.5 on Ubuntu Server14.04 LTSDrupal is open source software maintained and TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    8 di 11 04/02/2015 14:05

  • Comments

    How to Install WordPress 3.9 with Apache2 + MySQL 5.5 + PHP 5.5 in UbuntuServer 14.04 LTSWordPress is free and open source blogging

    How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTSThis tutorial will describes how to upgrade

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    9 di 11 04/02/2015 14:05

  • 17 Comments Ubuntu Server Guide LoginSort by Best Share

    Join the discussion

    Reply

    edmarrp 7 months agoI did this way, but my Lamp-Server don't work. The Apache2 page is ok, but the php testisn't connecting at localhost.5

    Reply

    Ravi 4 months ago> edmarrpIn php.ini you should change bind-address = localhost to bind-address = your_ip

    Reply

    Ravi 4 months ago> RaviSorry, not int php.ini but in /etc/mysql/my.cnf and change the line:

    bind-address = localhostto your own internal ip address e.g. 192.168.1.20bind-address = 192.168.1.20

    Reply

    Keyur Gandhi 3 months agoWhenever I try with public IP , Apache default page does not come.Its direct to somewebsite.1

    Reply

    Ananda Rajeshwaran.J 6 days agoSimply superb the installation went through without a hitch

    Reply

    burak 10 days agoCould not connect: Access denied for user 'root'@'localhost' (using password: YES)

    Reply

    kavita shingi 13 days agowhat to if there is no apt_get command

    Supply Chain Forecasting 2 months ago

    Favorite

    Share

    Share

    Share

    Share

    Share

    Share

    Share TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    10 di 11 04/02/2015 14:05

  • Popular PostHow to Install LAMP in Ubuntu Server 14.04 LTS

    How to Install WordPress 3.9 with Apache2 + MySQL 5.5 + PHP 5.5 inUbuntu Server 14.04 LTSHow to Install Drupal 7.x with Apache2 + MySQl 5.5 + PHP 5.5 on UbuntuServer 14.04 LTSHow To Install Ubuntu Server 14.04 LTS Trusty Tahr

    How to Upgrade Ubuntu Server 12.04 to Ubuntu Server 14.04 LTSUbuntu Portal

    Ubuntu MATE 14.04 LTS Released : Supported Until 2019Ubuntu Kylin 14.10 Utopic Unicorn : Adds New Features and Improve the SystemStabilityKubuntu 14.10 Utopic Unicorn : Released With KDE 4.14 and KDE Plasma 5Lubuntu 14.10 Utopic Unicorn : Simple, Lightweight and Support for Low-endMachinesXubuntu 14.10 Utopic Unicorn : Fast and Responsive

    Copyright 2014 Ubuntu Server Guide, All Rights ReserveHome | About Us | Privacy Policy | Sitemap

    TopTop

    How to Install LAMP in Ubuntu Server 14.04 LTS http://ubuntuserverguide.com/2014/06/how-to-inst...

    11 di 11 04/02/2015 14:05