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

实验八-Web部署

时间:2022-12-22 18:44:06浏览次数:50  
标签:LTS Web 部署 repo 实验 org openEuler php 20.03

实验步骤

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

输入命令以切换到rpos目录下

cd /etc/yum.repos.d

输入命令更换yum源

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
  1. 开始安装LAMP

在当前目录下输入以下命令以安装Apache服务

yum install -y httpd

输入命令开启Apache服务

systemctl start httpd.service

关闭防火墙并且禁止防火墙自启动

systemctl stop firewalld
systemctl disable firewalld

安装MariaDB Server ,输入命令

yum install -y mariadb-server

给mysql数据库‘root’用户设置密码‘123456’,输入以下命令

mysqladmin -uroot password '123456'

输入命令安装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

安装更适合php的nano编辑器以适应下步编辑wp-config.php文件

输入命令

yum install nano

检查Apache和mysql运行状态

输入命令

systemctl status httpd
systemctl status mariadb

在edge中输入华为云IP出现如下界面证明Apache正常开启

安装wget,输入命令

yum install -y wget

安装wordpress,输入命令

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

3.创建数据库

输入命令,登录到mysql

mysql -uroot -p

输入命令

create database wordpressdb;

4.解压并且配置wordpress

输入命令下载解压工具

yum install -y unzip

解压到其他目录,输入命令

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

赋给用户权限

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

配置apache,输入命令

cd /var/www/wordpress

配置文件

nano wp-config.php

将以下内容输入

点击查看代码
*@link https://wordpress.org/support/article/editing-wp-config-php/

*@package WordPress

*/
/**

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpressdb' );

/** Database username */
define( 'DB_USER', 'root' );

/** Database password */
define( 'DB_PASSWORD', '123456' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

/**#@+

5.访问网址

输入

ip/wp-config.php

注册下载安装

遇见的问题和解决过程

  • 在进入网页时一直发送错误

解决方法:询问老师,发现有两点问题:
1. httpd.conf 没后配好 2.wp-config.php 的权限不对

  • wp-config.php 文件一直有问题

    解决方法:使用班群里老师发的文件,直接复制到相应文件夹中

  • 使用nano时对相应指令不了解

    解决方法:上网查询一些快捷指令

对实验的建议:

实验整体有点迷糊,不知道自己在哪一步出现了问题,建议可以分段检验(类似实验七)

标签:LTS,Web,部署,repo,实验,org,openEuler,php,20.03
From: https://www.cnblogs.com/wcx12345/p/16999274.html

相关文章

  • vue-cli · Failed to download repo vuejs-templates/webpack: connect ETIMEDOUT 39
    1.查看vue、node、webpack是否安装  2.vue安装 2.1安装cnpmnpminstall-gcnpm--registry=http://registry.npm.taobao.org 2.2安装vuecnpminstall-g@v......
  • centos7通过Ambari2.74部署Hadoop
    一、前言服务器:建议第一台内存不少于16G,其他可以8G 软件版本:资源链接:链接:https://pan.baidu.com/s/17GWF0opxYl0MIm2LJNUGRg?pwd=iq4l提取码:iq4l 二、部署前环境......
  • 实验5 结构体应用编程
    1#define_CRT_SECURE_NO_WARNINGS2#include<stdio.h>3#include<string.h>4#defineN10056typedefstruct{7charnum[10];//学号8......
  • 实验八-Web部署
    配置openEuler在华为云openEuler安装后,没有配置yum源,我们通过重新配置。cd/etc/yum.repos.dviopenEuler_x86_64.repo增加下面内容:[OS]name=OSbaseurl=http:/......
  • javaweb总结4-servlet基础
    正如ASP.NET的核心是IHttpHandler一样,JavaWeb的核心是Servlet接口,位于javax.servlet命名空间中。Filter的概念可以参考ASP.NET的HttpModule,Servlet中的各种Listener可以参......
  • javaweb总结3-Maven Web项目的基本结构
    鉴于目前JavaIDE众多并且都有一定的拥泵,Eclipse的JavaWeb项目不具有可移植性。Maven即解决了项目结构的规范问题又提供了强大引用处理等强大的功能,在项目布局等方面已经......
  • javaweb总结5-自定义Session
    Session在存储安全性要求较高的会话信息方面是必不可少的,Session当然绝对不是用来存储用户登录状态的,但类似验证码等敏感信息却必须存储在Session中。对于分布式Web应用自......
  • 静态WEB几项缺点
    1、Web页面中的内容无法动态更新,所有的用户每时每刻看见的内容和最终效果都是一样的。为了可以让静态的WEB的显示更加好看,可以加入了JavaScript以完成一些页面上的显......
  • 动态web
    所谓的动态不是指页面会动,主要的特性的是:“WEB的页面展示效果因时因人而变”,而且动态WEB具有交互性,WEB的页面的内容可以动态更新。整个动态WEB操作的过程图如下:动态W......
  • Linux部署docker镜像之PHP项目的Dockerfile步骤
    二、Docker部署步骤1、项目编译成镜像请cd到和Dockerfile同目录;例如:cd/home/docker dockerbuild-twebsite:latest.2、查看镜像并创建容器 dockerimages ......