参考资料:

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):

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

New password:

Re-enter new 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]

… 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]

… 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]

– 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]

… 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:

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 mysql_在fedora21 上的php+mysql+apache环境搭建相关推荐

  1. 在fedora21 上的php+mysql+apache环境搭建

    2019独角兽企业重金招聘Python工程师标准>>> 转自:http://www.itzgeek.com/how-tos/linux/fedora-how-tos/install- ...

  2. php+mysql+apache 环境搭建

    Apache2.2+php5.3+mysql5.1.73 配置 安装Apache2.2 下载Apache软件 双击安装 注意端口占用 如果80端口被占用 在填写服务器信息的时候 要选择第二项 这里选择 ...

  3. 64位win7搭建php mysql_[转]Win7 64位操作系统下配置PHP+MySql+Apache环境

    Win7 64位操作系统下配置PHP+MySql+Apache环境 注: 1./* */ 之间的为步骤或注释,不要粘到配置文件内 2.Apach配置时是用的"/",而php配置时用 ...

  4. 2012 iis php mysql_Win2012 R2 IIS8.5+PHP(FastCGI)+MySQL运行环境搭建wordpress博客教程

    Win2012 R2 IIS8.5+PHP(FastCGI)+MySQL运行环境搭建教程 一.环境说明: 操作系统:Windows Server2012 R2 PHP版本:php 5.5.8 MySQ ...

  5. rsyslog+mysql+loganalyzer 环境搭建日志服务器

    环境:CentOS6.6 rsyslog+mysql+loganalyzer 环境搭建日志服务器 Client端:    192.168.2.10 MySQL服务器:  192.168.2.11 # ...

  6. mysql 搭建日志服务器_rsyslog+mysql+loganalyzer 环境搭建日志服务器

    环境:CentOS6.6 rsyslog+mysql+loganalyzer 环境搭建日志服务器 Client端:192.168.2.10 MySQL服务器:192.168.2.11 # Client ...

  7. 柠檬班接口测试Tomcat+MySQL测试环境搭建

    Tomcat+MySQL测试环境搭建 安装Tomcat运行环境 配置MySQL数据库 发布项目 配置数据库开机自启 遇到的问题 安装Tomcat运行环境 参考链接: https://blog.csdn ...

  8. (三)Linux环境部署(Centos+Nginx+Tomcat+Mysql) - Nginx环境搭建

    因为在网上发现系统性.严谨(特别是在安全方面)的Linux部署方面的参考文章很少,于是整理以下六篇Linux环境部署的系列性文章,其为本人在实践中,完整的搭建一个基于Linux系统上Centos+Ng ...

  9. win2012 r2 iis php,Win2012 R2 IIS8.5+PHP(FastCGI)+MySQL运行环境搭建wordpress博客教程

    运行环境搭建教程 一.环境说明: 操作系统:Windows Server2012 R2 PHP版本:php 5.5.8 MySQL版本:MySQL5.6.15 二.相关软件下载: 1.PHP下载地址: ...

最新文章

  1. CodeForces 595A
  2. excel表格制作计算机一级,计算机一级OFFICE辅导:给Excel表格添加背景音乐
  3. 互联网金融风控面试算法知识(三)
  4. typedef的详细用法
  5. python为什么没有点击就触发_Ai中没有触发的触发器
  6. python编写人机交互界面_Python编写个天气查询应用(可视化界面)
  7. Linux如何安装iperf软件,Linux 下网络性能测试工具 iperf 的安装和使用
  8. 计算机课程可在平板上做吗,老师做直播,孩子上网课,掌控线上学习就靠这个平板电脑了...
  9. 在自定义HttpHandler 中使用Session
  10. 红米AirDots无线蓝牙耳机成功连接WIN7电脑
  11. 企业微信API使用基本教程
  12. Windows10卸载密钥导致win10未激活--解决
  13. NDT Matching 算法学习
  14. HDU - 4532 湫秋系列故事――安排座位
  15. JVM:并发的可达性分析
  16. ubuntu14.04 刚安装完成后汉语拼音输入法出错问题的解决办法
  17. Hibernate开发实践笔记--对象在set属性时更新了数据库问题
  18. 微软对联服务器关闭了吗,不只对联,现在微软还能自动生成绝句
  19. php工作便签,便签本的正确使用方法
  20. AIDA64烤机温度正常是多少 AIDA64烤机结果怎么看

热门文章

  1. 各纬度气候分布图_读我国一月平均气温分布图,寻找我国冬季气温最高和最低的地方...
  2. u盘安装浪潮服务器_浪潮服务器NF84260M3安装Windows server 2012 R2
  3. pythonprint()_python基础1 print()函数
  4. android扑克发牌动画,JS实现纸牌发牌动画
  5. 戴尔塔式服务器各型号,戴尔_PowerEdge T440_塔式服务器_网络存储服务器_服务器 | Dell 中国大陆...
  6. ubuntu+VsCode+Cmake+eigen 开发eigen应用
  7. 第五章 有限脉冲响应滤波器(ba,我终于懂FIR滤波器了)
  8. Allegro 如何把铺好铜皮的平面层互换
  9. 【arduino】RFID门禁刷卡模块RFID-RC522
  10. QTcreator 多线程(生产者消费者)