LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2011, 01:25 AM   #1
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Rep: Reputation: 16
Webserver


Hi,

I have one webserver in my office. apache and lighthttpd running. two websites running on that server.

One websites running under apache another is running through lighthttpd. can anyone tel me second websites running though lighttpd with port number 81. if it is
possible to runnign this websites without port number.like this. www.example.com:81 to www.example.com. please help me.
Thanks
 
Old 05-31-2011, 01:54 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

Yes.
You can setup the example.com vhost in apache and configure it as a reverse proxy for the x.x.x.x:81 webserver (that is the IP of the lighttpd listening on port 81)

Regards
 
Old 05-31-2011, 01:55 AM   #3
kindofabuzz
Member
 
Registered: Mar 2010
Location: There
Distribution: Linux Mint 17.1
Posts: 237

Rep: Reputation: 45
forward http to whatever port you want. I think that would be the solution.
 
Old 05-31-2011, 07:59 AM   #4
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Original Poster
Rep: Reputation: 16
webserver

Quote:
Originally Posted by kindofabuzz View Post
forward http to whatever port you want. I think that would be the solution.
Hi

Thanks for the reply.

In this case the both websites running
one website running through apache and the another one running through lighttpd without port number. so how i do this please help me.

I am using centos5.5
Thanks
 
Old 05-31-2011, 02:01 PM   #5
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,652

Rep: Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569
two web servers on one machine

First, understand that two programs cannot share the same port on the same interface. You either need to virtualize/forward for one to a different port (see suggestions above) or have more than one IP address on this machine (with different DNS names for the IP addresses). There are several different ways you could go here.

Being a network engineer, I go with modifying the networking settings and configuring for the change. This is a bit complex on one end, but makes the web-server configurations very straightforward.
A very webby software kinda guy would probably rather configure the first web server to forward traffic to the other (on a different port - 81 perhaps) based upon the name used in the URL. This requires NO network change, requires duplication of the DNS address (minor), and slightly more complex web-server configuration.
A very 'Virtual' kinda guy might say move BOTH of these web-servers to virtual guests (using LXC or OpenVZ perhaps) and give each its own IP address and DNS name and stop worrying. (Because then the stock off-the-shelf configurations would work! Sounds like fun.)

Which solution appeals to you more, or sounds like something you would be more likely to enjoy?
 
Old 06-01-2011, 12:51 AM   #6
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Original Poster
Rep: Reputation: 16
webserver

Quote:
Originally Posted by wpeckham View Post
First, understand that two programs cannot share the same port on the same interface. You either need to virtualize/forward for one to a different port (see suggestions above) or have more than one IP address on this machine (with different DNS names for the IP addresses). There are several different ways you could go here.

Being a network engineer, I go with modifying the networking settings and configuring for the change. This is a bit complex on one end, but makes the web-server configurations very straightforward.
A very webby software kinda guy would probably rather configure the first web server to forward traffic to the other (on a different port - 81 perhaps) based upon the name used in the URL. This requires NO network change, requires duplication of the DNS address (minor), and slightly more complex web-server configuration.
A very 'Virtual' kinda guy might say move BOTH of these web-servers to virtual guests (using LXC or OpenVZ perhaps) and give each its own IP address and DNS name and stop worrying. (Because then the stock off-the-shelf configurations would work! Sounds like fun.)

Which solution appeals to you more, or sounds like something you would be more likely to enjoy?

Hi

Thanks for the reply.

I think my questions is not clear. sorry.

I have 2 websites running in the one webserver. first websites running through apache with port number 80. another websites running through lighttpd with port number 81. all its working fine . I want when i browse second website without port number(81). but now its working with port number (81). how I do this. please any help.
default apache runs without port number.
Thanks
 
Old 06-01-2011, 03:08 AM   #7
guyfromcanada
LQ Newbie
 
Registered: May 2004
Location: B.C. Canada
Posts: 29

Rep: Reputation: 15
I think I understand your question. You have two websites (abc.com and def.com, for example). You want to be able to access both websites without having to specify the port number, right?

In order to do this you need to run both websites on port 80. When you go to a website like google.com, the browser automatically appends the :80 to the end, because that's the default HTTP port. A user's browser trying to locate def.com won't know to use :81 because it's not a standard HTTP port. So with your current setup there is no way to achieve your goal.

The solution to this is called Name Based Virtual Hosts (vhosts) as wpeckam mentioned. Your best bet is to run both websites in Apache as virtual hosts instead of running two HTTP daemons. Apache will look for the user's request to see whether it should load abc.com or def.com. Detailed info can be found at Apache's website.

Hope this helps.

Last edited by guyfromcanada; 06-01-2011 at 03:12 AM.
 
Old 06-01-2011, 08:02 AM   #8
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Original Poster
Rep: Reputation: 16
webserver

Quote:
Originally Posted by guyfromcanada View Post
I think I understand your question. You have two websites (abc.com and def.com, for example). You want to be able to access both websites without having to specify the port number, right?

In order to do this you need to run both websites on port 80. When you go to a website like google.com, the browser automatically appends the :80 to the end, because that's the default HTTP port. A user's browser trying to locate def.com won't know to use :81 because it's not a standard HTTP port. So with your current setup there is no way to achieve your goal.

The solution to this is called Name Based Virtual Hosts (vhosts) as wpeckam mentioned. Your best bet is to run both websites in Apache as virtual hosts instead of running two HTTP daemons. Apache will look for the user's request to see whether it should load abc.com or def.com. Detailed info can be found at Apache's website.

Hope this helps.
Hi,

You are correct. But I know that both website running through apache with port 80. but in this case I need separate website setup for one is through apache and another through lighttpd in one server. is it possible to run website through lighttpd without port number.
Please any solution.


Thanks
 
Old 06-01-2011, 01:34 PM   #9
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,078

Rep: Reputation: 195Reputation: 195
Quote:
Originally Posted by saran_redhat View Post
is it possible to run website through lighttpd without port number.
No.
 
Old 06-01-2011, 03:12 PM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,517

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Quote:
Originally Posted by saran_redhat View Post
Hi,

You are correct. But I know that both website running through apache with port 80. but in this case I need separate website setup for one is through apache and another through lighttpd in one server. is it possible to run website through lighttpd without port number.
Please any solution.

Thanks
Take a look again at my post above. You need to setup a vhost at apache that does the reverse proxy for lighttpd.
 
Old 06-01-2011, 03:20 PM   #11
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
You can configure your NIC with 2 IP addresses. Let apache listen on the one and lighttpd on the other; both can now use port 80.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing an Internal Webserver from my Public Webserver rtoney5 Linux - Server 1 12-18-2009 06:41 PM
webserver jpm1973 Linux - Server 1 01-20-2007 01:05 AM
Webserver Use dudeguy9001 Linux - Newbie 3 12-23-2004 11:12 AM
help for webserver sanjibgupta Linux - Newbie 2 11-28-2003 09:39 AM
Can't see WebServer from outside... Can see WebServer locally as http://localhost friddick Linux - Networking 13 08-19-2003 07:27 PM


All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration