You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Karolis Monkus <ka...@dts-solutions.lt> on 2013/02/05 15:37:42 UTC

can't start tomcat on port 80

Hi everyone,

I use fedora 17 and from yum downloaded tomcat-7.0.33 version. I changed port from 8080 to 80 in server.xml, restarted tomcat and got the following error in catalina.out file:

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"]

java.net.BindException: Permission denied <null>:80

at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:406)

at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:610)

at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:429)

at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)

at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)

at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)

at org.apache.catalina.startup.Catalina.load(Catalina.java:633)

at org.apache.catalina.startup.Catalina.load(Catalina.java:658)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)

Caused by: java.net.BindException: Permission denied

at java.net.PlainSocketImpl.socketBind(Native Method)

at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)

at java.net.ServerSocket.bind(ServerSocket.java:376)

at java.net.ServerSocket.<init>(ServerSocket.java:237)

at java.net.ServerSocket.<init>(ServerSocket.java:181)

at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49)

at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:393)

... 17 more



I'm logged in to fedora with root user. Any help would be appreciated.

Regards,

Karolis M.





Re: can't start tomcat on port 80

Posted by Mark Eggers <it...@yahoo.com>.
On 2/5/2013 8:04 AM, Jukka Ruohonen wrote:
> On Tue, Feb 05, 2013 at 04:37:42PM +0200, Karolis Monkus wrote:
>> I use fedora 17 and from yum downloaded tomcat-7.0.33 version. I changed
>> port from 8080 to 80 in server.xml, restarted tomcat and got the following
>> error in catalina.out file:
>
> How are you (re)starting Tomcat?
>
> As far as I know, Fedora is still in the process of migrating to the new
> init-system known as systemd.  As others have noted, I believe this mandates
> patching some of the stock scripts.
>
> -Jukka.

jsvc seems to be in the repo, at least for Fedora 18.

tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate
                      service
apache-commons-daemon-jsvc.x86_64 : Java daemon launcher

The FAQ has also been mentioned:

http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

As Chuck mentioned in another message, using third party repackaged 
versions of Tomcat make it difficult for people on this mailing list to 
help.

I usually use a stock Tomcat running as a normal user and front it with 
Apache HTTPD using mod_jk. However, I have other requirements that make 
this reasonable. You may not.

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Jukka Ruohonen <jr...@iki.fi>.
On Tue, Feb 05, 2013 at 04:37:42PM +0200, Karolis Monkus wrote:
> I use fedora 17 and from yum downloaded tomcat-7.0.33 version. I changed
> port from 8080 to 80 in server.xml, restarted tomcat and got the following
> error in catalina.out file:

How are you (re)starting Tomcat?

As far as I know, Fedora is still in the process of migrating to the new
init-system known as systemd.  As others have noted, I believe this mandates
patching some of the stock scripts.

-Jukka.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Mark Eggers <it...@yahoo.com>.
On 2/6/2013 12:28 PM, Mark Eggers wrote:
> On 2/6/2013 12:06 PM, Konstantin Kolinko wrote:
>> 2013/2/6 Karolis Monkus <ka...@dts-solutions.lt>:
>>> Ok guys, i did what you all said: Removed that crappy 3rd party
>>> tomcat and downloaded tomcat tarball and port changing works fine.
>>> Now i need to run tomcat as service and since it's a Fedora it uses
>>> systemd instead init. So i created file called tomcat.service and
>>> placed it in /etc/systemd/system/ directory.
>>>
>>> tomcat.service:
>>>
>>> [Service]
>>>
>>> ExecStart=/usr/share/apache-tomcat-7.0.35/bin/startup.sh
>>>
>>> Restart=restart-always
>>>
>>> [Install]
>>>
>>> WantedBy=multi-user.target
>>>
>>> Then i enable service using command "systemctl enable
>>> tomcat.service" But nothing happens when i start tomcat with
>>> "service tomcat start" Am i missing some more information in that
>>> tomcat.service file?
>>>
>>
>> 1. I would guess that the above command would try to start Tomcat by
>> the root user.  DO NOT do that.
>>
>> Do not forget to delete files in Tomcat's log and work folders that
>> are now owned by root. Otherwise starting it with other user will
>> fail.
>>
>> 2. Have you read RUNNING.txt ?
>>
>> 3. Do not top-post.
>> http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style
>>
>>
>>
>>> But nothing happens when i start tomcat with "service tomcat
>>> start"
>>
>> What exactly do you mean by "nothing" ?
>
> A quick glance through yum on Fedora 18 with the following:
>
> yum search tomcat | grep systemd
>
> doesn't reveal anything.
>
> However, there is
>
> tomcat-systemv.noarch : Systemv scripts for Apache Tomcat
>
> I suspect that getting Tomcat to start up using systemd is more complex
> than just the simple file you've put together.
>
> There is also:
>
> tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate
>                       service
> apache-commons-daemon-jsvc.x86_64 : Java daemon launcher
>
> I think using jsvc is a much better route to take if you're running
> Tomcat on port 80.
>
> . . . . just my two cents.
> /mde/

