Scalatra - change port for standalone server - sbt

I am developing a Scalatra application and require the port to be different than the default port 8080. I added the following to the end of my build.sbt:
containerPort in Jetty := 8089
This works great when I am starting the Jetty server within the sbt console (i.e. using jetty:start) but it doesn't work when I create a standalone .jar file using sbt-assembly. When I run the .jar, it still starts the server on port 8080.
Is there something additionally that I need to add to my build.sbt or elsewhere to ensure that sbt-assembly will properly recognize my desired port number?
Thanks in advance!

I solved this by editing the default port in the Bootstrap file. Wasn't able to find a way to do it with changes in the build.sbt file.

Related

Curl error 7 when installing apps on nextcloud

Hey this is my first question on here, so go easy.
I set up a Nextcloud server on my homelab in an ubuntu server 20.04 vm using the snap install. I have a seperate vm running nginx as a reverse proxy to my Nextcloud instance. Everything works flawlessly as intended, except that when I try and install apps on Nextcloud, I get a curl error #7. I've tried using my lan ip through the web ui, my public domain name through the web ui, and the commandline using the nextcloud.occ app:install command. I always get the same error. I tried to find the appropriate log file to get more information but looking in /var/snap/nextcloud/current/log/ I couldn't find any relevant info in any of the logs. Running php -m comes up with php not installed, I guess because php is installed via the Nextcloud snap? Obviously php is installed somewhere because Nextcloud is running, but I don't know how to look and see what modules are enabled, or how to install new ones using the snap. Any help on what to do is much appreciated!
enter image description here
Update: I fixed it. I think I had improperly configured my firewall, and turning it off (in proxmox)/making some changes to my /etc/netplan/*.yaml file to properly configure the static IP fixed it. GL
Another reason can be a wrongliy configured network. I forgot to set the gateway/proxy for IPv4, so github.com was unreachable. Most other services I use seem to resolve IPv6 first, so I did not have any other problems besides updating nextcloud apps.

I try to deploy my process and I have wrong rest endpoint

I try to deploy my process and I have wrong rest endpoint,I can't press the deploy button
what is my problem?
Well there are two basic problems that come to my mind.
You didn't start camunda. If you are connecting to camunda through an app make sure that it's running. Try deploying again after your app is running successfully.
You are using the wrong port. Make sure that camunda is running on port 8081 as you stated on your endpoint. You can check whether the port is used or not by entering the netstat -an command to windows cmd. Something with :8081 should show up if it's used.
If you using an unmodified recent Camunda version then your REST endpoint URL is:
http://localhost:8080/engine-rest
Of course the server needs to be started / have started without errors.
Please also see:
How to deploy a Camunda modeled diagram into Camunda Tomcat

Running a Go webserver behind Phusion Passenger

Phusion Passenger has a great ecosystem for running webapps behind a webserver. I have experience with it from Ruby and Node.js apps. Now I rewrote a webservice to use Go, and it's time to deploy it. It seems natural to put Passenger+Nginx in front of the go webserver (using net/http). Searching around it seems that nobody has tried this, or asked about this anywhere...
I can't seem to find a configuration option to attach a custom binary, instead of passenger_ruby/passenger_node etc.
Can (should?) I use Phusion Passenger to run my binary created using go build?
No, you can't. Passenger doesn't actually use HTTP internally; it uses a custom protocol (like FastCGI or SCGI but incompatible with both) to communicate with your app and requires its own code in the application for management and dispatching requests. They don't provide such support code for Go.
This is actually possible now, Passenger 6 has added generic language support. You can find the tutorial here: https://www.phusionpassenger.com/docs/advanced_guides/gls/go.html
Basically:
Compile your Go program and put the binary somewhere convenient. The application needs to accept configuration to choose what port to run on.
passenger start --app-start-command 'env PORT=$PORT ./main' assuming main is your program name.
Passenger will try to tell the application what port to start on so that it can have port 80/443.

Yeoman doesn't broadcast the test server using grunt serve

I've been looking for quite some time now for this question, but I found nothing.
I scaffold the application using yeoman. I typed grunt serve to launch the application. I tried accessing my computer using the the ip address
e.g.
http://192.168.1.32
It correctly show me the default file in my localhost, which is hello world, now I want to access the one served by yeoman, by adding a port number :9000, but it shows me.
Webpage is not available,
are there extra configurations for this?
There should be no dash in "grunt serve", and that would for the basic generators start the live reload server, which would write output some info on progress in the console, and try to open your default browser when ready.
The server would (again in basic generators) serve at
http://localhost:9000
What is the output from the console when you start the "grunt serve" ?
In case someone asks the same question, you can find the answer by examining the Gruntfile.js which tells you to change the host to 0.0.0.0 if you are planning to test it to other devices.
similar question and solution can be found here

Web applications starts on port 8080, where can I change it?

I have Netbeans IDE version 6.8, and Glassfish version 3.
My glassfish listener is set to port 81, but when I try to run the simplest web application via the Netbenas IDE it tries to run it on port 8080. where can I change it ? Using port 8080 for my web application is out of the question for me.
Locate config folder which may be as follows:
C:\Program Files\glassfish-3.0.1\glassfish\domains\domain1\config
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers.
source:
http://ohmjavaclasses.blogspot.com/2012/01/how-to-change-port-number-for-glassfish.html
If GlassFish and Oracle Database are installed in the same system, it results in port conflict as both of them use port 8080.
Here is the procedure to change port number of GlassFish so that you can run GlassFish at a different port number from Oracle to avoid the port conflict.
Find out the folder where GlassFish is installed.
If you installed GlassFish along with NetBeans, you can find out the folder where GlassFish is installed by using the following procedure.
Select Services window by using **Window -> Services** in NetBeans IDE
Expand **Servers** node and select GlassFish Domain
Right click and select **Properties** option from popup menu.
On the right of **Domains Folder** you can see the folder where GlassFish is installed.
For example :
C:\netbeans6.8\glassfish-v3\glassfish\domains. You can also see the other details regarding Glassfish such as port number, in the same window.
Go to the folder where Glassfish in installed.
Go into config folder which is as follows: c:\netbeans6.8\glassfish-3\glassfish\domains\domain1\config
Open domain.xml using any text editor.
Look for 8080 and change it to some other port number that doesn’t conflict with other port numbers. I generally change it to 9999.
Save domain.xml.
Now you need to remove GlassFish from NetBeans and add it again so that NetBeans IDE understands the new port number. For this do the following
In **Servers** window of NetBeans, remove GlassFish by using **RemoveServer** button after selecting GlassFish server.
Click on **AddServer** and select GlassFish V2 or GlassFish V3 and click on **Next**.
Select the **Installation Location** of GlassFish and click on **Next**.
Accept defaults and click on **Finish.**
Restart GlassFish, if it was already running.
A bit late, but this should work...
I don't have 6.8 anymore, but the following is true for 6.9 and 6.10m1 - in the directory <home dir>/.netbeans/<version>/config, there is a file called .nbattrs - edit it, and look for something like:
<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8082"/>
Change the value to whatever you've set in the appropriate Glassfish domain. If, like me, you have more than one version of Glassfish installed, or perhaps multiple domains, just look out for the ....displayName keys and follow your nose - it should be obvious which one you're altering.
HTH,
John
NB: you can, of course, delete the server and add it in again using the wizard to select the right ports - but I think editing .nbattrs is far easier
NB2: there is another .nbattrs file further down the directory chain that also contains glassfish config (can't remember the exact location - sorry!) and this looks like the right place to change the port - but editing this file appears to have no effect as, for me, it gets overridden with whatever is in config/.nbattrs file whenever I start up Netbeans
I'm a bit late, too, but I'll add my comments just-the-same in case anyone runs across this issue in the future. I'm running Windows 7 with NetBeans 6.9.1 and GlassFish 3 locally on a different port (2118) as not to conflict with my Tomcat server on default (8080). If you navigate to <home_dir>/.netbeans/<version>/config/GlassFishEE6/Instances, you'll find your .nbattrs file.
Edit <attr name="httpportnumber" stringvalue="8080"/> to reflect the desired port. Save the file. Restart your server and you should be able to deploy/test your web apps, as desired, using NetBeans.
Incidentally, poking around under <home_dir>/.netbeans/<version>/config/J2EE/InstalledServers, you'll see another .nbattrs file and because I have two app servers installed locally, I see <fileobject name="instance"> for Tomcat and <fileobject name="instance_1"> for GlassFish. XML entries <attr name="port" stringvalue="8080"/> and <attr name="port" stringvalue="2118"/> reflect the respective assigned ports for each server and the change made in the previous .nbattrs file.
Hope this helps.
if you are using Glassfish 3.1.1 it may in /home/user/.netbeans/7.1.2/config/GF3_1/domain1/config/domain.xml,Find the 8080 port and replace it with alternate port number.

Resources