Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.90.119.tedata.net)
Date: February 08, 2012 01:18AM

Hello All,

I've managed to make my server accessible from the internet, but due to my network, there are some applications that I run uses port 80 on internet, so I can't assign it to the Apache server ...

Yet, I use the localhost on port 80

I want to know, how can I set the Apache to listen to more than one port? Say port 80 and 8080.

Second thing:

I have created a VirtualHost like below:

<VirtualHost *:80>
ServerAdmin <E-Mail Address removed>
DocumentRoot "C:\wamp\www\some folder"
ServerName [URL]
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

I know that this will divert any traffic that is coming on port 80 to "some folder" ... I want to make it divert traffic from a specific URL to go to some folder, and another URL goes to some folder2. How can I achieve this?

Best Regards,
Sikas.

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: February 08, 2012 04:57AM

In the httpd.conf.

Add.

Listen. 80
Listen 8080


And. Servername in vhosts is how to separate by URL

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.90.119.tedata.net)
Date: February 08, 2012 09:55AM

can I added to be like below?

Listen *:80
Listen *:8080

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.90.119.tedata.net)
Date: February 08, 2012 12:04PM

OK, never mind about the listening ports. Tried it and it worked. I tried it by creating a virtual server on a different port and it worked like charm.

Now, the point that is irritating me is I can't make the server redirect depending on the URL ... If I set * if redirects all ... even if the servername is stated!!

1) If traffic comes from 127.0.0.1

<VirtualHost 127.0.0.1>
ServerAdmin E-Mail Address
DocumentRoot "C:\wamp\www"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

If traffic comes from anywhere on port 80 (notice that I have ServerName)

<VirtualHost *:80>
ServerAdmin E-Mail
DocumentRoot "C:\wamp\www\Some Folder"
ServerName URL
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

If traffic comes from anywhere on port 8085 (Notice the ServerName "localhost" yet it is accessible globally)

<VirtualHost *:8085>
ServerAdmin E-Mail
DocumentRoot "C:\wamp\www"
ServerName localhost
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>

Please advise what I am doing wrong there ...

Best Regards,
Sikas.

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: stevenmartin99 (---.251.255.15.threembb.ie)
Date: February 08, 2012 04:24PM

Your mixing up namebased vhosts and ip based


Can u send me an email to my gmail addres below with the setup ur looking for any I will write it for you

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.85.150.tedata.net)
Date: February 10, 2012 05:17PM

Steven, I've sent you an email and waiting for your reply ...

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.85.150.tedata.net)
Date: February 10, 2012 05:18PM

Steven, I've sent you an email and waiting for your reply ...

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: February 10, 2012 05:28PM

I didn't get any emails?

Try private message me here





Sorry I did get it!!! But there is no detail in it
Can you send me each URL and how u want it to be accessed wih port etc

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 1 time(s). Last edit at 02/10/2012 05:30PM by stevenmartin99.

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.85.150.tedata.net)
Date: February 12, 2012 04:00PM

Steven, I hope you received the email.

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: sikas (---.233.87.114.tedata.net)
Date: February 20, 2012 07:20AM

HELLO!!

Options: ReplyQuote
Re: Apache server to listen on multiple ports and VirtualHost Problem
Posted by: stevenmartin99 (Moderator)
Date: February 20, 2012 08:20AM

Please don't respond like this,

I told you I needed an email with details!!!

You didn't send me enough information

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.