LNMP环境--部署wordpress
【摘要】 LNMP环境这里没有安装mariadb,使用RDS云数据库 [root@node1 ~]# yum install -y nginx php-fpm php-mysql php [root@node1 ~]# vi /etc/nginx/nginx.conf server { location / { root /usr/share/nginx/...
LAMP环境
# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# yum install -y httpd mariadb-server mariadb unzip php72w php72w-mysql php72w-dom php72w-mbstring php72w-gd php72w-pdo php72w-intl php72w-fpm.x86_64
# systemctl start php-fpm
# systemctl start mariadb
# systemctl start httpd
owncloud
# unzip owncloud-complete.zip
# cp -r owncloud /var/www/html/
# chown -R apache:apache /var/www/html/owncloud/
(3)创建数据库
# mysqladmin -u root password "000000"
# mysql -uroot -p000000
MariaDB [(none)]> create database owncloud;
MariaDB [(none)]> grant all privileges on *.* to root@'%' identified by "000000";
MariaDB [(none)]> grant all privileges on *.* to root@'localhost' identified by "000000";
# systemctl restart httpd
# systemctl restart php-fpm
(4)初始化owncloud
使用浏览器访问http://IP/owncloud/index.php初始化owncloud
LNMP环境
这里没有安装mariadb,使用RDS云数据库
[root@node1 ~]# yum install -y nginx php-fpm php-mysql php
[root@node1 ~]# vi /etc/nginx/nginx.conf
server {
location / {
root /usr/share/nginx/html; #添加
index index.php index.html index.htm; #添加
}
location ~ \.php$ { #添加
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
}
[root@node1 ~]# vim /etc/php-fpm.d/www.conf
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
[root@node1 ~]# systemctl restart nginx php-fpm
wordpress
前提上文LNMP环境
[root@node1 ~]# tar -zxf wordpress-5.0.2-zh_CN.tar.gz
[root@node1 ~]# rm -rf /usr/share/nginx/html/*
[root@node1 ~]# cp -rfv wordpress/* /usr/share/nginx/html/
[root@node1 ~]# chmod 777 /usr/share/nginx/html/*
[root@node1 html]# cp wp-config-sample.php wp-config.php
[root@node1 ~]# cat /usr/share/nginx/html/wp-config.php
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'root');
/** MySQL数据库密码 */
define('DB_PASSWORD', 'Root123456');
/** MySQL主机 */
define('DB_HOST', '192.168.1.60:3306');
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)