Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

LightTPD Ports - Disable port 80

Posted on 2011-10-09
7
Medium Priority
?
1,108 Views
Last Modified: 2013-12-16
I need to run LightTPD and Apache on the same box.
Apache should continue to use port 80, but Lighty to use port 8000.

I have the following in the lighttpd.conf file
  server.port             = 8000

and indeed it does serve this port, however when I start Lighty, it fails because it says port 80 is in use (which it is, by Apache).

Is there a way to config Lighty to only use the server.port value - I presume by default it tries to use port 80 AND any specific server.port

Thanks
BT

0
Comment
Question by:brothertom
  • 4
  • 3
7 Comments
 
LVL 41

Assisted Solution

by:noci
noci earned 2000 total points
ID: 36941889

The lighttpd server will also bind to ports mention in $SERVER conditionals:

$SERVER["socket"] == ... {

}

Did you disable the ones with ":80" entries?
or the ones not mentioning a port, but an IP address?

See also:
http://redmine.lighttpd.net/wiki/1/Docs:Configuration
0
 
LVL 41

Assisted Solution

by:noci
noci earned 2000 total points
ID: 36941895
(It might also be the default ssl port btw: 443, if ssl was enabled in both)
0
 

Author Comment

by:brothertom
ID: 36947178
I don't think the conditionals will help as these apply once the server is running.
The failure is happening at startup - I presume port 80 is hard coded somewhere.

The annoying thing is that it fails at startup (when Apache is running) but if I change the start order (i.e. Lighty then Apache) Lighty serves port 8000 and Apache port 80, so looks like a transition issue at startup from port 80 to any defined ports in the conf file.

I wonder if there are any command line params I could pass at startup to change the default port.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:brothertom
ID: 36947187
Hmm, I wonder if there is any weight in this - http://cubehouse.org/blog/2011/02/24/centos-how-to-running-apache-and-lighttpd-on-port-80-at-the-same-time-on-the-same-server/

i.e. binding eiher Apache/Lighty to a specific IP:PORT combination.
0
 
LVL 41

Accepted Solution

by:
noci earned 2000 total points
ID: 36947621
Conditionals are parsed when the server starts, so any special handling can be applied upfront.
Accordig to the doc, the $SERVER[socket] conditional cause socket to be opened for listening...


And no that article handles TWO different IP addresses with two servers, both addresses happen to be on one interface. So that doesn' t apply to your prnless you have multiple addresses of-course.
0
 

Author Comment

by:brothertom
ID: 36951136
OK, I'll try out and report back.

Thanks
BT
0
 

Author Closing Comment

by:brothertom
ID: 37194053
Thanks for the comments.   I think we're going to implement Lighty as a front end proxy for Apache, so Lighty will listen on port 80, Apache on some other port, then we'll pass on any Apache traffic via Lighty to the 'internal' port number.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question