首页 > 其他分享 > 实验八-Web部署

实验八-Web部署

时间:2022-12-25 20:22:17浏览次数:39  
标签:Web mariadb 下面 部署 repo 实验 org openEuler php

openEuler中基于LAMP部署WordPress

实验过程

一、配置openEuler

在华为云openEuler 安装后,没有配置yum源,我们通过重新配置。

cd /etc/yum.repos.d

vi openEuler_x86_64.repo 

增加下面内容:

[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler

[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/RPM-GPG-KEY-openEuler

[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler

[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/RPM-GPG-KEY-openEuler

[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/source/RPM-GPG-KEY-openEuler

[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler

二、安装LAMP

在shell中 通过下面命令安装Apache:

yum install -y httpd 


通过下面命令开启Apache服务:

systemctl start httpd.service


通过下面命令,设置Apache开机自启动:

systemctl enable httpd.service


系统默认启动防火墙,会导致我们无法访问网站,通过下面命令关闭防火墙:

systemctl stop firewalld

通过下面命令禁止防火墙自启动:

systemctl disable firewalld


通过下面命令安装mariadb:

yum install -y mariadb-server





通过下面命令开启mariadb服务:

systemctl start mariadb


通过下面命令设置mariadb开机自启动:

systemctl enable mariadb


通过下面命令给mariadb数据库的root账户设置密码123456:

mysqladmin -uroot password '123456'


通过下面命令安装PHP和PHP模块:

yum install -y php


yum install -y php-mysqlnd php-fpm php-opcache php-cli php-curl php-dom php-exif php-fileinfo php-gd ph`p-hash php-json php-mbstring php-mysqli php-openssl php-pcre php-xml libsodium






通过下面命令安装交互更加良好的nano 文本编辑器:

yum install nano



通过下面命令查看Apache和mariadb的运行状态:

systemctl status httpd

systemctl status mariadb


通过下面命令查看Apache和mariadb是否已经开启了开机自启动:

systemctl list-unit-files | grep httpd.service

systemctl list-unit-files | grep mariadb.service


通过下面命令查看PHP的版本信息:

php -v


通过下面命令创建一个PHP测试文件测试PHP是否正常,输出重定向到test.php文件:

echo "<?php phpinfo();  ?>" > /var/www/html/test.php


通过下面命令给这个文件赋权限:

chmod 755 /var/www/html/test.php


通过下面命令重启Apache服务:

systemctl restart httpd

三、安装部署wordpress

通过下面命令安装wget:

yum install -y wget


通过下面命令请求wordpress安装包(.ZIP):

wget https://cn.wordpress.org/latest-zh_CN.zip


通过下面命令查看mariadb的版本号:

rpm -qa | grep mariadb


通过下面命令登录到mariadb:

mysql -uroot -p


通过下面命令创建WordPress数据库:

create database wordpressdb;



通过下面命令安装unzip解压工具:

yum install -y unzip


解压latest-zh_CN.zip到/var/www目录下

unzip latest-zh_CN.zip -d /var/www


通过下面命令创建用户给Apache权限:

chown -R apache:apache /var/www/wordpress
chmod -R 755 /var/www/wordpress/


编辑Apache的配置文件:

nano /etc/httpd/conf/httpd.conf


编辑Apache的欢迎页面,将其内容都注释掉:

nano /etc/httpd/conf.d/welcome.conf

重启Apache服务:

systemctl restart httpd

转到下面这个文件夹:

cd /var/www/wordpress

创建 wp-config.php 文件:

nano wp-config.php


访问ip/wp-config.php

标签:Web,mariadb,下面,部署,repo,实验,org,openEuler,php
From: https://www.cnblogs.com/feng-tairui/p/16996014.html

相关文章

  • 实验6
    #include<stdio.h>#include<stdlib.h>#pragmawarning(disable:4996)intmain(){FILE*fp;intcount=0;fp=fopen("data4.txt","r");if(fp......
  • 网页大作业——上海美食8页网页实验报告
    一、实验目的和要求1.了解HTML文档结构,学习如何编写HTML文档;;2.初步掌握基本标记的使用;练习使用HTML中最基本的一些标签,如定义标题、段落及标记文字的显示格式、背景图片......
  • 实验八-Web部署
    一、部署过程1.安装华为云openEuler2.配置openEuler在华为云openEuler安装后,没有配置yum源,我们通过重新配置。增加下面内容:3.安装LAMP安装Apache,开启Apache服务,设......
  • 实验6
    task4#include<stdio.h>#include<stdlib.h>intmain(){FILE*fp;intcount=0;fp=fopen("data4.txt","r");if(fp==NULL){printf("failtoopenthefile");return......
  • 实验6 文件应用编程
    1#define_CRT_SECURE_NO_WARNINGS2#include<stdio.h>3intmain()4{5intnum=0;6FILE*fp;7charch;8if((fp=fopen("data4.tx......
  • [ 成为架构师系列 ] 1. 第一个 Java Web 程序
    [成为架构师系列]1.第一个JavaWeb程序1.新建mavenwebapp工程打开idea,NewProject,选择Maven,从maven-archetype创建,找到maven-archetype-webapp:......
  • web服务器
              ......
  • 实验八
    部署过程配置华为云服务器  安装程序dnfinstallhttpdmysql-serverphpphp-mysqlndphp-fpm    启用Apachesystemctlstarthttpd.se......
  • 实验七-缓冲区溢出
    一、实验指导书内容1.实验准备系统用户名shiyanlou实验楼提供的是64位Ubuntulinux,而本次实验为了方便观察汇编语句,我们需要在32位环境下作操作,因此实验之前需要......
  • javaweb基本概念
        web应用程序编写完毕后,若要提供给外界访问:需要一个服务器统一管理。       ......