我已按照origin/examples/wordpress中的说明安装了All-In-One OpenShift Origin Virtual Machine (Version 1.1.6)
并部署了WordPress。
我选择了NFS storage
我需要知道:
当ls
进入/home/data/pv0002
时,它会按预期显示MySQL文件。但当我ls
进入/home/data/pv0001
时,它什么也没有显示!不是WordPress文件必须在那里吗?
当我尝试在WordPress中上传媒体时,它会显示如下错误消息
Unable to create directory wp-content/uploads/2016/05. Is its parent directory writable by the server?
我该怎么做才能解决这个问题?
当我尝试安装新主题时,它会要求提供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
答案 0 :(得分:0)
从Centos 7开始,我执行了以下步骤,一切都运行良好。重要的步骤是 3 , 4 和 5 。并且无需将受限制的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