搭建LAMP环境部署opensns微博网站

实验环境

centos7
ip: 192.168.121.17

一、关闭防火墙和selinux

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# setenforce 0
[root@localhost ~]# iptables -F

二、搭建 LAMP 环境

[root@localhost ~]# yum install -y httpd mariadb-server mariadb php php-mysql php-gd php-mbstring
注释:
httpd #web服务器←
mariadb-server #MariaDB数据库
mariadb #MariaDB服务器Linux下客户端
php #php相关文件
php-mysql #php程序连接MySQL使用的模块
php-gd #php图像处理函数
php-mbstring #php语言扩展编码

三、启动服务

[root@localhost ~]# systemctl enable --now httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl enable --now mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

四、配置数据库排除安全隐患

[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] y
... 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] 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!

五、测试Apache是否支持PHP解析

  1. 在 httpd 工作目录下写测试首页
[root@localhost ~]# vi /var/www/html/test.php
[root@localhost ~]# cat /var/www/html/test.php
<?php
phpinfo();
?>
  1. 测试浏览器是否可以访问 PHP 测试页面

六、上传opensns微博网站

  1. 将opensns微博网站上传到服务器
[root@localhost ~]# ls
anaconda-ks.cfg opensnsfree.zip
  1. opensnsfree.zip 解压到 /var/ww/html/ 目录下
[root@localhost ~]# unzip opensnsfree.zip -d /var/www/html/
[root@localhost ~]# ls /var/www/html/
opensns_free test.php

七、授权

[root@localhost ~]# chown -R apache.apache /var/www/html/*
[root@localhost ~]# chmod 755 /var/www/html/*

八、浏览器访问页面并初始化设置

搭建LAMP环境部署opensns微博网站的更多相关文章

  1. 搭建LAMP环境部署GLPI资源管理系统

    搭建LAMP环境部署GLPI资源管理系统 一.关闭防火墙和Selinux [root@localhost ~]# systemctl disable --now firewalld [root@loc ...

  2. 搭建LAMP环境部署Nextcloud私人网盘

    搭建 LAMP 环境部署 Nextcloud 私人网盘 前言 Nextcloudd 是一个开源的.基于本地的文件共享和协作平台,它允许您保存文件并通过多个设备(如PC.智能手机和平板电脑)访问它们. ...

  3. 搭建LAMP环境部署Ecshop电商网站

    实战-部署Ecshop电商网站 实验环境 Centos7 ip:192.168.121.17 一.关闭防火墙和selinux [root@localhost ~]# systemctl stop fi ...

  4. 搭建LAMP环境部署discuz论坛

    !!!什么是LAMP: LAMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写: Linux,操作系统 Apache,网页服务器 MariaDB或MySQL,数据库管理系统(或者 ...

  5. •搭建LAMP环境及快速部署双网站并实现基于域名的虚拟主机

    本节所讲内容: 实战:搭建LAMP环境及快速部署双网站并实现基于域名的虚拟主机 LAMP架构:??? Linux+Apache+Mysql+PHP Linux+Apache+Mysql/MariaDB ...

  6. 在ubuntu上搭建开发环境4---ubuntu简单的搭建LAMP环境和配置

    最近重新安装了Ubuntu,但是之前的LAMP环境自然也就没有了,实在是不想再去编译搭建LAMP环境(这种方法实在是太费时间,而且太容易遇到各种不知道为什么的错误),所以,就去查查有没有什么简单的搭建 ...

  7. Centos7+Apache2.4+php5.6+mysql5.5搭建Lamp环境——为了wordPress

    最近想搭建个人博客玩玩,挑来挑去发现口碑不错的博客程序是wordpress,简称wp.虽然是学java路线的程序员,但因入行时间太短,至今没有发现较为称手开源的博客程序,如果各位大神有好的推荐,也希望 ...

  8. Linux手动搭建LAMP环境

    当你看到标题里的“手动搭建”,你是不是会想,难不成还有“自动搭建”?当然......不是,这里的“手动搭建”是指按部就班的搭建Apache.MySQL.PHP环境,是相对于集成软件包而言的.所以你是不 ...

  9. 在CentOS 上搭建nginx来部署静态页面网站

    在centOs 上搭建nginx来部署静态页面网站 一.部署服务器环境 nginx:轻量级.高性能的HTTP及反向代理服务器,占用内存少,并发能力强,相比老牌的apache作为web服务器,性能更加卓 ...

随机推荐

  1. SVN讲解

    1.SVN是什么? 代码版本管理工具 它能记住你每次的修改 查看所有的修改记录 恢复到任何历史版本 恢复到已经删除的文件 2.SVN和Git相比,有什么优势? 使用简单,上手快 git没有目录级权限控 ...

  2. 【C/C++】面相对象开发之封装

    封装继承多态是面向对象程序开发的基础概念.是实现面向对象的基本要素. 封装 程序开发,最核心价值,是数据. 程序其实是读取数据,操作数据,保存数据等一系列操作. 那么经过良好组织过的数据,将使编程事半 ...

  3. 配置动态刷新RefreshScope注解使用局限性(一)

    在 Spring Cloud 体系的项目中,配置中心主要用于提供分布式的配置管理,其中有一个重要的注解:@RefreshScope,如果代码中需要动态刷新配置,在需要的类上加上该注解就行.本文分享一下 ...

  4. 【CTF】图片隐写术 · 盲水印

    前言 盲水印同样是CTF Misc中极小的一个知识点,刚刚做到一题涉及到这个考点的题目. 感觉还挺有意思的,就顺便去了解了下盲水印技术. 数字水印 数字水印(Digital Watermark)一种应 ...

  5. Spring 学习笔记(三):Spring Bean

    1 Bean配置 Spring可以看做是一个管理Bean的工厂,开发者需要将Bean配置在XML或者Properties配置文件中.实际开发中常使用XML的格式,其中<bean>中的属性或 ...

  6. IDEA中Maven本地仓库与镜像配置

    1 Maven Maven是一个用于项目构建与管理的工具,IDEA自带了Maven,在安装目录下的 plugins\maven\lib\maven3 IDEA也可以集成使用非自带的Maven,也就是自 ...

  7. jasypt-spring-boot提示Failed to bind properties

    1 问题描述 在Spring Boot中使用jasypt-spring-boot进行加密,但是提示: Description: Failed to bind properties under 'spr ...

  8. 【原创】【基础】一文搞懂严蔚敏数据结构SqList &L和SqList L、ElemType &e和ElemType e

    旁白 最近小渔夫在看严蔚敏.李冬梅<数据结构 c语言版>(第2版),学到第二章顺序表的实现时,看到函数参数一会是SqList &L.一会又是SqList L.一会ElemType ...

  9. 基于Docker配置本地Gitlab

    技术背景 Github和Gitee(码云)是最常见的基于git的代码托管平台,现在基于svn的代码管理仓库已经相对比较少见了,大部分还都是企业内部的代码仓.但是基于开源的Gitlab,我们在企业内网也 ...

  10. hdu1287 破译密码

    题意: 破译密码 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...