环境

系统: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的更多相关文章

  1. centos7 yum搭建lamp环境

    =============================================== 2018/1/14_第1次修改                       ccb_warlock == ...

  2. yum搭建 Lamp环境

    yum搭建Lamp yum install -y httpd yum install -y nano rpm 安装 Php7 相应的 yum源 rpm -Uvh https://dl.fedorapr ...

  3. 利用yum搭建lamp环境并进一步创建博客

    用yum搭建lamp环境 第一.安装apache yum -y install httpd 第二.安装mariadb Yum -y mariadb mariadb-server 第三.安装php Yu ...

  4. centos7用yum搭建LAMP环境

    用yum快速搭建LAMP平台 实验环境: [root@nmserver- html]# cat /etc/redhat-release CentOS release (AltArch) [root@n ...

  5. CentOS7下搭建LAMP+FreeRadius+Daloradius Web管理

    注意:本文所有命令均在root命令下执行. freeradius服务官网:http://freeradius.org/ daloradius Web管理页面官网:https://sourceforge ...

  6. centos7 yum搭建lnmp环境及配置wordpress超详细教程

    yum安装lnmp环境是最方便,最快捷的一种方法.源码编译安装需要花费大量的人类时间,当然源码编译可以个性化配置一些其它功能.目前来说,yum安装基本满足我们搭建web服务器的需求. 本文是我根据近期 ...

  7. CentOS 7 yum搭建 LAMP

    CentOS 7 搭建LAMP环境 1. Apache 安装 Apache 的软件包名称叫做httpd,因此安装Apache,使用以下命令 [root@localhost ~]# yum -y ins ...

  8. centos7.3搭建lamp实现使用wordpress

    ``` 环境说明: 在同一台主机上实现LAMP(Linux + Apache + MariaDB + PHP) CentOS 7.3.Apache 2.4.6.MariaDB 5.5.52.PHP 5 ...

  9. CentOS7.X 搭建LAMP

    第一部分搭建LAMP基础环境 1.检查CentOS是否为7.x版本 2.安装LAMP中的apache,采用yum源方法安装 yum  install httpd httpd-devel       A ...

随机推荐

  1. git clone 出现"error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received."

    1. 最近用git pull几个大项目,总是报如下错误: error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with un ...

  2. 如何开发一个maven插件

    maven是当下最流行的项目管理工具,其丰富的插件为我们的工作带来了很大的便利. 但是在一些情况下,开源的插件并不能完全满足我们的需求,我们需要自己创建插件,本文就从0开始带大家一起创建自己的插件. ...

  3. setPriority()优先级

    1 . 优先级表示重要程度或者紧急程度.但是能不能抢到资源也是不一定.2 . 分配优先级:反映线程的重要或紧急程度线程的优先级用1-10 表示,1的优先级最低,10的优先级最高,默认值是5 packa ...

  4. Python博文_爬虫工程师是干什么的

    程序员有时候很难和外行人讲明白自己的工作是什么,甚至有些时候,跟同行的人讲清楚"你是干什么的"也很困难.比如我自己,就对Daivd在搞的语义网一头雾水.所以我打算写一篇博客,讲一下 ...

  5. Python_网络编程_socket()

    什么是 Socket? Socket又称"套接字",应用程序通常通过"套接字"向网络发出请求或者应答网络请求,使主机间或者一台计算机上的进程间可以通讯. 详细资 ...

  6. python杂乱知识点

    1. =  == is =: ==:比较 值是否相等 is:比较,比较的是内存地址 2. id(内容):得到内容的起始内存地址 3.数字,字符串,存在小数据池的概念,如果如果创建了一样的数字或者字符串 ...

  7. css子选择器 :frist-child :nth-child(n) :nth-of-type(n) ::select选择器

    记录一下前一段时间使用.学习的几种选择器. 1. :frist-child 选择器n 比如<ul><li></li> <li></li> & ...

  8. HTML5大纲算法

    什么是HTML大纲算法? 大纲算法允许用户代理(user agent)从一个web页面生成一个信息结构目录,让用户对页面有一个快速的概览.类似书籍.PDF.帮助文档等,都有一个清晰的目录结构,用户能方 ...

  9. 如何在PDF文档上加水印

    当我们需要传输一些比较重要的文件时,往往会选择将文档转换为PDF文件,避免其他人复制.更改文档的内容. pdfFactory不仅可以为用户提供快速创建PDF的功能,同时还提供了添加水印的功能.有了水印 ...

  10. 使用ABBYY FineReader 手动校正文档复杂结构

    ABBYY FineReader 15(Windows系统)拥有强大的OCR识别功能,能对扫描仪或者数码相机等光学工具获取的图像进行识别,解析其中的文本.图像.表格.条形码等,方便用户进一步获取图像中 ...