实战-部署Ecshop电商网站

实验环境

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 /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

[root@localhost ~]# systemctl enable --now mariadb

Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.

Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.

Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /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解析

在 httpd 工作目录下写测试首页

[root@localhost ~]# vi /var/www/html/test.php

[root@localhost ~]# cat /var/www/html/test.php

phpinfo();

?>

测试浏览器是否可以访问 PHP 测试页面

六、上传Eschop电商网站

首先上传到服务器

[root@localhost ~]# ls

anaconda-ks.cfg ecshop.zip

将 ecshop.zip 解压到 /var/www/html/ 目录下

[root@localhost ~]# unzip ecshop.zip -d /var/www/html/

[root@localhost ~]# ls /var/www/html/

ecshop

七、授权

[root@localhost ~]# ps -aux |grep http

root 50481 0.0 0.6 275920 11328 ? Ss 22:22 0:00 /usr/sbin/httpd -DFOREGROUND

apache 50487 0.0 0.4 289792 8380 ? S 22:22 0:00 /usr/sbin/httpd -DFOREGROUND

apache 50488 0.0 0.8 1806364 16184 ? Sl 22:22 0:00 /usr/sbin/httpd -DFOREGROUND

apache 50489 0.0 0.8 1806364 16184 ? Sl 22:22 0:00 /usr/sbin/httpd -DFOREGROUND

apache 50490 0.0 0.8 1937492 16192 ? Sl 22:22 0:00 /usr/sbin/httpd -DFOREGROUND

root 51347 0.0 0.0 12112 1112 pts/0 R+ 22:30 0:00 grep --color=auto http

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

[root@localhost ~]# chmod -R 755 /var/www/html/ecshop/

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

电商 lamp java_搭建LAMP环境部署Ecshop电商网站相关推荐

  1. 阿里云服务器ECS centos7.4搭建nginx环境部署静态代码

    阿里云服务器ECS centos7.4搭建nginx环境部署静态代码 欢迎来到新手如何通过阿里云服务器部署静态网站 作为一个前端开发,第一次部署自己的私人网站,没有经验,战战兢兢,但是没有办法,成为全 ...

  2. [网络安全自学篇] 九十一.阿里云搭建LNMP环境及实现PHP自定义网站IP访问 (1)

    这是作者网络安全自学教程系列,主要是关于安全工具和实践操作的在线笔记,特分享出来与博友们学习,希望您喜欢,一起进步.本文主要分享作阿里云搭建LNMP环境及实现PHP自定义网站IP访问,同时详细介绍走过 ...

  3. cytoscape安装java_搭建java环境——安装GSEA和Cytoscape

    GSEA和Cytoscape的安装都需要java环境,所以首先要搭建好java环境.在搭建java环境之前新建一个虚拟环境,将java环境与外部环境隔绝起来.我使用的是conda建立的虚拟环境:con ...

  4. 猜丁壳java_搭建测试环境

    [JDK安装] 1.首先下载一个JDK版本,官网地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-21 ...

  5. 电商网站搭建——多环境部署、如何打War包

    一.SpringBoot多环境配置 SpringBoot会为我们提供profile多环境支持 application.yml是主配置文件,我们可以把主配置文件里的副配置提取出来,放在副配置文件里,比如 ...

  6. 搭建kafaka_Kafka 环境部署搭建

    一.基本概念介绍Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了普通消息系统的功能,但具有自己独特的设计.这个独特的设计是什么样的呢?首先让我们看几个基本的消息系统术语:Kafka将消息 ...

  7. 搭建java_搭建JAVA环境

    1 jdk的获取 jdk的获取路径有很多这种,我把我网盘上存的分享个大家,大家直接下载就可以了. http://pan.baidu.com/s/1pLsJLtp(这是一个公开链接,直接打开下载就可以了 ...

  8. 购买云服务器和搭建PHP环境,运行PHP个人网站

    1:首先需要购买云服务器 阿里云,百度云,腾讯云,华为云等那一家的都一样.我以腾讯云为例子说明,我买的是腾讯云. 1:本人学生,直接购买腾讯云10元一月的学生服务器.购买前需要先注册腾讯云的账号,账号 ...

  9. 快速搭建LAMP架构

    快速搭建LAMP架构 1.安装apache 2.部署mysql 3.部署php结合apache 4.验证 5.部署一个论坛disuz 1.安装apache [root@localhost ~]# yu ...

最新文章

  1. 不到 200 行代码,教你如何用 Keras 搭建生成对抗网络(GAN)
  2. Android http Request / Response ContentType
  3. qhfl-3 Course模块
  4. 利用正则匹配数字后边的字符_图解正则——字符匹配
  5. css3常用方法以及css3选择器
  6. ubuntu nginx php7,ubuntu 16 安装php7+nginx
  7. java保留有效数字
  8. “约见”面试官系列之常见面试题之第五十八篇之join和split(建议收藏)
  9. java webservice用户验证_使用java webservice的.net4.0 web app需要Usernametoken身份验证
  10. JQuery Ajax 全解析
  11. Zmail-简单易用的python邮件模块
  12. 通俗易懂的生产环境Web应用架构介绍
  13. mcgscom口针脚定义_【各种接口针脚定义]
  14. 桌面HTML更换图标,桌面图标怎么制作更换 桌面ico图标制作软件
  15. 人事档案信息管理系统的面向对象的分析、设计和实现
  16. python 3.7.0 小甲鱼 有道词典翻译 (error:50)问题解决
  17. Windows server 2008 密码策略不能修改的解决办法
  18. python_模块_包
  19. 计算机课学生段密码,启课程学生端电脑版
  20. Xgen Animwires 随笔01

热门文章

  1. B站 全套java面试(200道)问题MD(题目+答案)
  2. Java 驼峰命名转下划线命名(能正确处理连续HTTP等大写)
  3. win32消息处理和创建窗口
  4. u盘安linux、win等系统
  5. Java数据结构:图
  6. VSTO Shapes对象、ShapeRange对象和Shape对象的关系
  7. 高二会考计算机操作题试题及答案,2017高二数学会考试题及答案_高二会考答案(数学)(5)...
  8. 壳聚苯乙烯/单分散核-壳结构/中空/介孔二氧化硅微球的研究
  9. centos7-登录显示名称及登录欢迎界面设置
  10. 干货 | Python进阶之学习笔记(一)