Error when deploying app with Play framework on Apache 2.2 on port 443 - apache

I configured Apache with SSl.
Server version: Apache/2.2.15 (Unix)
When I need to deploy my app on port 443, I get this error:
...
Play server process ID is 5941
[info] application - Application v2.8 - started on date 2016-03-30 11:51:08.332
[info] play - Application started (Prod)
Oops, cannot start the server.
If I start the app on different port, it works fine. For example:
sudo nohup app_path -Dhttp.port=9000 -Dconfig.file=config_file 2> /dev/null
But I get an error when I start the app on 443:
sudo nohup app_path -Dhttps.port=443 -Dconfig.file=config_file 2> /dev/null
My questions are:
- Am I missing something? Is there an easy fix for this?
- How can I see log of the error, because it is not descriptive at all

Related

How do I find out what version of Apache or nginx web server is used in ElasticBeanStalk?

Following is what I see in Elastic BeanStalk
https://i.stack.imgur.com/2hzlB.png
I'm going through Apache documentation to write Rewrite rules. But I'm confused which version I should read.
http://httpd.apache.org/docs/
Log in via SSH and run:
$ httpd -v
Server version: Apache/2.4.16 (Unix)
See also: eb ssh
If running Nginx, use:
$ nginx -v
Another way -- check out your logs and search for Apache. I'm using Django and I see Apache/2.4.37 (Amazon) mod_wsgi/3.5 Python/3.6.7. It appears a few times.
On SSH or Putty try first
httpd -v
if any result appears
Server version: Apache/***
that means you in Apache server.
Nginx -v
if any result similar to
Nginx version: nginx/1.14.0 (Ubuntu)
then you can decide Nginx* or Apache*
because those commands only run apache and Nginx as follows,
in my scenario I'm using nginx 1.14.0 it shows me an error
httpd -v
Command 'httpd' not found, did you mean:
command 'http' from snap http (1.0.0-1) command 'xttpd' from deb
xtide command 'http' from deb httpie
See 'snap info ' for additional versions.
and also try
sudo systemctl status nginx

ssh timing out on second login

I'm trying to set up Rails on my site via ssh. When everything is set up, I start the server with rails server and I get:
=> Rails 5.0.1 application starting in development on http://localhost:3000
=> Run rails server -h for more startup options
Puma starting in single mode...
* Version 3.6.2 (ruby 2.3.3-p222), codename: Sleepy Sunday Serenity
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
It would be fine if the issue didn't stop there, but when I point my browser at the IP address on port 3000, my browser just hangs instead of displaying the Rails smoke page.
Since I can't type in more commands, I open a new terminal and log in via:
ssh -i /path/to/cloud.key user_name#XXX.XXX.XXX.XXX
I think I've seen it work before, but now it's timing out:
ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out
I found similar problems resolved on stackoverflow, but none of them solved the problem for public key authentication and when I try their solutions (ssh user_name#XXX.XXX.XXX.XXX), I turn up Permission denied (publickey).
So, I want to either learn why my browser is hanging (if I need to install nginx or apache2 or configure puma, etc.), and/or why my attempts to log into a second ssh session are failing.
Any help for this one?
Ubuntu Server 16.04
Rails 5.0.1
Ruby 2.3.0p0
You can't point your browser to the ip because the server is binding to localhost. You must enter rails s -b0.0.0.0

Docker login error with Get Started tutorial

I'm trying to follow beginner tutorial on Docker's website and I suffer with an error on login.
OS is Ubuntu 14.04, I'm not using VirtualBox and I'm not behind any proxy and want to push to the "regular" docker repository (not private one).
All threads I've found mention proxies and private repositories but that isn't my case, I'm just trying to do simple beginner tutorial.
Here is my attempt:
$ sudo docker login
[sudo] password for myuname:
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: myDHuname
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
My docker info:
Containers: 5
Running: 0
Paused: 0
Stopped: 5
Images: 5
Server Version: 1.11.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 28
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 3.19.0-58-generic
Operating System: Ubuntu 14.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.686 GiB
Name: myuname-ThinkPad-T420
ID: 6RW3:X3FC:T62N:CWKI:JQW5:YIPY:RAHO:ZHF4:DFZ6:ZL7X:JPOD:V7EC
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Epilogue
Now docker login is passing. I have not touched anything since yesterday when it was broken...
I can't reproduce the behavior anymore.
I encounter this issue when my first use docker. I've shadowsocks proxy on, and configed as pac mode. When I try to run docker run hello-world, I get this timeout error. When I set the proxy mode to global, the error is aslo there.
But when I disable the proxy, docker runs well. It pull remote image successfully.
docker for windows
Note: Some users reported problems connecting to Docker Hub on Docker
for Windows stable version. This would manifest as an error when
trying to run docker commands that pull images from Docker Hub that
are not already downloaded, such as a first time run of docker run
hello-world. If you encounter this, reset the DNS server to use the
Google DNS fixed address: 8.8.8.8. For more information, see
Networking issues in Troubleshooting.
The error Client.Timeout exceeded while awaiting headers indicates:
GET request to the registry https://registry-1.docker.io/v2/ timedout
The library responsible (most likely libcurl) timed out before a response was heard
The connection never formed (proxy/firewall gobbled it up)
If you see the below result you can rule out timed out and network connectivity
$ curl https://registry-1.docker.io/v2/
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}
If you get the above response next would be to check if your user environment has some proxy configuration.
env | grep "proxy"
Note: The docker runs as root. Maybe you have http_proxy in your env. Most likely I am wrong. Anywho see what happens with the curl GET request
change the proxy settings in the firefox. May be you are in access restricted mode. Just add the server address in the firefox settings -> preferences -> advanced -> network -> configuration (settings). Add the server ip in the no proxy for the issue can be resolved

Failed to get D-Bus connection - httpd service in Docker container

I am creating a Dockerfile for PostgreSQL with CentOS7 as the base image. I am trying to start httpd service with the following command in the container,
service httpd start
and i get the following error:
Redirecting to /bin/systemctl start httpd.service
Failed to get D-Bus connection: No connection to service manager.
The log file directory /var/log/httpd is also empty. I guess this is the problem with Docker CentOS7 image. Any help appreciated.
I have run into this a well.
It might not be the best way, but you can find a copy of the /etc/init.d/httpd file from another computer. copy that into the container in /etc/init.d
then run
chkconfig --level 345 httpd on
then you will be able to use either
/etc/init.d/httpd start or service httpd start

Can not start GlassFish in Netbeans services tab

I get the following error when try to start the GlassFish in Netbeans services tab.(This error appeared after the installation of mavericks)
Could not connect to admin listener for GlassFish Server. Verify that
Netbeans can make outbound connections to localhost:4848
I ran the following command in terminal.
hakdogan:~ hakdogan$ lsof -i -P | grep -i "listen"
java 61143 hakdogan 58u IPv6 0xe10371a06a96d9a9 0t0 TCP localhost:51659 (LISTEN)
java 61231 hakdogan 43u IPv6 0xe10371a06a96dde9 0t0 TCP localhost:1527 (LISTEN)
I tried to run GlassFish with the terminal.
hakdogan:~ hakdogan$
/Applications/NetBeans/glassfish-4.0/glassfish/bin/asadmin
start-domain domain1 Waiting for domain1 to
start.......................................... Successfully started
the domain : domain1 domain Location:
/Applications/NetBeans/glassfish-4.0/glassfish/domains/domain1 Log
File:
/Applications/NetBeans/glassfish-4.0/glassfish/domains/domain1/logs/server.log
Admin Port: 4848 Command start-domain executed successfully.
As you can see worked :)
But can not start GlassFish in Netbeans services tab.
Is problem the netbeans permissions?
Do you have any idea?
Thank you in advance for your answers.
OS X version 10.9
Netbeans version 7.3.1
GlassFish version 4.0
Download glassfish: https://javaee.github.io/glassfish/download
goto Tools>>>Servers>>>Add server>> choose glassfish>> browse where u just download the glassfish and install.