Following up on my own post:

I'd download the tomcat-jsvc.noarch and unpack it to see what they did.

Then I'd get the Apache Commons Daemon from the source and compile it:

http://commons.apache.org/daemon/

Finally, I'd use the information from the RPM as a guide, along with:

http://tomcat.apache.org/tomcat-6.0-doc/setup.html

And comments in this article:

http://stackoverflow.com/questions/12887028/running-tomcat6-with-jsvc

to get you going.

/mde/




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Mark Eggers <it...@yahoo.com>.
On 2/6/2013 12:06 PM, Konstantin Kolinko wrote:
> 2013/2/6 Karolis Monkus <ka...@dts-solutions.lt>:
>> Ok guys, i did what you all said: Removed that crappy 3rd party
>> tomcat and downloaded tomcat tarball and port changing works fine.
>> Now i need to run tomcat as service and since it's a Fedora it uses
>> systemd instead init. So i created file called tomcat.service and
>> placed it in /etc/systemd/system/ directory.
>>
>> tomcat.service:
>>
>> [Service]
>>
>> ExecStart=/usr/share/apache-tomcat-7.0.35/bin/startup.sh
>>
>> Restart=restart-always
>>
>> [Install]
>>
>> WantedBy=multi-user.target
>>
>> Then i enable service using command "systemctl enable
>> tomcat.service" But nothing happens when i start tomcat with
>> "service tomcat start" Am i missing some more information in that
>> tomcat.service file?
>>
>
> 1. I would guess that the above command would try to start Tomcat by
> the root user.  DO NOT do that.
>
> Do not forget to delete files in Tomcat's log and work folders that
> are now owned by root. Otherwise starting it with other user will
> fail.
>
> 2. Have you read RUNNING.txt ?
>
> 3. Do not top-post.
> http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style
>
>
>> But nothing happens when i start tomcat with "service tomcat
>> start"
>
> What exactly do you mean by "nothing" ?

A quick glance through yum on Fedora 18 with the following:

yum search tomcat | grep systemd

doesn't reveal anything.

However, there is

tomcat-systemv.noarch : Systemv scripts for Apache Tomcat

I suspect that getting Tomcat to start up using systemd is more complex 
than just the simple file you've put together.

There is also:

tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate
                      service
apache-commons-daemon-jsvc.x86_64 : Java daemon launcher

I think using jsvc is a much better route to take if you're running 
Tomcat on port 80.

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Konstantin Kolinko <kn...@gmail.com>.
2013/2/6 Karolis Monkus <ka...@dts-solutions.lt>:
> Ok guys, i did what you all said:
> Removed that crappy 3rd party tomcat and downloaded tomcat tarball and port
> changing works fine. Now i need to run tomcat as service and since it's a
> Fedora it uses systemd instead init. So i created file called tomcat.service
> and placed it in /etc/systemd/system/ directory.
>
> tomcat.service:
>
> [Service]
>
> ExecStart=/usr/share/apache-tomcat-7.0.35/bin/startup.sh
>
> Restart=restart-always
>
> [Install]
>
> WantedBy=multi-user.target
>
> Then i enable service using command "systemctl enable tomcat.service"
> But nothing happens when i start tomcat with "service tomcat start"
> Am i missing some more information in that tomcat.service file?
>

1. I would guess that the above command would try to start Tomcat by
the root user.  DO NOT do that.

Do not forget to delete files in Tomcat's log and work folders that
are now owned by root. Otherwise starting it with other user will
fail.

2. Have you read RUNNING.txt ?

3. Do not top-post.
http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style

> But nothing happens when i start tomcat with "service tomcat start"

What exactly do you mean by "nothing" ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Karolis Monkus <ka...@dts-solutions.lt>.
Ok guys, i did what you all said:
Removed that crappy 3rd party tomcat and downloaded tomcat tarball and port 
changing works fine. Now i need to run tomcat as service and since it's a 
Fedora it uses systemd instead init. So i created file called tomcat.service 
and placed it in /etc/systemd/system/ directory.

tomcat.service:

[Service]

ExecStart=/usr/share/apache-tomcat-7.0.35/bin/startup.sh

Restart=restart-always

[Install]

WantedBy=multi-user.target

Then i enable service using command "systemctl enable tomcat.service"
But nothing happens when i start tomcat with "service tomcat start"
Am i missing some more information in that tomcat.service file?

Thanks,
Karolis M.

----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, February 05, 2013 5:15 PM
Subject: RE: can't start tomcat on port 80


> From: Karolis Monkus [mailto:karolis.monkus@dts-solutions.lt]
> Subject: Re: can't start tomcat on port 80

> Nothing running on 80 port, selinux and firewall disabled, so no
> need for writing iptables rules.

