How Do I Get Lucee To Process Files on Port 80?

478 views
Skip to first unread message

Jim Newton

unread,
Oct 20, 2016, 1:00:43 AM10/20/16
to Lucee
I have a new AWS EC2 instance running a LAMP stack with Amazon Linux, Amazon, Tomcat, MySQL, and Lucee (all the latest versions).  Everything runs perfectly on port 8888 for Lucee, and port 80 for all non-Lucee requests.

What is the best way to have Lucee respond to requests that come in through port 80, instead of just 8888?

I can post config files for Apache, Tomcat, Lucee, etc. if you tell me which ones you need to see.

Hugh Rainey

unread,
Oct 20, 2016, 3:40:51 PM10/20/16
to Lucee
Jim - You'll need to go into your main tomcat directory > conf > find the server.xml file.  Open server.xml with whatever text editor you like.  Do a search for "<Connector port".  You'll see:

<Connector port="8080" protocol="HTTP/1.1" etc. . . .

change the port value to "80".

You'll need to make sure there's not another service listening on that port like IIS or apache. 

Nando Breiter

unread,
Oct 20, 2016, 6:43:36 PM10/20/16
to lu...@googlegroups.com
I'm not sure Hugh's reply is the one you need, since I assume you'll have Apache running on port 80, but nevertheless is it the correct reply to your exact question.





Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/53761d87-fb37-4da6-97f2-5cbd7086959a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Igal @ Lucee.org

unread,
Oct 20, 2016, 6:52:22 PM10/20/16
to lu...@googlegroups.com

Yea, I agree with Nando.  IIUC then you want to set up a connector from Apache httpd to Tomcat, so that Lucee related requests will be forwarded to Tomcat.

I'm not very familiar with Apache httpd myself so someone else would need to help you with that if this is what you're looking for.

Igal Sapir
Lucee Core Developer
Lucee.org

To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Nando Breiter

unread,
Oct 20, 2016, 7:30:41 PM10/20/16
to lu...@googlegroups.com

I'm not very familiar with Apache httpd myself so someone else would need to help you with that if this is what you're looking for.

Igal and I use Nginx instead ... old blog post from the Railo days: https://dnando.github.io/blog/2015/01/05/advantages-of-nginx/ which includes a link to Igal's config guide: https://gist.github.com/igal-getrailo/6981111

You can set up Apache using a similar reverse proxy approach if you want. 

Jim Newton

unread,
Oct 20, 2016, 9:04:20 PM10/20/16
to Lucee

Hi Everyone...

I guess I didn't ask the right question.  ;)  Sorry, I'm a noob even though I did a lot of this stuff back in the late 1990s and early 2000s!  I really appreciate everyone's help so far.  You're all very generous to share your wisdom.

Let me try to restate:

Right now, if I browse to my server at "http://x.x.x.x/test1.html" (or "http://x.x.x.x:80/test1.html"), it goes to the Apache root which is at "/var/www/html" and displays the "test1.html" file, but obviously as expected, the "test1.html" file is not processed by Lucee.

If I browse to "http://x.x.x.x:8888/test2.html", it goes to the Lucee root, which is "/opt/lucee/tomcat/webapps/ROOT".  The "test2.html" file is correctly processed by Lucee ("test2.html" contains a simple database query).  BTW, I have already set up Lucee to process .HTM and .HTML files in addition to .CFM files.  That's working fine.

What I want is that if I browse to "http://x.x.x.x/test2.html" or "http://x.x.x.x:80/test2.html" on port 80, it goes to "/opt/lucee/tomcat/webapps/ROOT" and processes that "test2.html" file through Lucee.

Did I word this correctly?

Can I change the Tomcat server.xml line from port 8888 to 80 as mentioned by Hugh, and then change the configuration in Apache somehow to have Apache listen to a different port?  If so, which Apache config file and section would I need to change?

Or is there another way that this is usually done?  I'm not at all following the information in Igal's config guide that Nando kindy posted...I just don't know enough about modern Apache configurations anymore, and I know nothing about Nginx.

Thank you so much!!!

On Thursday, October 20, 2016 at 3:52:22 PM UTC-7, Igal wrote:

Yea, I agree with Nando.  IIUC then you want to set up a connector from Apache httpd to Tomcat, so that Lucee related requests will be forwarded to Tomcat.

I'm not very familiar with Apache httpd myself so someone else would need to help you with that if this is what you're looking for.

Igal Sapir
Lucee Core Developer
Lucee.org

On 10/20/2016 3:43 PM, Nando Breiter wrote:
I'm not sure Hugh's reply is the one you need, since I assume you'll have Apache running on port 80, but nevertheless is it the correct reply to your exact question.





Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

On Thu, Oct 20, 2016 at 9:16 PM, Hugh Rainey <hu...@fivetoad.com> wrote:
Jim - You'll need to go into your main tomcat directory > conf > find the server.xml file.  Open server.xml with whatever text editor you like.  Do a search for "<Connector port".  You'll see:

<Connector port="8080" protocol="HTTP/1.1" etc. . . .

change the port value to "80".

You'll need to make sure there's not another service listening on that port like IIS or apache. 

On Wednesday, October 19, 2016 at 10:00:43 PM UTC-7, Jim Newton wrote:
I have a new AWS EC2 instance running a LAMP stack with Amazon Linux, Amazon, Tomcat, MySQL, and Lucee (all the latest versions).  Everything runs perfectly on port 8888 for Lucee, and port 80 for all non-Lucee requests.

What is the best way to have Lucee respond to requests that come in through port 80, instead of just 8888?

I can post config files for Apache, Tomcat, Lucee, etc. if you tell me which ones you need to see.
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Igal @ Lucee.org

unread,
Oct 20, 2016, 9:11:25 PM10/20/16
to lu...@googlegroups.com

If you want Tomcat to handle all of the requests, including static files like JavaScript, CSS, etc., then yes, you can change the connector's port to 80.

If you want a web server (like Apache httpd or nginx) to handle the requests, and forward, or redirect, only the CFML requests to Tomcat, and for the web server to serve static content, then you need to set up a reverse proxy as Nando mentioned.  This is the preferred approach because it allows for better performance, security, and scalability, but the choice is yours.

Igal Sapir
Lucee Core Developer
Lucee.org

Jim Newton

unread,
Oct 20, 2016, 9:11:34 PM10/20/16
to Lucee

OK, disregard my previous message...your suggestions worked!

Just for the record, here's what I did:

1.)  Edited the "/opt/lucee/tomcat/conf/server.xml" file and changed "<Connector port="8080" protocol="HTTP/1.1"..." to "80" instead of "8888" (thanks Hugh)

2.)  Edited the "/etc/httpd/conf/httpd.conf" file and changed "Listen 80" to "Listen 8087" (to make Apache not listen to port 80 traffic) (link)

3.)  Created a new file "vhost.conf" in "/etc/httpd/conf.d/" ("cd /etc/httpd/conf.d/" then "sudo touch vhost.conf")

4.)  Edit the new "vhost.conf" file and add the following into it and save:

<VirtualHost *:8079>
   DocumentRoot /var/www/html
   ServerName example.com
   ServerAlias www.example.com
   ServerAdmin ro...@example.com
   ErrorLog logs/www.example.com-error_log
   CustomLog logs/www.example.com-access_log common
</VirtualHost>

I literally put the above into the file, including the "example.com" stuff.  I might need to change that later, but it works so hey!

5.)  Reboot the system with "sudo reboot" and everything works!

Thank you everyone!

--Jim
Reply all
Reply to author
Forward
0 new messages