LAMP 是开源系统上 Web 服务器的梦幻组合。LAMP 是 Linux、 Apache HTTP 服务、 MySQL/MariaDB 数据库和 PHP、 Perl 或 Python 的简称。

下面教你如何在 Fedora 23 服务器上安装 LAMP 组合。

下面的教程默认使用 192.168.1.102/24 实例,请按照你的服务器做修改。

安装 Apache

Apache 是一款开源的 web 服务框架。完全支持 CGI, SSL。

切换到 root 账户:suFedora 23/22 输入以下命令来安装Apache:dnf install httpd -yFedora 21 及更早的版本:yum install httpd -y启动httpd服务,以在每次系统启动服务:systemctl enable httpd使用以下命令来启动httpd服务:systemctl start httpd

如果您遇到以下错误:

Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.

删除所有内容在/etc/hostname,并加上“localhost”。同时,在/etc/httpd/conf/httpd.conf文件中的“Servername”的值设定为“localhost”,并再次尝试启动httpd服务。

并调整防火墙以允许httpd服务,从远程客户端访问。

firewall-cmd --permanent --add-service=httpfirewall-cmd --permanent --add-service=https

重新启动firewalld服务:

firewall-cmd --reload

打开浏览器,输入服务器IP访问:

安装 MariaDB

Fedora 23/22 用户安装命令:

dnf install mariadb mariadb-server -y

Fedora 21 及早前版本命令:

yum install mariadb mariadb-server -y

随系统自动启动命令:

systemctl enable mariadb

启动数据库服务器:

systemctl start mariadb

设置 MariaDB root 账户密码,默认情况下MySQL root用户的密码为空。因此,以防止未经授权的访问MySQL数据库,我们设置需要root用户密码:

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.

You already have a root password set, so you can safely answer ‘n’.

Change the root password? [Y/n] y ## Enter ‘y’ and press enter ##

New password: ## Enter password ##

Re-enter new password: ## Re-enter 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] ## Press Enter ##

… 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] ## Press Enter ##

… 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] ## Press Enter ##

– Dropping test database…

ERROR 1008 (HY000) at line 1: Can’t drop database ‘test’; database doesn’t exist

… Failed! Not critical, keep moving…

– 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] ## Press Enter ##

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

安装 PHP

Fedora 23/22 用户命令:

dnf install php -y

Fedora 21 及早期版本:

yum install php -y

测试PHP是否运行:

vi /var/www/html/testphp.php

输入以下内容:

<?phpphpinfo();?>

重启 Http 服务:

systemctl restart httpd

浏览器输入看看:

安装PHP模块

搜索模块并安装:

Fedora 23/22 用户:

dnf search php

Fedora 22及早期版本:

yum search php

现在安装你所选择所需模块,例如php-mysql,使用以下命令:

Fedora 23/22 用户:

dnf install php-mysql -y

Fedora 22及早期版本:

yum install php-mysql -y

重启 HTTP 服务:

systemctl restart httpd

浏览器查看模块安装是否成功:

安装 phpMyAdmin

phpmyadmin 用于管理数据库:

Fedora 23/22 用户:

dnf install phpmyadmin -y

Fedora 22及早期版本:

yum install phpmyadmin -y

缺省情况下,phpMyAdmin 只能从本地主机进行访问。若要从远程系统访问您的网络中,请执行下列操作步骤。

vi /etc/httpd/conf.d/phpMyAdmin.conf

查找并注释掉127.0.0.1 和请求 ip ::1 lines。然后添加一个额外的行要求所有授予略低于为注释行。

这是我的更改后的 phpMyAdmin.conf 文件。这些变化以粗体标记。

[...]Alias /phpMyAdmin /usr/share/phpMyAdminAlias /phpmyadmin /usr/share/phpMyAdmin<Directory /usr/share/phpMyAdmin/>AddDefaultCharset UTF-8<IfModule mod_authz_core.c># Apache 2.4<RequireAny>#       Require ip 127.0.0.1#       Require ip ::1Require all granted</RequireAny></IfModule><IfModule !mod_authz_core.c># Apache 2.2Order Deny,AllowDeny from AllAllow from 127.0.0.1Allow from ::1</IfModule></Directory><Directory /usr/share/phpMyAdmin/setup/><IfModule mod_authz_core.c># Apache 2.4<RequireAny>#       Require ip 127.0.0.1#       Require ip ::1Require all granted</RequireAny></IfModule><IfModule !mod_authz_core.c>[...]

重要提示:不过让localhost以外的人访问数据库,应视为危险,除非通过SSL适当保护。做到这一点需要您自担风险。

保存并关闭文件。重新启动httpd服务。

systemctl restart httpd

OK,打开 phpmyadmin 测试一下:

好了,安装完毕!

转载于:https://www.cnblogs.com/linux130/p/5657099.html

Fedora 23如何安装LAMP服务器相关推荐

  1. 在Fedora 23上安装多媒体解码器

    在Fedora 23上安装多媒体解码器 时间:2016-06-25 来源:topspeedsnail.com  作者:斗大的熊猫 安装多媒体解码器允许你播放更多格式的音频和视频格式.大多数这些解码器都 ...

  2. 安装lamp服务器系统,LAMP安装环境搭建详解

    实现LAMP 1.LAMP工作原理 LAMP是一个强大的Web应用程序平台,其中L是指linux系统:A是指apache也就是http;M一般是MySQL/mariadb数据库;P一般是php, pe ...

  3. pdo mysql fedora_在Fedora 23 Server和Workstation上安装LAMP(Linux, Apache, MariaDB和PHP)

    在安装LAMP之前,建议先更新系统包 $ sudo dnf update 第一步:安装Apache Web服务器 1.在Fedora 23安装Apache,你可以运行下面的命令: $ sudo dnf ...

  4. 在Fedora 11中安装Apache2+PHP5+MySQL(LAMP)

    在Fedora 11中安装Apache2+PHP5+MySQL(LAMP) LAMP是Linux, Apache, MySQL, PHP的缩写.这篇教程将教你如何在一台Fedora 11服务器上安装A ...

  5. Lamp 服务器环境安装

    原地址:https://lnmp.org/install.html 系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu/Raspbian/Deepin/Aliyun/Amaz ...

  6. 在fedora下面安装ftp服务器

    Fedora版本:Fedora 12 1. 安装vsftp [java] view plaincopy #yum install vsftpd 一路yes,最后提示安装成功. 2. 配置vsftpd. ...

  7. CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)

    2019独角兽企业重金招聘Python工程师标准>>> 准备篇: 1.配置防火墙,开启80端口.3306端口    vi /etc/sysconfig/iptables    -A ...

  8. CentOS 6.3安装配置LAMP服务器(Linux+Apache+MySQL+PHP5)

    服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※ 本文档描述了如何在Linux服务器配置Apache.Mysql.PHP5 ...

  9. redhat7 mysql lamp_RHEL7 yum安装配置LAMP服务器(Apache+PHP+MySql)

    一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop fi ...

最新文章

  1. Linux平台Oracle安装脚本
  2. maven与eclipse连接的配置
  3. 为了追求极致的性能,Kafka掌控这11项要领
  4. Docker制作镜像(四)
  5. 【转】认识 C++ 中的 explicit 关键字
  6. 大数据分析工具如何选择
  7. python键值对储存数据_在python中存储100万个键值对的列表
  8. centOS 安装远程桌面
  9. 数据可视化之旅(五):常用图表对比
  10. 【12c】直方图Histograms
  11. 杀毒软件 McAfee 创始人自杀,75 年传奇人生画下句号
  12. 数据库(day02)
  13. 25 条客户服务名言激励您的团队
  14. web前端HTML和CSS3常见面试题
  15. nest中文文档_如何将Nest Cam事件记录到Google文档电子表格
  16. 15个iOS的视频播放控件
  17. 【总结】1172- 在滴滴和头条干了2年,分享几点感悟!
  18. QGIS 添加国内地图提供商(高德/百度/必应/腾讯)卫星及路网图
  19. 春招来了!找个互联网IT工作试试看?2021校招公司大全!
  20. Datawhale 7月学习——李弘毅深度学习:卷积神经网络

热门文章

  1. arcgis engine二次开发python-使用C#配合ArcGIS Engine进行地理信息系统开发
  2. python第三方库numpy-Python第三方库之openpyxl(2)
  3. python画三维平面-Python三维绘图--Matplotlib
  4. python基础语法有哪些-python有哪些语法元素
  5. python真的那么强大嘛-这些 Python 库真的很“冷”,但是却很强大
  6. python利器的使用-Python数据科学利器
  7. python文字教程-Python 爬虫零基础教程(3):输出一个网页上的文字
  8. python上下条形图-Python之多变量叠加条形图
  9. 快速记忆python函数-python之格式化字符串速记整理
  10. 少儿编程python线上课程-北京Python程序开发课程