Enabling https in moqui framework with tomcat - tomcat8

I have a Tomcat server with SSL configured. in server.xml my config is:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="100"
compression="on"
scheme="https"
SSLEnabled="true"
secure="true"
defaultSSLHostConfigName="test.com">
<SSLHostConfig hostName="test.com"
protocols="TLSv1.2">
<Certificate certificateKeyFile="/opt/tomcat/cert/PrivateKey.pem"
certificateFile="/opt/tomcat/cert/Cert.pem"
certificateChainFile="/opt/tomcat/cert/Chain.pem" />
</SSLHostConfig>
</Connector>
and also my config for moqui is:
<default-property name="webapp_http_host" value="test.com"/>
<default-property name="webapp_http_port" value="8080"/>
<default-property name="webapp_https_port" value="8443"/>
<default-property name="webapp_https_enabled" value="true"/>
when I start the tomcat server, the Moqui framework started successfully, but when I type the URL in the browser nothing happened.
what should I do?
Thanks.

I found the solution, everything is correct just give access to port 8443 with firewall.
Thanks
# firewall-cmd --zone=public --add-port=8443/tcp --permanent success
# firewall-cmd --reload success
# iptables-save | grep 8443 -A IN_public_allow -p tcp -m tcp --dport 8443 -m conntrack --ctstate NEW -j ACCEPT

Related

error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

I added a virtual network card from a physical network card to the xml file of the virtual machine.
<devices>
<interface type='hostdev' managed='yes'>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0000' bus='0x86' slot='0x0a' function='0x7'/>
</source>
<mac address='52:54:00:6d:90:02'/>
</interface>
</devices>
When I execute virsh define, I get error info
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused
I tried reinstall libvirt qemu ,but no effect.
Try these steps:
sudo setfacl -m user:$USER:rw /var/run/libvirt/libvirt-sock
Exit the session and again logged in then,
sudo systemctl enable libvirtd
sudo systemctl start libvirtd

Set both ipv4 and ipv6 for confd netconf ssh connection

I am using confd version 6.3. I'm trying to set it up to be able to ssh with netconf over ipv4 and ipv6. My related configuration looks as follows:
<netconf>
<enabled>true</enabled>
<transport>
<ssh>
<enabled>true</enabled>
<ip>::</ip>
<port>2022</port>
</ssh>
<!-- NETCONF over TCP is not standardized, but it can be useful
during development in order to use e.g. netcat for scripting.
-->
<tcp>
<enabled>true</enabled>
<ip>127.0.0.1</ip>
<port>2023</port>
</tcp>
</transport>
....
</netconf>
Which result in
root#0eeefd5ae80c:/shared# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
...
tcp6 0 0 :::2022 :::* LISTEN
When I change ip to 0.0.0.0 then it listens over ipv4. But I am not able to set both ipv4 and ipv6. Is it even possible>
It turned out that it is possible to use a parameter that is not described in manifest. So in order to do that can be used:
...
<netconf>
<enabled>true</enabled>
<transport>
<ssh>
<enabled>true</enabled>
<ip>0.0.0.0</ip>
<port>2022</port>
<extraIpPorts>:::830</extraIpPorts>
</ssh>
</netconf>
...

Apache/Nginx configuration issue after uninstalling laravel/valet and homestead on macOS Sierra

After uninstalling laravel/valet and Homestead on macOS Sierra, I switched back to Apache (rather than NGINX), tried to restart it using sudo apachectl -k restart, and it outputs this error:
httpd not running, trying to start
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Additional Info - using Homebrew 1.3.1 with OS Sierra 10.12.6. Also used a similar local environment to the one found here:
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
Disclaimer: I almost never use NGINX but I'm assuming it, or something else involved in the laravel/valet setup is preventing Apache from binding to the right port.
How do I fix this error and reconfigure Apache to work with Homebrew again, instead of NGINX?
No output from lsof -i | grep LISTEN | grep ":80" but the output of sudo lsof -i :80 below:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 12146 root 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 12148 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37113 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37114 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37115 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 38654 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
First check if nginx is running
ps aux | grep nginx
If it is running then check if it is running using brew
brew services list
If that shows nginx started then you use below command to stop it
brew services stop nginx
If it is not listed as started or not listed as a service then try to manually kill nginx
pkill nginx
Now to try to restart apache
sudo apachectl restart

(48)Address already in use: make_sock: could not bind to address [::]:80 on OS x Mavericks

