Ask Your Question
0

how to reach keystone rest api through httpd

asked 2014-07-10 08:11:45 -0600

anonymous user

Anonymous

Hi,

I want to use keystone in HTTPD, configuration is almost done. on localhost:80/keystone/admin and main answer me an xml document. But I don't know, how to use its REST API. I must admit I'm not an apache expert, and maybe what I ask is not neccesarily a keystone matter, but when I'm using keystone through Apache how can I use its REST API like http://localhost:5000/v3/auth/tokens (http://localhost:5000/v3/auth/tokens?) I reckon Apache understands it as path and it is why I get 404.

Is there any apache config I didn't set or I call keystone wrong?

Regards,

Gergő

curl -i http://localhost:5000/v3/auth/token -X POST -H "Content-Type: application/json"   -d '
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "admin",
      "domain": { "id": "default" },
          "password": "secrete"
        }
      }
    }
  }
}' 

HTTP/1.1 404 Not Found
Date: Thu, 10 Jul 2014 12:43:10 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 288
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /v3/auth/token was not found on this server.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at localhost Port 5000</address>
</body></html>
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2014-07-10 11:14:37 -0600

updated 2014-07-10 11:15:25 -0600

How did you configure Apache? Can you paste your mod-wsgi configuration file from sites-available directory in apache ?

edit flag offensive delete link more
0

answered 2014-07-11 00:53:55 -0600

pintergreg gravatar image

I use the standard config from github, currently without NSS/SSL and of course with proper path.

WSGIScriptAlias /keystone/main  /var/www/cgi-bin/keystone/main
WSGIScriptAlias /keystone/admin  /var/www/cgi-bin/keystone/admin

<Location "/keystone">
# NSSRequireSSL
 Authtype none
</Location>
edit flag offensive delete link more

Comments

As I expected the solution was apache (and wsgi) related: Adding this solved my problem.Now I can get token with python-keystoneclient

WSGIScriptAliasMatch ^(/v3/.*?)$ /var/www/cgi-bin/keystone/main/$1
pintergreg gravatar imagepintergreg ( 2014-07-11 05:19:41 -0600 )edit

That should do it. Now you may have problem with v2 apis. Instead you can do

WSGIScriptAlias / /var/www/cgi-bin/keystone/main WSGIScriptAlias / /var/www/cgi-bin/keystone/admi

Haneef Ali gravatar imageHaneef Ali ( 2014-07-11 11:02:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-07-10 08:11:45 -0600

Seen: 313 times

Last updated: Jul 11 '14