Lift default port

370 views
Skip to first unread message

Arie

unread,
Oct 20, 2010, 6:37:46 PM10/20/10
to Lift
Hi,

Got the same question as this post
http://groups.google.com/group/liftweb/browse_thread/thread/b5324a711c0d8faa/0cda5913347d19c5?lnk=gst&q=port#0cda5913347d19c5

namely: "Does anybody know how I can change the default port 8080? "

But I'd like to know how to do it with SBT.

Thank you

TylerWeir

unread,
Oct 20, 2010, 8:11:38 PM10/20/10
to Lift
In your project/build/FooProject.scala add:

override val jettyPort = 8081

On Oct 20, 6:37 pm, Arie <arie.lake...@gmail.com> wrote:
> Hi,
>
> Got the same question as this posthttp://groups.google.com/group/liftweb/browse_thread/thread/b5324a711...

Andy Czerwonka

unread,
Oct 21, 2010, 2:49:54 PM10/21/10
to Lift
'port' is in code?

TylerWeir

unread,
Oct 21, 2010, 2:57:36 PM10/21/10
to Lift
It's in the SBT config, which is defined in a scala file. So I guess
you could say it's in code, but certainly not Lift or Lift app code.

Andy Czerwonka

unread,
Oct 21, 2010, 3:06:48 PM10/21/10
to Lift
So the equivalent of an build file - fine I guess but I would hope we
wouldn't have to run a build and redeploy just to change the port.
I'll assume that that is not the case.

David Pollak

unread,
Oct 21, 2010, 3:35:40 PM10/21/10
to lif...@googlegroups.com
On Thu, Oct 21, 2010 at 12:06 PM, Andy Czerwonka <andy.cz...@gmail.com> wrote:
So the equivalent of an build file - fine I guess but I would hope we
wouldn't have to run a build and redeploy just to change the port.

This is how you change the port when running your development instance in sbt.  When you are in production, you build a WAR file and deploy it to your container of choice.  You manage the port on the container, not in the WAR file.
 
I'll assume that that is not the case.

On Oct 21, 12:57 pm, TylerWeir <tyler.w...@gmail.com> wrote:
> It's in the SBT config, which is defined in a scala file.  So I guess
> you could say it's in code, but certainly not Lift or Lift app code.
>
> On Oct 21, 2:49 pm, Andy Czerwonka <andy.czerwo...@gmail.com> wrote:
>
>
>
>
>
>
>
> > 'port' is in code?
>
> > On Oct 20, 6:11 pm, TylerWeir <tyler.w...@gmail.com> wrote:
>
> > > In your project/build/FooProject.scala add:
>
> > > override val jettyPort = 8081
>
> > > On Oct 20, 6:37 pm, Arie <arie.lake...@gmail.com> wrote:
>
> > > > Hi,
>
> > > > Got the same question as this posthttp://groups.google.com/group/liftweb/browse_thread/thread/b5324a711...
>
> > > > namely: "Does anybody know how I can change the default port 8080? "
>
> > > > But I'd like to know how to do it with SBT.
>
> > > > Thank you

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

TylerWeir

unread,
Oct 21, 2010, 4:01:38 PM10/21/10
to Lift
Sorry Andy, I was assuming this was all in the context of development.

DPP is right regarding deployed apps, the container handles it.

On Oct 21, 3:35 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Thu, Oct 21, 2010 at 12:06 PM, Andy Czerwonka
> <andy.czerwo...@gmail.com>wrote:
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

Jim Wise

unread,
Oct 21, 2010, 4:05:55 PM10/21/10
to lif...@googlegroups.com
David Pollak <feeder.of...@gmail.com> writes:

> On Thu, Oct 21, 2010 at 12:06 PM, Andy Czerwonka <andy.cz...@gmail.com> wrote:
>
> So the equivalent of an build file - fine I guess but I would hope we
> wouldn't have to run a build and redeploy just to change the port.
>
> This is how you change the port when running your development instance
> in sbt. When you are in production, you build a WAR file and deploy
> it to your container of choice. You manage the port on the container,
> not in the WAR file.

And if you're still using Maven instead of SBT to manage things in dev, you can
find the <plugin> block for jetty, and insert a <connectors> block as follows:

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.24</version>
<configuration>
<contextPath>/</contextPath>
<scanIntervalSeconds>5</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>

(I'll get around to updating my old projects to SBT. Really. But until
then...)

--
Jim Wise
jw...@draga.com

Derek Chen-Becker

unread,
Oct 22, 2010, 1:01:32 AM10/22/10
to lif...@googlegroups.com
You can also use -Djetty.port=<whatever> on the command line, as in:

mvn -Djetty.port=9090 clean jetty:run

Derek

Arie

unread,
Oct 27, 2010, 8:08:40 PM10/27/10
to Lift
Thanks, I missed the reply to this one, and found it out myself. The
reason why I was interested is that it's a good deal harder to change
the default port of JMX for Cassandra from 8080 (according to their
IRC, and much googling), it's now working.

Arie
Reply all
Reply to author
Forward
0 new messages