Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

乱码问题 #18

Open
peter-cls opened this issue Feb 8, 2020 · 14 comments · May be fixed by #20
Open

乱码问题 #18

peter-cls opened this issue Feb 8, 2020 · 14 comments · May be fixed by #20

Comments

@peter-cls
Copy link

您好,现在部署后出现乱码,发现是没有申明utf8导致的,请问在哪里修改?

@peter-cls
Copy link
Author

Hello, there is a mess after deployment. It is found that utf8 was not declared. Where can I change it?

brlin-tw added a commit to brlin-tw/docker-webdav that referenced this issue Apr 15, 2020
Fixes BytemarkHosting#18.

Credit-goes-to: CentOS7下安装Apache WebDAV教程 – NT宝贝网 <https://ntbaobei.com/?p=333>
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
@brlin-tw brlin-tw linked a pull request Apr 15, 2020 that will close this issue
@brlin-tw
Copy link

Hello, I proposed a fix in the PR. Cheers!

@peter-cls
Copy link
Author

请问能更新hub.docker的文件吗?不会改代码这种!

@xmu714
Copy link

xmu714 commented May 10, 2020

请问能更新hub.docker的文件吗?不会改代码这种!

你好,我今天也发现了这个问题。简单的解决办法是通过这个容器的终端进去
vi conf/conf-enabled/dav.conf
添加UTF8声明,然后重启容器,就解决了乱码。但是这个文件会随着容器更新被覆盖,所以可以把修改的文件放到宿主机,然后映射到conf/conf-available/dav.conf

@peter-cls
Copy link
Author

请问能更新hub.docker的文件吗?不会改代码这种!

你好,我今天也发现了这个问题。简单的解决办法是通过这个容器的终端进去
vi conf/conf-enabled/dav.conf
添加UTF8声明,然后重启容器,就解决了乱码。但是这个文件会随着容器更新被覆盖,所以可以把修改的文件放到宿主机,然后映射到conf/conf-available/dav.conf

非常感谢,请问申明的命令怎么写?文件内容如下

DavLockDB "/var/lib/dav/DavLock"
Alias / "/var/lib/dav/data/"
<Directory "/var/lib/dav/data/">
Dav On
Options Indexes FollowSymLinks

AuthType Digest
AuthName "WebDAV"
AuthUserFile "/user.passwd"

Require valid-user

These disable redirects on non-GET requests for directories that

don't include the trailing slash (for misbehaving clients).

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[01234]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
BrowserMatch " Konqueror/4" redirect-carefully
BrowserMatch "^gvfs" redirect-carefully

@wyxls
Copy link

wyxls commented Jul 12, 2020

请问能更新hub.docker的文件吗?不会改代码这种!

你好,我今天也发现了这个问题。简单的解决办法是通过这个容器的终端进去
vi conf/conf-enabled/dav.conf
添加UTF8声明,然后重启容器,就解决了乱码。但是这个文件会随着容器更新被覆盖,所以可以把修改的文件放到宿主机,然后映射到conf/conf-available/dav.conf

非常感谢,请问申明的命令怎么写?

原image默认没有这一行,需要手动添加后再重启容器,但image更新的话又会被覆盖掉。推荐2个方法避免更新覆盖dav.conf
1、在宿主机外置保存修改好的dav.conf,然后通过volume挂载到对应路径(/usr/local/apache2/conf/conf-available/dav.conf),注意文件权限问题
2、自己build一个image,直接将声明UTF-8内置

<Directory "/var/lib/dav/data/">
  Dav On
  Options Indexes FollowSymLinks

  AuthType Basic
  AuthName "WebDAV"
  IndexOptions Charset=utf-8      <-----------添加这一行
  AuthUserFile "/user.passwd"
  <RequireAny>
    Require valid-user
  </RequireAny>
</Directory>

@peter-cls
Copy link
Author

IndexOptions Charset=utf-8

问题解决了,多谢!!此镜像应该不会更新了!

@xmu714
Copy link

xmu714 commented Jul 12, 2020

@wyxls 感谢层主的方法,我之前在做覆盖的时候,直接从它的命令里面找的源路径conf/conf-available/dav.conf
结果依然被覆盖,看了你的回复才想起来要用绝对路径。

@wyxls
Copy link

wyxls commented Jul 12, 2020

@wyxls 感谢层主的方法,我之前在做覆盖的时候,直接从它的命令里面找的源路径conf/conf-available/dav.conf
结果依然被覆盖,看了你的回复才想起来要用绝对路径。

其实Dockerfile里有注释,httpd:alpine镜像拉取后默认workdir是/usr/local/apache2

# These variables are inherited from the httpd:alpine image:
# ENV HTTPD_PREFIX /usr/local/apache2
# WORKDIR "$HTTPD_PREFIX"

@peter-cls
Copy link
Author

peter-cls commented Jul 12, 2020

@wyxls @xmu714 感谢层主的方法,我之前在做覆盖的时候,直接从它的命令里面找的源路径conf/conf-available/dav.conf
结果依然 被覆盖,看了你的回复才想起来要用绝对路径。

请问是要映射/usr/local/apache2嘛?我映射了也没有dav.conf这个文件?

@peter-cls
Copy link
Author

@wyxls 感谢层主的方法,我之前在做覆盖的时候,直接从它的命令里面找的源路径conf/conf-available/dav.conf
结果依然被覆盖,看了你的回复才想起来要用绝对路径。

其实Dockerfile里有注释,httpd:alpine镜像拉取后默认workdir是/usr/local/apache2

# These variables are inherited from the httpd:alpine image:
# ENV HTTPD_PREFIX /usr/local/apache2
# WORKDIR "$HTTPD_PREFIX"

我注意到这里的/usr/local/apache2/conf/conf-available/dav.conf 是不是应该conf-enable,我映射/usr/local/apache2/conf/conf-enable/dav.conf 或者/usr/local/apache2/conf/conf-enable 都不行啊,然后/usr/local/apache2/conf/conf-enable/dav.conf 也不行

@wyxls
Copy link

wyxls commented Jul 13, 2020

@wyxls 感谢层主的方法,我之前在做覆盖的时候,直接从它的命令里面找的源路径conf/conf-available/dav.conf
结果依然被覆盖,看了你的回复才想起来要用绝对路径。

其实Dockerfile里有注释,httpd:alpine镜像拉取后默认workdir是/usr/local/apache2

# These variables are inherited from the httpd:alpine image:
# ENV HTTPD_PREFIX /usr/local/apache2
# WORKDIR "$HTTPD_PREFIX"

我注意到这里的/usr/local/apache2/conf/conf-available/dav.conf 是不是应该conf-enable,我映射/usr/local/apache2/conf/conf-enable/dav.conf 或者/usr/local/apache2/conf/conf-enable 都不行啊,然后/usr/local/apache2/conf/conf-enable/dav.conf 也不行

conf/conf-enable里的dav.conf是个软链接,实际文件是conf/conf-available/dav.conf
容器启动后会读取改动这个文件,单纯挂载覆盖还可能有权限问题,所以我个人最推荐的方法还是直接build image,这样更方便彻底一点

xxjapp added a commit to xxjapp/docker-webdav that referenced this issue Jun 10, 2024
@lgy1027
Copy link

lgy1027 commented Sep 10, 2024

这个有没有弄好的镜像,进容器内修改在启动如果设置不同的账号密码就无法登录了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants