You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Nguyen Hai Nam <na...@nd24.net> on 2012/04/18 04:01:56 UTC

ATS on Amazon EC2 instance

Hi,

I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
start traffic server

# ./trafficserver start
This script needs to be ported to this OS

Then I tried to start ./traffic_server, I got this error

[Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
listen to port 80 (error: -1)
[Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
port 80: -1 13, Permission denied

I've changed ATS to listen to port 80 because I'd like to use ATS as a
reverse proxy for my websites. I wasn't got this error on the running
CentOS box, and hope somebody could help me to solve problem.

Thanks,

-- 
Best regards,
Neddy

Re: ATS on Amazon EC2 instance

Posted by Jan-Frode Myklebust <ja...@tanso.net>.
On Wed, Apr 18, 2012 at 08:06:25AM -0600, Leif Hedstrom wrote:
> >
> >Maybe if I should change the the EPEL package to work better on AMI..
> >
> 
> I know I fixed this on trunk a while ago ... It's definitely in 3.1.3.

Right, TS-1098/620d3cc783c330da00cdbe11eb72eddd1e7aff30. Brian, could we
get this backported to v3.0?



  -jf

Re: ATS on Amazon EC2 instance

Posted by Leif Hedstrom <zw...@apache.org>.
On 4/18/12 2:45 AM, Jan-Frode Myklebust wrote:
> On Wed, Apr 18, 2012 at 09:22:44AM +0100, Nick Kew wrote:
>> I recollect that happening on Amazon.
>>
>> If you grep the script, you'll see it comes from a bunch of tests which set
>> DISTRIB_ID, starting about line 44.  I used the easy workaround of
>>
>>   ln -s /etc/system-release /etc/redhat-release
>>
>> to satisfy the test (amazon linux is essentially redhat).
> Just tested that this works on AMI:
>
> 	ln -s /etc/system-release /etc/redhat-release
> 	yum --enablerepo=epel install trafficserver
> 	service trafficserver start
>
> Maybe if I should change the the EPEL package to work better on AMI..
>

I know I fixed this on trunk a while ago ... It's definitely in 3.1.3.

If someone wants to write a better RC script, I'm all +1 for it :). Seeing 
how the popular Linux distros are diverging on startup management anyways, 
maybe it's reasonable to have one script for each Linux distro?

-- Leif


Re: ATS on Amazon EC2 instance

Posted by Jan-Frode Myklebust <ja...@tanso.net>.
On Wed, Apr 18, 2012 at 09:22:44AM +0100, Nick Kew wrote:
> I recollect that happening on Amazon.
> 
> If you grep the script, you'll see it comes from a bunch of tests which set
> DISTRIB_ID, starting about line 44.  I used the easy workaround of
> 
>  ln -s /etc/system-release /etc/redhat-release
> 
> to satisfy the test (amazon linux is essentially redhat).

Just tested that this works on AMI:

	ln -s /etc/system-release /etc/redhat-release
	yum --enablerepo=epel install trafficserver
	service trafficserver start

Maybe if I should change the the EPEL package to work better on AMI..

Is there any better way to check for DISTRIB_ID on AMI than:

	test -f /etc/system-releases && grep -q ^Amazon /etc/system-releases

?

  -jf

Re: ATS on Amazon EC2 instance

Posted by Nick Kew <ni...@apache.org>.
On 18 Apr 2012, at 03:01, Nguyen Hai Nam wrote:

> Hi,
> 
> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
> start traffic server
> 
> # ./trafficserver start
> This script needs to be ported to this OS

I recollect that happening on Amazon.

If you grep the script, you'll see it comes from a bunch of tests which set
DISTRIB_ID, starting about line 44.  I used the easy workaround of

 ln -s /etc/system-release /etc/redhat-release

to satisfy the test (amazon linux is essentially redhat).

I think I also raised the matter on the dev list (as in, why do we have to
make these tests at all?) but nothing came of it.

-- 
Nick Kew

Re: ATS on Amazon EC2 instance

Posted by Conan <co...@gmail.com>.
Try to start ./traffic_cop which will start traffic_manager and
traffic_server,  in this way it can bind 80. (traffic_cop is what
./trafficserver starts)

Directly starting ./traffic_server seem can only bind large port like 8080.

On Wed, Apr 18, 2012 at 10:41 AM, Hung Nguyen <it...@gmail.com>wrote:

> Sorry, I meant port 80 :)
>
>
> On Wed, Apr 18, 2012 at 9:40 AM, Hung Nguyen <it...@gmail.com>wrote:
>
>> Which distro Amazon Linux based on? The errors look like SeLinux is
>> preventing service from listening on port 443.
>> "dmesg" should give more information.
>>
>>
>>
>> On Wed, Apr 18, 2012 at 9:20 AM, Nguyen Hai Nam <na...@nd24.net> wrote:
>>
>>> I was switching to root user but it's the same.
>>>
>>> On Wed, Apr 18, 2012 at 9:15 AM, Jason Giedymin
>>> <ja...@gmail.com> wrote:
>>> > Probably due to non root user on EC2.
>>> > -J
>>>
>>> --
>>> Best regards,
>>> Neddy
>>>
>>
>>
>>
>> --
>> ---
>> Hung. Nguyen Van
>> Website: http://ethicconsultant.com
>>
>>
>>
>
>
> --
> ---
> Hung. Nguyen Van
> Website: http://ethicconsultant.com
>
>
>

Re: ATS on Amazon EC2 instance

Posted by Hung Nguyen <it...@gmail.com>.
Sorry, I meant port 80 :)

