与openshift Apache服务器上设置身份验证 [英] Set authentication on Apache server with openshift

查看:138
本文介绍了与openshift Apache服务器上设置身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读到这 http://www.apacheweek.com/features/userauth 和我尽量做到在Openshift相同的,但我不知道怎么办。

I read this http://www.apacheweek.com/features/userauth and I try to accomplish the same in Openshift but i don't know how.

即时通讯使用RHC,我试图跨越SSH连接到我的应用程序,但我没有权限使用须藤苏让我无法继续下去。

Im using rhc and I tried to connect across ssh to my app, but I don't have permissions to use sudo su so I can't continue.

例如,当我尝试创建文件纳米的/ usr /本地/ etc / httpd的我不能,因为我没有root权限。

For example when I try to create the file nano /usr/local/etc/httpd I can't because I don't have root privileges.

> ls -la /usr/local/etc
total 20
drwxr-xr-x.  2 root root 4096 jun  5 20:58 .
drwxr-xr-x. 14 root root 4096 dic 11  2013 ..
-rw-r--r--.  1 root root 1807 may 19 15:23 oom-kill-disable.conf
-rw-------.  1 root root 1675 may 21 14:51 ops_file_transfer_upload_id_rsa
-rw-r-----.  1 root root  399 jun  5 20:58 partitioner_disk_definitions.yaml

如果我有一个错误的做法,我将AP preciate可以引导我。

If I have a wrong approach i would appreciate you can guide me.

更新
由于@davelopercorey建议现在,我使用.htaccess文件

UPDATE As @davelopercorey suggest now I'm using .htaccess file

AuthType Basic
AuthName "Authentication"
AuthUserFile ${OPENSHIFT_REPO_DIR}.htpasswd
Require valid-user

和添加用户和他的密码

htpasswd -cb .htpasswd myuser mypass

身份验证提示显示,但我的用户和传球都没有验证很好。

Authenticating prompt is showing but my user and pass are not validating well.

我用 whereis的htpasswd 来保证我写正确的路径和问题仍然存在。

I have use whereis htpasswd to ensure im writing the correct path and issues still persists.

推荐答案

如果您使用的是支持的.htaccess文件(如Python或PHP)墨盒中的一个,你可以把你htpasswd文件在文件系统中的任何位置。我建议把它放在你的〜/应用程序根/ data目录下,然后就可以在该位置从.htaccess文件指向它并使用基于你把你的.htaccess文件中针对不同的规则,你想要的认证文件类型或目录等。

If you are using one of the cartridges that supports .htaccess files (such as python or php), you can put your .htpasswd file anywhere in the file system. I suggest placing it in your ~/app-root/data directory, then you can point to it from your .htaccess file at that location and use the authentication that you want based on the rules that you put in your .htaccess file for different file types or directories, etc.

这篇关于与openshift Apache服务器上设置身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