centos7 yum搭建lamp
环境
系统:centos7
安装apache
#yum 安装apache
[root@localhost ~]# yum install httpd httpd-devel

#启动httpd服务
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl status httpd

#防火墙设置80端口开放
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@localhost ~]# firewall-cmd --reload
success

#查看80端口监听
[root@localhost ~]# netstat -tulp

#浏览器测试

安装mysql
#查看安装包
[root@localhost ~]# yum provides mysql

#安装mysql
[root@localhost ~]# yum install mariadb -y

#安装mysql安装包
[root@nmserver-7 ~]# yum install mariadb mariadb-server mariadb-libs mariadb-devel
#启动服务
[root@nmserver-7 ~]#systemctl start mysql
#数据库安全设置
[root@localhost ~]# 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] y
... 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] n
... skipping.
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] y
- 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] y
... 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!
#登陆数据库测试
[root@localhost ~]# mysql -uroot -p

安装php
#安装php
[root@localhost ~]# yum -y install php

#安装php拓展包
[root@localhost ~]# yum install php-mysql
[root@localhost ~]# yum install -y php-gd php-ldap
[root@localhost ~]# yum install -y php-gd php-odbc php-pear
[root@localhost ~]# yum install -y php-xml php-xmlrpc
[root@localhost ~]# yum install -y php-mbstring php-snmp php-soap curl curl-devel php-bcmath
测试
#网站发布目录为:
/var/www/html
#创建一个php文件并编辑:phpinfo
[root@localhost html]# touch phpinfo.php
[root@localhost html]# vim phpinfo.php

#浏览器访问

centos7 yum搭建lamp的更多相关文章
- centos7 yum搭建lamp环境
=============================================== 2018/1/14_第1次修改 ccb_warlock == ...
- yum搭建 Lamp环境
yum搭建Lamp yum install -y httpd yum install -y nano rpm 安装 Php7 相应的 yum源 rpm -Uvh https://dl.fedorapr ...
- 利用yum搭建lamp环境并进一步创建博客
用yum搭建lamp环境 第一.安装apache yum -y install httpd 第二.安装mariadb Yum -y mariadb mariadb-server 第三.安装php Yu ...
- centos7用yum搭建LAMP环境
用yum快速搭建LAMP平台 实验环境: [root@nmserver- html]# cat /etc/redhat-release CentOS release (AltArch) [root@n ...
- CentOS7下搭建LAMP+FreeRadius+Daloradius Web管理
注意:本文所有命令均在root命令下执行. freeradius服务官网:http://freeradius.org/ daloradius Web管理页面官网:https://sourceforge ...
- centos7 yum搭建lnmp环境及配置wordpress超详细教程
yum安装lnmp环境是最方便,最快捷的一种方法.源码编译安装需要花费大量的人类时间,当然源码编译可以个性化配置一些其它功能.目前来说,yum安装基本满足我们搭建web服务器的需求. 本文是我根据近期 ...
- CentOS 7 yum搭建 LAMP
CentOS 7 搭建LAMP环境 1. Apache 安装 Apache 的软件包名称叫做httpd,因此安装Apache,使用以下命令 [root@localhost ~]# yum -y ins ...
- centos7.3搭建lamp实现使用wordpress
``` 环境说明: 在同一台主机上实现LAMP(Linux + Apache + MariaDB + PHP) CentOS 7.3.Apache 2.4.6.MariaDB 5.5.52.PHP 5 ...
- CentOS7.X 搭建LAMP
第一部分搭建LAMP基础环境 1.检查CentOS是否为7.x版本 2.安装LAMP中的apache,采用yum源方法安装 yum install httpd httpd-devel A ...
随机推荐
- 日志切分神器--logrotate
Blog:博客园 个人 概述 还在自己写定时切分日志的脚本?试试系统自带的logrotate工具吧! logrotate是一个日志文件管理工具.用于分割日志文件,删除旧的日志文件,并创建新的日志文件, ...
- python + appium 执行报错整理
1.driver.find_element_by_id("com.taobao.taobao:id/searchEdit").send_keys("adidas" ...
- linux之DNS服务
1.DNS (Domain Name Service 域名解析) DNS是因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网而不需要记忆能够直接被机器识别的IP. BI ...
- 利用分块传输绕WAF
分块传输原理介绍 背景 HTTP Connection有两种连接方式:短连接和长连接: 短连接即一次请求对应一次TCP连接的建立和销毁过程. 长连接是多个请求共用同一个连接这样可以节省大量连接建立时间 ...
- 下载器Folx怎么安装使用
应该使用哪个下载工具?这个如果是Windows上会有无数答案的问题,在Mac上却变得异常的纠结.比如Leech和Aria2,这两款软件,前者功能相对比较简单,后者的配置又稍微有点复杂,很难找到一款相对 ...
- CorelDRAW快速去除图片背景颜色
当我们需要从网上借助一些素材图片在CorelDRAW中运用时,往往需要去掉图片的背景颜色.本文小编分享CDR中如何快速去除图片背景颜色的方法,通过此方法可以做简单的照片抠图.合成. 1. 打开Core ...
- guitar pro系列教程(二十六):Guitar Pro教程之虚拟吉他功能讲解
上一章节我们讲述了Guitar Pro的组织小节的相关功能,那么本章节我们还是采用图文结合的方式为大家讲解关于guitar pro中一些虚拟的吉他功能一 一做出讲解,感兴趣的朋友可以一起进来学习了解哦 ...
- 为什么换了电脑安装MindManager提示密钥失效?
相信很多MindManager用户遇到过这样的问题,不想在原电脑上使用MindManager思维导图软件,想要换电脑安装,但是提示该许可证密钥失效了.下面文章就教大家如何解决这个问题: 我们在Mind ...
- jenkins运行错误解决办法
本地搭建好jenkis服务器,运行然后登陆上管理后台 构建好运行命令,然后进行构建出现如下错误说没有python运行环境 ,本地已经配置好python环境,并且终端能正常运行. 解决方法:jenkin ...
- Contest 982
A 直接模拟即可,为了方便边界判断建议用 !=. 时间复杂度 \(O\left(n\right)\). B \(w\) 排序来处理内向者,坐人后丢进大根堆来处理外向者. 时间复杂度 \(O\left( ...