On Wed, Apr 18, 2012 at 9:40 AM, Hung Nguyen <it...@gmail.com> wrote:

> Which distro Amazon Linux based on? The errors look like SeLinux is
> preventing service from listening on port 443.
> "dmesg" should give more information.
>
>
>
> On Wed, Apr 18, 2012 at 9:20 AM, Nguyen Hai Nam <na...@nd24.net> wrote:
>
>> I was switching to root user but it's the same.
>>
>> On Wed, Apr 18, 2012 at 9:15 AM, Jason Giedymin
>> <ja...@gmail.com> wrote:
>> > Probably due to non root user on EC2.
>> > -J
>>
>> --
>> Best regards,
>> Neddy
>>
>
>
>
> --
> ---
> Hung. Nguyen Van
> Website: http://ethicconsultant.com
>
>
>


-- 
---
Hung. Nguyen Van
Website: http://ethicconsultant.com

Re: ATS on Amazon EC2 instance

Posted by Hung Nguyen <it...@gmail.com>.
Which distro Amazon Linux based on? The errors look like SeLinux is
preventing service from listening on port 443.
"dmesg" should give more information.



On Wed, Apr 18, 2012 at 9:20 AM, Nguyen Hai Nam <na...@nd24.net> wrote:

> I was switching to root user but it's the same.
>
> On Wed, Apr 18, 2012 at 9:15 AM, Jason Giedymin
> <ja...@gmail.com> wrote:
> > Probably due to non root user on EC2.
> > -J
>
> --
> Best regards,
> Neddy
>



-- 
---
Hung. Nguyen Van
Website: http://ethicconsultant.com

Re: ATS on Amazon EC2 instance

Posted by Nguyen Hai Nam <na...@nd24.net>.
I was switching to root user but it's the same.

On Wed, Apr 18, 2012 at 9:15 AM, Jason Giedymin
<ja...@gmail.com> wrote:
> Probably due to non root user on EC2.
> -J

-- 
Best regards,
Neddy

Re: ATS on Amazon EC2 instance

Posted by Jason Giedymin <ja...@gmail.com>.
Probably due to non root user on EC2. 
-J

On Apr 17, 2012, at 10:01 PM, Nguyen Hai Nam <na...@nd24.net> wrote:

