fedora21 中lamp的搭建(测试没有问题)
LAMP Stands for Linux,Apache,MySQL and PHP. Most of the websites works with the above combination. The main purpose of LAMP is testing the application locally by the programmer before going to the production. Below are the steps to install LAMP (Apache, PHP and MySQL) on Fedora.
Installing Linux:
Here i am not going to show how to install Fedora 21. The main purpose of this post is to setup AMP (Apache,MySQL and PHP) only.
Installing Apache:
To start off we will install Apache. Open up the terminal and Swicth to root.
$ su
Name of the package is httpd, type following command on the terminal and then press enter.
# yum install httpd
Start the Apache by using the following command.
# systemctl start httpd.service
To make the apache to start during the every boot, type the following on terminal and hit Enter.
# systemctl enable httpd.service
Configure firewall to allow http request from the external network.
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
Testing Apache:
To make sure everything installed correctly we will now test Apache to ensure it is working properly.
Open up any web browser and then enter the following into the web address:
http://localhost/ or http://192.168.0.10
You will get the web page saying “Fedora Test Page”. Now the Apache is working fine. Apache’s default document root is /var/www/html on Fedora, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.
Fedora 21 - Apache Default pageFedora 21 – Apache Default page
Installing MySQL:
Next is to install the MySQL on the Linux, follow the Steps. Type the following command and then Press Enter.
# yum install mariadb mariadb-server
Start MySQL server.
# systemctl start mariadb.service
To make the MySQL to start during the every boot, type the following on terminal and hit Enter.
# systemctl enable mariadb.service
Nex is to make the MySQL secure by using the mysql_secure_installation command.
This program enables you to improve the security of your MySQL installation in the following ways:
You can set a password for root accounts.
You can remove root accounts that are accessible from outside the local host.
You can remove anonymous-user accounts.
You can remove the test database (which by default can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_.
[root@server1 ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): <— Enter Root password
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y <— Yes, if you want to setup root password
New password: <— Type password
Re-enter new password: <— Re type root password
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] <— Yes to remove anonymous users
… Success!
Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] <— Disable remote root login
… Success!
By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] <— Remove test database
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <— Reload privilleges
… Success!
Cleaning up…
All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
Installing PHP:
By default Apache server supports the HTML language only, not PHP for that we need to install PHP. To install PHP please follow the steps. Type following line on the terminal and press enter, this command includes support package for the MySQL.
# yum install php php-mysql
You need to restart the apache service after the installation of the PHP, to do that type the following on the terminal.
# systemctl restart httpd.service
Testing PHP:
For testing the PHP, Place one PHP file on to the default directory of the Apache. The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
In the terminal copy/paste the following line:
# vi /var/www/html/info.php
This will open up a file called info.php.
Copy/Paste this line into the phpinfo file:
<?php phpinfo(); ?>
Save and close the file. use Esc + ;wq for saving the file.
Now open you’re web browser and type the following into the web address:
http://localhost/info.php or http://192.168.0.10/info.php
The page look like below:
Fedora 21 - LAMP PHPInfoFedora 21 – LAMP PHPInfo
Scroll down the browser to modules section to check the support for the MySQL. you will get the screen like below.
Fedora 21 - LAMP PHPInfo MySQL SupportFedora 21 – LAMP PHPInfo MySQL Support
Read more: http://www.itzgeek.com/how-tos/linux/fedora-how-tos/install-apache2-with-php5-and-mysql-on-fedora-21-lamp.html#ixzz3OmDfNCwB
© 2014 ITzGeek. All rights reserved.
fedora21 中lamp的搭建(测试没有问题)的更多相关文章
- ubuntu中LAMP环境搭建及ubuntu语言和输入法设置
1. LAMP 的安装 1) sudo apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql 2) 存放 ...
- [转]Fabric2.3中使用test-network搭建测试网络
这个测试网络一方面可以用来学习Fabric,另一方面也可以让一些更有经验的开发者来测试他们的智能合约和应用,但是不建议用于生产环境,在2.0版本后,这个测试网络也取代了原来的"first-n ...
- VLC-DSS搭建直播系统中链路断开影响测试
VLC-DSS搭建直播系统中链路断开影响测试 系统环境搭建如图所示.计算机77上运行VLC从摄像机51上取流,推送给一级DSS服务器30:二级DSS服务器78从一级DSS服务器30上取流转发.(其配置 ...
- LAMP环境搭建之编译安装指南(php-5.3.27.tar.gz)
测试环境:CentOS release 6.5 (Final) 软件安装:httpd-2.2.27.tar.gz mysql-5.1.72.tar.gz php-5.3.27.tar.gz 1 ...
- lamp环境搭建(ubuntu)
系统:Ubuntu14.04 方法一.最简单的在线安装 (参考网址:http://os.51cto.com/art/201307/405333.htm) 具体过程: [1]打开终端,执行命令 # su ...
- LAMP平台搭建菜鸟入门级实验
LAMP平台搭建(菜鸟入门级) mysql 安装: (1)二进制安装 二进制安装 ,执行解压配置即可.无须执行三布安装. (2)源码编译安装 安装准备工作: (1)查看系统配置:#uname -a/ ...
- LAMP环境搭建教程(原创)
学习PHP脚本编程语言之前,必须先搭建并熟悉开发环境,开发环境有很多种,例如LAMP.WAMP.MAMP等.这里我介绍一下LAMP环境的搭建,即Linux.Apache.MySQL.PHP环境. 一. ...
- LAMP环境搭建教程
原文:LAMP环境搭建教程 学习PHP脚本编程语言之前,必须先搭建并熟悉开发环境,开发环境有很多种,例如LAMP.WAMP.MAMP等.这里我介绍一下LAMP环境的搭建,即Linux.Apache.M ...
- 转载自php100中文网 centos下lamp 环境搭建
学习PHP脚本编程语言之前,必须先搭建并熟悉开发环境,开发环境有很多种,例如LAMP.WAMP.MAMP等.这里我介绍一下LAMP环境的搭建,即Linux.Apache.MySQL.PHP环境. 一. ...
随机推荐
- Spring 学习——Spring IOC概念
Spring IOC 接口及面向接口编程 接口 定义及理解:接口是一个类的抽象声明,用于由内部操作分离出外部沟通的方式,使其内部进行修改而不影响其外部连接沟通的一种交互方式.不对外公开逻辑处理,只是返 ...
- thinkphp留言板开发笔记 1 - 新的
关于php数组的排序函数的总结: 有很多种排序方式和排序规则: 正常排序和反向排序, 使用 -r来表示 排序时是否考虑索引/下标, 如果考虑则加上-a, a=associate. sort是按值来排序 ...
- win10+vscode部署java开发环境
目录 Java开发插件配置: 调试: 快捷键: 启动配置文件launch.json: 启动配置说明: Launch: Attach: User Setting: 遇到的问题: 参考: Java开发插件 ...
- Oracle面试相关
存储过程: https://www.cnblogs.com/taiguyiba/p/7809310.html https://www.cnblogs.com/lideng/p/3427822.html ...
- C# 控件线程匿名委托定义
当你在子线程中要修改主线程某个控件的值时,有不想再去定义一个线程变量时,就可以直接使用线程匿名委托来实现. 主要是方便快捷 控件.BeginInvoke(new ThreadStart(delegat ...
- SQLServer 取 字段名称 类型 字段描述 等
https://www.cnblogs.com/w2011/archive/2013/01/04/2844143.html SELECT 字段名= convert(varchar(100), a.na ...
- 什么是mvc?
MVC模式(Model-View-Controller)是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型 (Model).视图(View)和控制器(Controller). ...
- 【译】第24节---Fluent API - 属性映射
原文:http://www.entityframeworktutorial.net/code-first/configure-property-mappings-using-fluent-api.as ...
- 《机器学习实战》之k-近邻算法(改进约会网站的配对效果)
示例背景: 我的朋友海伦一直使用在线约会网站寻找合适自己的约会对象.尽管约会网站会推荐不同的人选,但她并不是喜欢每一个人.经过一番总结,她发现曾交往过三种类型的人: (1)不喜欢的人: (2)魅力一般 ...
- Go 结构体(Struct)
引用曾经看到的一篇文章里面对 Golang 中结构体的描述,如果说 Golang 的基础类型是原子,那么 结构体就是分子.我们都知道分子是由原子组成的,换言之就是结构体里面可以包含基础类型.切片. 字 ...