Establish the LAMP (Linux+Apache+MySQL+PHP) Development Environment on Ubuntu 14.04 Operating System

########################################################

Step One: Update the software package in your operation system.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#apt-get update

#apt-get dist-upgrade -y --force-yes

########################################################

Step Two: Install Apache2 Web Server Environment.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#apt-get install apache2 apache2-bin apache2-data apache2-doc apache2-mpm-prefork apache2-utils

And then you need to modify its default Home page. (/etc/apache2/mods-enabled/dir.conf)

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

Modify it, like this as following show.

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>

After that, you still need to restart your apache server. so I think you have to execute the following command.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#service apache2 restart

At last, you want to verify this step whether it works well. You only have to open your browser and type your machine‘s IP or localhost into the URL input-box.

I believe you‘ll see the Apache2 Ubuntu Default Page.

If you can see this page, you have enough reason to believe that you have succeed to install the apache web server on your system. It‘s great.

########################################################

Step Three: start up the pseudo-static componnet (which named mod_rewrite component).

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#a2enmod rewrite
#service apache2 restart

########################################################

Step Four: Create a user for management and setting up multi-site.

first thing you need to do, creating its home directory ‘/home/username‘

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#mkdir /home/username

#adduser username  -d /home/username(#comment: what username, it‘s up to you)

#passwd username

Enter new UNIX password:

Retype new UNIX password:

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for laozuo
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]

and then we need to create a directory to store our site files and log files.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#cd /home/username

#mkdir public_html logs

you need to set its permission for this user after you create this directory. Or we can not upload our site file into this folder or edit these file had existted on the website.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#chown username:www-data -R /home/username/public_html /home/username/logs

#chmod 755 -R /home/username

The important thing you need to note that going to configure your website.

At the begining, you just need to disable 000-default.conf configuration.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#a2dissite 000-default.conf
#service apache2 reload

The other important thing is that you need to write your own site‘s configuration.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#mv 000-default.conf XXXX.XXX.conf

Modify this configuration file.

<VirtualHost *:80>
    ServerName laozuo.org
    ServerAlias laozuo.org
    ServerAdmin [email protected]
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory /var/www/html>
    Options Indexes ExecCGI Includes FollowSymLinks MultiViews
    AllowOverride All
    Order Deny,Allow #Here, you must note that Deny,Allow without any blank-space. If you leave the blank-space, you will encounter a error when you want to restart your apache server.
    Allow from all
    </Directory>

</VirtualHost>

Saved it later, you need to start up our website.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#a2ensite XXXX.XXX.conf

If you fail to launch it, I only suggest you go to check its log out. the log will restore on the /var/log/apache2/error.log file.

########################################################

Step Five: Install and Configuration MySQL Database

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#apt-get install mysql-server mysql-client

During the installation epriod, you have to type the same password two times. And then you don‘t have to do anything except for waitting until it has been completedly installed.

########################################################

Step Six: Install and Configure the PHP Development Environment.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#apt-get install php5 php-pear php5-mysql php5-dev libapache2-mod-php5 php5-dev php5-curl php5-gd php5-imagick php5-mcrypt

After finishing to install these software package, you can go to the "/var/www/html/" directory.

One Important thing you need to finish here is that create a PHP file to verify if it works normally.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#cd /var/www/html

#vim info.php

<?php
    phpinfo();
?>

Saved it after you finish to write some code like this.

Please open your browser to verify this execitting moment and type your machine‘s IP/info.php or localhost/info.php.

You‘ll see some amazing thing. Showing as following screenshot:

########################################################

Step Seven: Install PHPMyAdmin

why do we need to install this software? maybe you want to know the answer.

I will tell you that it‘s useful to manage our SQL Database. So we need to install this guy to help us do something.

THE COMMAND YOU CAN TYPE INTO YOUR CONSOLE

#apt-get install phpmysqladmin

It requires us to select its supportive version.

I suggest you can choose the apache2.

Under this process, It also requires you to type your mysql‘s root password. maybe you need to type it two times.

That‘s all.

So our LAMP Development Environment has been established. It‘s an amazing thing.

Thank you for watching here. It‘s my pleasure to share something I know. Hope That It Can Help You.

I have to go asleep. Have a good time. Good Luck!

时间: 2024-10-12 20:40:28

Establish the LAMP (Linux+Apache+MySQL+PHP) Development Environment on Ubuntu 14.04 Operating System的相关文章

[Django] Setting up Django Development Environment in Ubuntu 14.04

1. Python Of course you will need Python. Still Python 2.7 is preferred, however if you would like to create new projects with Python 3, it is also fine to do. Newest Python could be downloaded from https://www.python.org/downloads/ 2. pip It is a ve