> Hi,
> 
> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
> start traffic server
> 
> # ./trafficserver start
> This script needs to be ported to this OS
> 
> Then I tried to start ./traffic_server, I got this error
> 
> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
> listen to port 80 (error: -1)
> [Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
> port 80: -1 13, Permission denied
> 
> I've changed ATS to listen to port 80 because I'd like to use ATS as a
> reverse proxy for my websites. I wasn't got this error on the running
> CentOS box, and hope somebody could help me to solve problem.
> 
> Thanks,
> 
> -- 
> Best regards,
> Neddy

Re: ATS on Amazon EC2 instance

Posted by Aleksey Kluchnikov <al...@ximad.com>.
* Nguyen Hai Nam <na...@nd24.net> [2012-04-18 09:01:56 +0700]:

> Hi,
> 
> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
> start traffic server
> 
> # ./trafficserver start
> This script needs to be ported to this OS
> 
> Then I tried to start ./traffic_server, I got this error
> 
> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
> listen to port 80 (error: -1)
> [Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
> port 80: -1 13, Permission denied

Same error on freebsd.
fix by adding net.inet.ip.portrange.reservedhigh=79 to /etc/sysctl.conf

Becouse OS denied bind to port numbers lower 1024 for non root users.
I think ./traffic_server from root make su to www user (for freebsd) and
try to start.



> 
> I've changed ATS to listen to port 80 because I'd like to use ATS as a
> reverse proxy for my websites. I wasn't got this error on the running
> CentOS box, and hope somebody could help me to solve problem.
> 
> Thanks,
> 
> -- 
> Best regards,
> Neddy

-- 
Aleksey Kluchnikov,

RE: ATS on Amazon EC2 instance

Posted by "andrew.ashcroft@holidaylettings.co.uk" <an...@holidaylettings.co.uk>.
We run ATS on EC2 boxes on port 80 without issue but we don't use the default Amazon Linux AMIs - we use one of the Ubuntu images.

That way, you won't get the "The script needs to be ported" message. 

Looks like they've just added Ubuntu Cloud AMIs to the default selection list too, so it should be even easier to get a machine up and running. 

Hope this helps,

Andrew

-----Original Message-----
From: Nguyen Hai Nam [mailto:nam.nh@nd24.net] 
Sent: Wednesday, April 18, 2012 4:18 AM
To: users@trafficserver.apache.org; tin@le.org
Subject: Re: ATS on Amazon EC2 instance

Absolutely there's nothing running on port 80. I've made sure it's fresh system when start ATS.

On Wed, Apr 18, 2012 at 9:52 AM, Tin Le <ti...@le.org> wrote:
> Do you have something running on port 80 already?
>
> If you have lsof installed on that machine, try the following to see 
> what's using it.
>
> lsof -i :80
>
>
> Tin
>
>> Hi,
>>
>> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed 
>> to start traffic server
>>
>> # ./trafficserver start
>> This script needs to be ported to this OS
>>
>> Then I tried to start ./traffic_server, I got this error
>>
>> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or 
>> listen to port 80 (error: -1) [Apr 18 01:57:50.038] Server 
>> {3069680224} WARNING: unable to listen on port 80: -1 13, Permission 
>> denied
>>
>> I've changed ATS to listen to port 80 because I'd like to use ATS as 
>> a reverse proxy for my websites. I wasn't got this error on the 
>> running CentOS box, and hope somebody could help me to solve problem.
>>
>> Thanks,
>>
>> --
>> Best regards,
>> Neddy
>>
>



--
Best regards,
Hai Nam, Nguyen

Re: ATS on Amazon EC2 instance

Posted by Nguyen Hai Nam <na...@nd24.net>.
Absolutely there's nothing running on port 80. I've made sure it's
fresh system when start ATS.

On Wed, Apr 18, 2012 at 9:52 AM, Tin Le <ti...@le.org> wrote:
> Do you have something running on port 80 already?
>
> If you have lsof installed on that machine, try the following to see
> what's using it.
>
> lsof -i :80
>
>
> Tin
>
>> Hi,
>>
>> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
>> start traffic server
>>
>> # ./trafficserver start
>> This script needs to be ported to this OS
>>
>> Then I tried to start ./traffic_server, I got this error
>>
>> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
>> listen to port 80 (error: -1)
>> [Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
>> port 80: -1 13, Permission denied
>>
>> I've changed ATS to listen to port 80 because I'd like to use ATS as a
>> reverse proxy for my websites. I wasn't got this error on the running
>> CentOS box, and hope somebody could help me to solve problem.
>>
>> Thanks,
>>
>> --
>> Best regards,
>> Neddy
>>
>



-- 
Best regards,
Hai Nam, Nguyen

Re: ATS on Amazon EC2 instance

Posted by Tin Le <ti...@le.org>.
Do you have something running on port 80 already?

If you have lsof installed on that machine, try the following to see
what's using it.

lsof -i :80


Tin

> Hi,
>
> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
> start traffic server
>
> # ./trafficserver start
> This script needs to be ported to this OS
>
> Then I tried to start ./traffic_server, I got this error
>
> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
> listen to port 80 (error: -1)
> [Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
> port 80: -1 13, Permission denied
>
> I've changed ATS to listen to port 80 because I'd like to use ATS as a
> reverse proxy for my websites. I wasn't got this error on the running
> CentOS box, and hope somebody could help me to solve problem.
>
> Thanks,
>
> --
> Best regards,
> Neddy
>


Re: ATS on Amazon EC2 instance

Posted by Jason Giedymin <ja...@gmail.com>.
Amazon should be == RH/Centos 5
But maybe they have aggressively blocked the port

Check iptables that it is open for other users just in case

Might be able to use system-config-firewall
http://fedoraproject.org/wiki/SystemConfig/firewall

Thanks!

On Apr 17, 2012, at 10:01 PM, Nguyen Hai Nam <na...@nd24.net> wrote:

> Hi,
> 
> I've built ATS 3.0.2 on EC2 (Amazon Linux AMI i386 EBS). But failed to
> start traffic server
> 
> # ./trafficserver start
> This script needs to be ported to this OS
> 
> Then I tried to start ./traffic_server, I got this error
> 
> [Apr 18 01:57:50.038] Server {3069680224} ERROR: Could not bind or
> listen to port 80 (error: -1)
> [Apr 18 01:57:50.038] Server {3069680224} WARNING: unable to listen on
> port 80: -1 13, Permission denied
> 
> I've changed ATS to listen to port 80 because I'd like to use ATS as a
> reverse proxy for my websites. I wasn't got this error on the running
> CentOS box, and hope somebody could help me to solve problem.
> 
> Thanks,
> 
> -- 
> Best regards,
> Neddy