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

实验八-Web部署

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

参考https://www.cnblogs.com/rocedu/p/16929895.html和附件视频,基于LAMP部署wordpress,提交自己部署过程博客
1. 遇到的问题和解决过程
2. 对实验的建议

配置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 Server 是最流行的开源关系型数据库之一。它由 MySQL 的原始开发者制作,并保证保持开源。它是大多数云产品的一部分,也是大多数 Linux 发行版的默认配置。MariaDB 被设计为 MySQL 的直接替代产品,具有更多功能,新的存储引擎,更少的错误和更好的性能。

通过下面命令安装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 php-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

通过下面命令创建用户给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

遇到问题
1.第一次在访问ip/wp-config.php上卡了壳
认真听取老师讲解,又询问了同学明白了用华为云虚拟机的ip。

标签:Web,mariadb,下面,部署,repo,实验,org,openEuler,php
From: https://www.cnblogs.com/20031004wzy/p/17004732.html

相关文章

  • 实验六
    #include<stdio.h>#include<stdlib.h>intmain(){FILE*fp;charal;intcount=0;fp=fopen("C:\\date4.txt","r");if(fp==NULL){prin......
  • 实验八-Web部署
    配置openEuler在华为云openEuler安装后,没有配置yum源,我们通过重新配置。cd/etc/yum.repos.d  增加下面内容:[OS]name=OSbaseurl=http://repo.openeuler.org/openE......
  • 14款web前端常用的富文本编辑器插件
    富文本编辑器是一种可内嵌于浏览器,所见即所得的文本编辑器。它提供类似于OfficeWord的编辑功能,方便那些不太懂html用户使用,富文本编辑器的应用非常广泛,它的历史与图文网页......
  • 20221414徐鹿鸣的实验八-Web部署
    过程与老师博客基本相同。(之前卡崩了导致没截图)遇到的问题和解决过程1.如何退出MariaDBexit2.如何退出编辑Apache的配置文件以nano开头编辑文件的,则要退出,按【Ctr......
  • Jenkins 部署
     1 修改jenkins的根目录,默认地在C:\DocumentsandSettings\AAA\.jenkins。.jenkins├─jobs│ └─JavaHelloWorld│     ├─builds│     │ ├─20......
  • 实验6
    #include<stdio.h>#include<stdlib.h>intmain(){FILE*fp;charal;intcount=0;fp=fopen("C:\\data4.txt","r");if(fp==NULL){......
  • 实验5
    实验任务3#include<stdio.h>#include<string.h>#defineN100typedefstruct{charnum[10];//学号ints1;//期末成绩int......
  • 如何用webgl(three.js)搭建一个3D库房,3D仓库3D码头,3D集装箱,车辆定位,叉车定位可视
    使用three.js(webgl)搭建智慧楼宇、3D园区、3D厂房、3D码头、3D海关、3D仓库、3D定位、三维室内定位、设备检测、数字孪生、物联网3D、物业3D监控、物业......
  • 实验五
    #include<stdio.h>#include<string.h>#include<stdlib.h>#defineN100typedefstruct{charnum[10];//学号ints1;//期末成绩ints2;//平时成绩doubles......
  • 如何使用webgl(three.js)实现3D储能,3D储能站,3D智慧储能、储能柜的三维可视化解决方
    3D储能、3D配电站、3D太阳能、三维储能、使用three.js(webgl)搭建智慧楼宇、3D园区、3D厂房、3D仓库、设备检测、数字孪生、物联网3D、物业3D监控、物业......