WordPress在OpenShift Origin中使用官方示例



我已经按照origin/examples/WordPress中的说明安装了All-In-One OpenShift Origin Virtual Machine (Version 1.1.6)并部署了WordPress。我选择了NFS存储

我需要知道:

  1. 当我在/home/data/pv0002ls时,它会按预期显示MySQL文件。但当我ls进入/home/data/pv0001时,它什么也没显示!WordPress文件不是必须在那里吗?

  2. 当我尝试在WordPress中上传媒体时,它会显示一条错误消息,如下面的

    Unable to create directory wp-content/uploads/2016/05. Is its parent directory writable by the server?

    我该怎么办才能解决这个问题?

  3. 当我尝试安装新主题时,它会要求提供ftp凭据。我该怎么做才能得到它?

POD 日志

warning: both WORDPRESS_DB_HOST and MYSQL_PORT_3306_TCP found
  Connecting to WORDPRESS_DB_HOST (mysql)
  instead of the linked mysql container
WordPress not found in /var/www/html - copying now...
WARNING: /var/www/html is not empty - press Ctrl+C now if this is an error!
+ ls -A
+ sleep 10
.htaccess
tar: ./index.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./license.txt: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./readme.html: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-activate.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/about.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin-ajax.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin-footer.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin-functions.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin-header.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin-post.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: ./wp-admin/admin.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
...
tar: ./xmlrpc.php: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: .: Cannot utime: Operation not permitted
tar: .: Cannot change ownership to uid 33, gid 33: Operation not permitted
tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted
tar: Exiting with failure status due to previous errors 

从Centos 7开始,我完成了以下步骤,一切都很顺利。重要步骤是345。并且无需将受限制的scc编辑为RunAsAny。

步骤1:

# systemctl status docker
# systemctl status nfs

步骤2:启动集群

步骤3:

# mkdir -p /home/data/pv0001
# mkdir -p /home/data/pv0002
# chmod -R 777 /home/data/
# chown -R nfsnobody:nfsnobody /home/data/

步骤4:

# cat /etc/exports
/home/data/pv0001 *(rw,sync,no_root_squash)
/home/data/pv0002 *(rw,sync,no_root_squash)
# exportfs -a
# setsebool -P virt_use_nfs 1

第5步:以及来自wordpress项目的system:admin

# oadm policy add-scc-to-user anyuid -z default

这意味着允许该项目中的容器以root身份运行。

第6步:部署wordpress

最新更新