I just updated my OSX yesterday with Mavericks and now I am getting error while using apache and Jetty.
It used to map my example.com domain directly to the localhost.
Now It seems broke on do to run my application server I have to explicitly specifying port to hit my server.(ex. example.com:8080)
While I run below command.
sudo apachectl -e debug
I will get the
[debug] mod_so.c(246): loaded module jk_module
(48)Address already in use: make_sock: could not bind to address [::]:80
(48)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
I ran many diff command to kill all httpd process as well find port which is listening on this port.
ex. sudo lsof -i :80
httpd 946 root 5u IPv6 0xe0c8ad50898bcf0f 0t0 TCP *:http (LISTEN)
httpd 947 _www 5u IPv6 0xe0c8ad50898bcf0f 0t0 TCP *:http (LISTEN)
httpd 949 _www 5u IPv6 0xe0c8ad50898bcf0f 0t0 TCP *:http (LISTEN)
httpd 954 _www 5u IPv6 0xe0c8ad50898bcf0f 0t0 TCP *:http (LISTEN)
Google 1633 jignesh.sheth 59u IPv4 0xe0c8ad508597efaf 0t0 TCP example.com:53742->stackoverflow.com:http (ESTABLISHED)
Google 1633 jignesh.sheth 189u IPv4 0xe0c8ad5082027faf 0t0 TCP example.com:53725->stackoverflow.com:http (ESTABLISHED)
Any idea what am I doing wrong?
I also had the same, I removed 'Listern 80' from my config file to solve this issue.
I had the same error. The error log file for Apache server at /var/log/apache*/ mentioned "Address already in use: make_sock: could not bind to address 0.0.0.0:443".
Resolved it using "sudo lsof -i :" command to find processes running on port.
Kill all the processes and re-run sudo apachectl start.
The apache server should start running.
This may help: https://superuser.com/questions/479146/macports-apache2-could-not-bind-to-address/479147#479147?newreg=95099c6a74724da49640329d4ee400f2
I had the same problem.
What I did was changing the permission on "username.conf" from users directory to 644 like in this tutorial
http://www.coolestguidesontheplanet.com/downtown/get-apache-mysql-php-and-phpmyadmin-working-osx-109-mavericks

secondary ajp worker not working between apache and tomcat

I've had this working for months but I had a power cycle today and something broke. Sorry, this is a bit detailed and specific, but I'm desperate for help.
I have apache-2.2 and two tomcat-6 servers (simply running from two separate folders). I don't have any http connectors but I have one ajp connector running on each server on ports 8009 and 8010. Upon startup both tomcats report the connector is running and there doesn't seem to be any problem:
INFO: JK: ajp13 listening on /0.0.0.0:8009
...
INFO: JK: ajp13 listening on /0.0.0.0:8010
I'm reasonably sure I have my workers and apache configuration setup correctly. I can reach the connector on 8009 fine, no problems at all, but when I try 8010 apache gives me a 503. Checking the log (mod_jk.log) it says:
jk_open_socket::jk_connect.c (594): connect to 127.0.0.1:8010 failed (errno=13)
ajp_connect_to_endpoint::jk_ajp_common.c (922): Failed opening socket to (127.0.0.1:8010) (errno=13)
ajp_send_request::jk_ajp_common.c (1507): (eis) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=13)
But what I can't understand is if I do a simple telnet to that port and send a GET:
# telnet 127.0.0.1 8010
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET
Connection closed by foreign host.
It hits the correct tomcat (the error is expected):
Oct 25, 2011 6:17:10 PM org.apache.jk.common.MsgAjp processHeader
SEVERE: BAD packet signature 18245
Oct 25, 2011 6:17:10 PM org.apache.jk.common.ChannelSocket processConnection
SEVERE: Error, processing connection
So why can't apache reach it? The telnet works whether I'm a super user or not. What could be going on? I'm completely stumped.
And I've tried restarting both apache and tomcat and nothing changes. Thanks for taking a look.
EDIT-1: Quick update to this ... I added an http connector and it works fine but the ajp connector is still failing.
EDIT-2: Here are the config details per request ...
workers.properties:
worker.list=service1,service2
worker.service1.type=ajp13
worker.service1.host=127.0.0.1
worker.service1.port=8009
worker.service2.type=ajp13
worker.service2.host=127.0.0.1
worker.service2.port=8010
httpd.conf (I see both jkmount and JkMount ... does caps matter?):
JkMount /s1 service1
JkMount /s1/* service1
JkMount /s2 service2
JkMount /s2/* service2
server.xml for service1:
<Connector port="8009" protocol="AJP/1.3" />
server.xml for service2:
<Connector port="8010" protocol="AJP/1.3" />
I think that's it.
Do you have SELinux on the system? Can you try:
setenforce 0
It could be preventing the apache process to connect. Also, check your firewall rules...
By default 8009 is opened by selinux, you can open more ports to use.
[goalin#centos63 logs]$ sudo semanage port -l | grep 8009
http_port_t tcp 80, 443, 488, 8008, 8009, 8443
[goalin#centos63 logs]$ sudo semanage port -a -t http_port_t -p tcp 18009
[goalin#centos63 logs]$ sudo semanage port -a -t http_port_t -p tcp 28009
[goalin#centos63 logs]$ sudo semanage port -l | grep 8009
http_port_t tcp 28009, 18009, 80, 443, 488, 8008, 8009, 8443
[goalin#centos63 logs]$