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 ...
随机推荐
- 调试没有core文件的coredump
对coredump的分析中,是依赖于core文件的,而core文件中也几乎包含了程序当前的所有状态(堆栈.内存.寄存器等).然而在实际的线上环境中,由于core文件太大.保存core文件耗时太久,出于 ...
- tcp syn-synack-ack 服务端发送syn-ack
tcp_v4_send_synack()用于发送SYNACK段,在tcp_v4_conn_request()中被调用. 首先调用tcp_make_synack()构造SYNACK段,主要是构造TCP报 ...
- 工作流(workflow)
1,JBPM 工作流(开源历史悠久) 2,activity 工作流(开源历史悠久) 3,workable 工作流(功能比较强大,但是开源维护缓慢,比较注重商业化) 以上三个是主流的工作流
- 两种不同的扩展Scrum的方式
两种不同的扩展Scrum的方式 1.LeSS和LeSS Huge –大型Scrum LeSS(和LeSS Huge –真正的大型程序)的合著者Craig Larman首先批评了管理,开发人员和客户传统 ...
- php 进行图片裁剪
<?php $src_path = '1.jpg'; //创建源图的实例 $src = imagecreatefromstring(file_get_contents($src_path)); ...
- Angular 富文本编辑之路的探索
作者:杨振兴Worktile 前端工程师,PingCode Wiki 产品技术负责人 PingCode Wiki 提供结构化知识库来记载信息和知识,便于团队沉淀经验.共享资源,欢迎大家注册试用 本文主 ...
- web自动化测试难点 滚动条操作、日期框处理、上传文件
如何把页面滑到最低部? 一般来说,做web自动化测试时,不需要单独写代码,把页面滑到可见,因为click操作,只要是元素存在并且加载出来了,就可以点击到,无需另外写滑动元素的代码. 如果特殊情况需要滑 ...
- 对数组进行排序成最小的,相当于自己实现了一次String的compareTo函数,不过是另类的。
题目描述 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个.例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323. //一气呵成 ...
- Linux没有netstat和ifconfig命令问题
安装了精简版命令行centos7系统,运行netsta查看端口和ifconfig查看IP命令都提示找不到命令. 解决方法: yum search ifconfig 通过yum search 这个命令我 ...
- 太干了!一张图整理了 Python 所有内置异常
在编写程序时,可能会经常报出一些异常,很大一方面原因是自己的疏忽大意导致程序给出错误信息,另一方面是因为有些异常是程序运行时不可避免的,比如在爬虫时可能有几个网页的结构不一致,这时两种结构的网页用同一 ...