Setup of Lucee REST Web Services on Apache
I was pulling my hair out to get Lucee 4.5 to recognize REST CFCs on my Amazon EC2 server running Apache. I am really writing this up as notes so I can find it later.
Step 1
Go to the /etc/httpd/conf directory on your linux machine and edit the httpd.conf file.
nano httpd.conf
ctrl-w /rest
remove the # from the begining of
ProxyPassMatch ^/rest/(.*)$ http://127.0.0.1:8888/rest/$1
ctrl-x
save changes? Y
service httpd restart
Step 2
Create a folder in your Lucee root for you test.
mkdir /var/www/html/api/
cd /var/www/html/api/
nano hello.cfc
<cfcomponent rest="true" restpath="/hello">
<cffunction name="myHello" access="remote" returnType="String" httpMethod="get" restPath="/world">
<cfset res="Hello World!">
<cfreturn res>
</cffunction>
</cfcomponent>
Step 3
Login to the Lucce admin and click on the Rest option on the side bar.
For now enable the List services.
Create a new mapping for /test /var/www/html/api/
Step 4
Open a web browser and got to : http://yourserver.com/rest/ and hit enter.
You should see :
Available sevice mappings are:
*/rest/test
Then enter http://yourserver.com/rest/test/hello/world
You Should see:
"Hello World!"