How to configure WAMP to be RESTful?

Daryl Bennett

I'm trying to write a RESTful API for my Android app. I am trying to write the server in PHP, and I'm trying to host it on a WAMP server. I want to be able to GET, PULL, PUT, and DELETE. In class, our professor showed us an example of how he configured his server, but he used MAMP (for Macintosh), which seems to have a different file hierarchy than WAMP. He showed us that our index.php server file goes into this folder, and I'll use an api folder for the example:

  MAMP -> htdocs -> api -> index

When I access the URL localhost:8080/api/, it should execute a particular GET request.

He also noted that we needed to enable aliasing. So in the MAMP -> conf -> httpd.conf, we added Alias /quotes "/Applications/MAMP/htdocs/api/index.php".

But, I'm unable to get this work with my WAMP server. I noticed that it is a bit different in file heirarchy. To access the htdocs and conf folder I have to do the following:
WAMP->bin->apache->Apache2.4.4->htdocs
WAMP->bin->apache->Apache2.4.4->conf

and I modified my conf file as such: Alias /quotes "/WAMP/bin/apache/Apache2.4.4/htdocs/api/index.php"

So do I configure the WAMP differently? Do I need to move the conf and htdocs folders into the root WAMP folder? I tried putting my api into the WAMP->www directory, but it wouldn't work for the following GET request.

//GET /api/2 Gets someone based on primary key

I tried looking at many tutorials, and I found many that were great in explaining API's and how to code an API that handles requests, but I was unable to find one that shows how to configure the server and get that working.

Any help, explanations, links to resources would be helpful and very appreciated. Thank you

Daryl Bennett

I found the solution:

I needed to put my api folder in the c:/wamp/www folder.
My httpd.conf was in the right spot. (/bin/apache/Apache2.4.4/conf), but my line for aliasing was incorrect, it should have been:
Alias /quotes "c:/wamp/www/api/index.php"

The URL i needed to navigate was:
http://localhost:8080/quotes (Because I aliased it.)

And of course, I needed to restart my WAMP server once I modified the httpd.conf file.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to configure WAMP to be RESTful?

From Dev

How do I configure CakePHP to run on WAMP without using bin\cake server or :8765?

From Dev

how to configure facebook api in localhost in xampp or wamp server? what is php.ini settings requirement to use it?

From Dev

C# configure RESTful routes

From Dev

How to configure a project to use a JSON provider with jersey-restful web services

From Dev

How can I configure logging to log CXF inbound and outbound restful messages?

From Dev

Configure wamp server to SVN on Windows 7 64-bit

From Dev

Configure wamp server to SVN on Windows 7 64-bit

From Dev

How to install ImageMagick for WAMP 2.5

From Dev

WAMP, how to redirect if ip is not authorized

From Dev

How to bring wamp server online?

From Dev

How to install Bugzilla using WAMP ?

From Dev

How to downgrade Wamp MySQL version?

From Dev

How to test WAMP-Services?

From Dev

How to use wamp with JSR 356?

From Dev

how to add wamp feature to lamp

From Dev

WAMP: How to Host and Download a file?

From Dev

How to test WAMP-Services?

From Dev

How to send Email with PhpMailer and WAMP

From Dev

How to fix wamp server running different wamp server folder

From Dev

How to parse a RESTful URL

From Dev

How to protect RESTful service?

From Dev

How to be RESTful in Ruby on Rails?

From Dev

Configure Ember's back-end to communicate with a RESTful service

From Dev

How to use wsdl2phpgenerator on WAMP

From Java

How to log in to phpMyAdmin with WAMP, what is the username and password?

From Dev

How to not allow localhost point to my alias in WAMP?

From Dev

How to install 5.2 version of PHP in wamp

From Dev

WAMP.ws : How to manage security and privacy?

Related Related

HotTag

Archive