Good to kno.w

> What do you mean by saying i need support from Fedora?

The third-party repackaged versions of Tomcat are not just copies of the 
real ones from tomcat.apache.org - they have been modified to change 
location and content of configuration files, log files, startup scripts, 
etc.  Consequently, when something doesn't work, it's often necessary to 
contact the repackager, since experience shows they broke it.

> Would everything be easier if i just download newest tomcat tar
> archive and manually install/run it?

It certainly would for those of us providing this voluntary support on the 
mailing list; we would then know exactly what we're dealing with.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: can't start tomcat on port 80

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Karolis Monkus [mailto:karolis.monkus@dts-solutions.lt] 
> Subject: Re: can't start tomcat on port 80

> Nothing running on 80 port, selinux and firewall disabled, so no 
> need for writing iptables rules.

Good to kno.w

> What do you mean by saying i need support from Fedora? 

The third-party repackaged versions of Tomcat are not just copies of the real ones from tomcat.apache.org - they have been modified to change location and content of configuration files, log files, startup scripts, etc.  Consequently, when something doesn't work, it's often necessary to contact the repackager, since experience shows they broke it.

> Would everything be easier if i just download newest tomcat tar 
> archive and manually install/run it?

It certainly would for those of us providing this voluntary support on the mailing list; we would then know exactly what we're dealing with.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Karolis Monkus <ka...@dts-solutions.lt>.
Thanks for quick answer. Nothing running on 80 port, selinux and firewall 
disabled, so no need for writing iptables rules.
What do you mean by saying i need support from Fedora? What kind of support? 
Would everything be easier if i just download newest tomcat tar archive and 
manually install/run it?

Regards,
Karolis M.

----- Original Message ----- 
From: "Caldarale, Charles R" <Ch...@unisys.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, February 05, 2013 4:45 PM
Subject: RE: can't start tomcat on port 80


> From: Karolis Monkus [mailto:karolis.monkus@dts-solutions.lt]
> Subject: can't start tomcat on port 80

> I use fedora 17 and from yum downloaded tomcat-7.0.33 version.

You may need support from Fedora, since repackaged versions of Tomcat do not 
always behave the way real ones do.

> I changed port from 8080 to 80 in server.xml, restarted tomcat and
> got the following error in catalina.out file:

> SEVERE: Failed to initialize end point associated with ProtocolHandler 
> ["http-bio-80"]

Check if anything else is using port 80 with netstat.

> I'm logged in to fedora with root user. Any help would be appreciated.

You might not be running Tomcat as root (which is good - you shouldn't), 
since the 3rd-party repackaged versions often fiddle with the start/stop 
scripts.  Since you're not using a real Tomcat, the FAQ entry for this topic 
may need adjustment, but it should help:

http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can't start tomcat on port 80

Posted by Vaibhav Walia <wa...@yahoo.com>.
I had exactly the same problem back in the day,play around with your port address, tomcat uses port number 8080 by default check if any other process is using the same port number if yes then change it to some other port by modifying the configuration file,should help.

-vaibhav




________________________________
 From: "Caldarale, Charles R" <Ch...@unisys.com>
To: Tomcat Users List <us...@tomcat.apache.org> 
Sent: Tuesday, 5 February 2013 8:15 PM
Subject: RE: can't start tomcat on port 80
 
> From: Karolis Monkus [mailto:karolis.monkus@dts-solutions.lt] 
> Subject: can't start tomcat on port 80

> I use fedora 17 and from yum downloaded tomcat-7.0.33 version.

You may need support from Fedora, since repackaged versions of Tomcat do not always behave the way real ones do.

> I changed port from 8080 to 80 in server.xml, restarted tomcat and 
> got the following error in catalina.out file:

> SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"]

Check if anything else is using port 80 with netstat.

> I'm logged in to fedora with root user. Any help would be appreciated.

You might not be running Tomcat as root (which is good - you shouldn't), since the 3rd-party repackaged versions often fiddle with the start/stop scripts.  Since you're not using a real Tomcat, the FAQ entry for this topic may need adjustment, but it should help:

http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

RE: can't start tomcat on port 80

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Karolis Monkus [mailto:karolis.monkus@dts-solutions.lt] 
> Subject: can't start tomcat on port 80

> I use fedora 17 and from yum downloaded tomcat-7.0.33 version.

You may need support from Fedora, since repackaged versions of Tomcat do not always behave the way real ones do.

> I changed port from 8080 to 80 in server.xml, restarted tomcat and 
> got the following error in catalina.out file:

> SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-80"]

Check if anything else is using port 80 with netstat.

> I'm logged in to fedora with root user. Any help would be appreciated.

You might not be running Tomcat as root (which is good - you shouldn't), since the 3rd-party repackaged versions often fiddle with the start/stop scripts.  Since you're not using a real Tomcat, the FAQ entry for this topic may need adjustment, but it should help:

http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org