Lamp(linux+apache+mysql+php)环境搭建

Lamp(linux+apache+mysql+php)环境搭建 1.安装apache2:sudo apt-get installapache2 安装完毕后.执行例如以下命令重新启动apache:sudo/etc/init.d/apache2 restart,在浏览器中输入http://localhost或者http://127.0.0.1,会看到"It works!"说明apache成功安装. 2.安装php:sudoapt-get install libapache2-mod-ph

Ubuntu下的LAMP(Linux+Apache+MySQL+PHP) 开发环境架设

LAMP在业界是一个非常流行的词语,这4个字母分别代表Linux,Apache,MySQL和PHP.LAMP以其高效.灵活的特性已经成为中小企业的首选. 以前介绍一种迅速搭建LAMP的方式. 1 在Ubuntu上打开终端,输入 sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server 一口气就可以下载(apache2,php5,mysql)三个工具 2 安装MySQL的时候,会让你设定一个Root管理员的密码

CentOS 6.5下源码安装LAMP(Linux+Apache+Mysql+Php)环境

CentOS 6.5下源码安装LAMP(Linux+Apache+Mysql+Php)环境一. 系统环境:Linux系统版本: CentOS release 6.5Apache版本: httpd-2.2.24PHP 版本: php-5.6.11 二.安装前准备: 1.查看是否安装GCC ,GCC-C++编译器,如果没有则进行安装: 查看是否安装的命令: #gcc –v 若未安装在服务器联网情况下可以使用下列命令安装: #yum install gcc #yum install gcc-c++2.

CentOS 6.3 源码安装LAMP(Linux+Apache+Mysql+Php)环境

一.简介 什么是LAMP LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而>言都是在它所代表的方面功能非常强大的组件. LAMP这个词的由来最早始于德国杂志“c't Magazine”,Michael Kunze在1990年最先把这些项目组合在一起创造了LAMP的缩写字.这些>组件并不是开始就设计为一起使用的,但是,这些软件都是开源的,可以很方便的随时获得并免费使用,这就导致了这些组件经常

WEB平台架构之:LAMP(Linux+Apache+MySQL+PHP)

WEB平台架构之:LAMP(Linux+Apache+MySQL+PHP)  从业界来看,最主流的web平台架构就当属LAMP了.LAMP架构可以说是一切web平台的基础架构,所有一切的所谓大型架构无非就是通过一些负载均衡技术,集群技术,缓存技术等结合LAMP平台组合而成以便来满足现实生产环境中的需求.因此很有必要聊一聊LAMP平台架构的搭建.本文会对LAMP平台相对性的聊一聊其搭建过程,根据个人的知识知无不说,更多的技术将会陆续整理成博客文章.我的要求没那么多,笨蛋的技术,只求看文章的人,都能

CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境

一.简介 什么是LAMP    LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而言都是在它所代表的方面功能非常强大的组件.    LAMP这个词的由来最早始于德国杂志“c't Magazine”,Michael Kunze在1990年最先把这些项目组合在一起创造了LAMP的缩写字.这些组件并不是开始就设计为一起使用的,但是,这些软件都是开源的,可以很方便的随时获得并免费使用,这就导致了这些组

CentOS下安装配置LAMP(Linux+Apache+MySQL+PHP)

关于LAMP的各种知识,今天主要是介绍一下在CentOS下安装,搭建一个Web服务器的过程.(本文是使用安装包安装) 一.简介 什么是LAMP     LAMP是一种Web网络应用和开发环境,是Linux, Apache, MySQL, Php/Perl的缩写,每一个字母代表了一个组件,每个组件就其本身而言都是在它所代表的方面功能非常强大的组件.     LAMP这个词的由来最早始于德国杂志“c't Magazine”,Michael  Kunze在1990年最先把这些项目组合在一起创造了LAM

CentOS6系统编译部署LAMP(Linux, Apache, MySQL, PHP)环境

我们一般常规的在Linux服务器中配置WEB系统会用到哪种WEB引擎呢?Apache还是比较常用的引擎之一.所以,我们在服务器中配置LAMP(Linux, Apache, MySQL, PHP)是我们常用的WEB环境.对于大部分同学来说,我们会选择采用WEB面板或者是一键包安装,但是一键包或者面板也是有一些缺陷的,比如有些软件我们并不需要安装. 或者说,对于我们深入学习Linux系统的用户来说,肯定是需要一步步编译安装,这样才知道其中的原理.在这篇文章中,我们将在CentOS6系统中(CentO