配置openEuler
在华为云openEuler 安装后,没有配置yum源,我们通过重新配置。
cd /etc/yum.repos.d
增加下面内容:
[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 php-hash php-json php-mbstring php-mysqli php-openssl php-pcre php-xml libsodium
通过下面命令安装交互更加良好的nano 文本编辑器:
yum install nano
通过下面命令查看Apache和mariadb的运行状态:
systemctl status http
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.con
编辑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,下面,部署,命令,实验,org,openEuler,php From: https://www.cnblogs.com/Plame/p/17004769.html