Unable to connect to Apache server over HTTPS on Centos7 on VirtualBox from MAC - macos

I have a Centos 7 OS configured on VirtualBox machine. I have installed X509 certificate using Openssl tool and configured the apache HTTPD server.
I connect to Centos7 guest on VirtualBox via SSH on my local MAC OSX Seirra (10.12.3) on terminal using root. I have verified that /etc/host on my MAC is correctly pointing to the guest on VirtualBox. Also verified the port forwarding on VirtualBox and they are all setup correctly for allowing traffic on 80 (http) and 443 (https) and 22 (ssh).Also I have made sure that Apache user has proper previleges on the index.html and other folders under DocumentRoot folder. I have also verified that /etc/host on my MAC is correctly pointing to a guest running on VirtualBox.
I have set the firewall to :
setenforce 0
So hopefully it is not a SELinux issue.
Then I run following command on terminal as root user of my Centos7 OS :
curl https://localhost -k
and I do get the default index.html file content.
But then, when I go to my MAC OS browser to connect to VirtualBOX website on HTTPS, I see following message on Chrome browser :
This site can’t be reached localhost refused to connect.
Please note that I can connect to my Vbox CentOS HTTPD server on HTTP.
So what is going wrong here when trying to access the apache server using HTTPS?

You must enable access to https using firewall-cmd:
# firewall-cmd --permanent --add-service=https
or
# firewall-cmd --permanent --add-port=443/tcp
then reload the rules
# firewall-cmd --reload

Try this once.
systemctl stop firewalld
After that try to access website.

Related

Microk8s Access nginx pod to other Host Machines

I am using MIcrok8s 1.26v using Hyperv over windows 10. I am unable to access nginx pod to other host machines. I have exposed nginx using this cmd “microk8s kubectl expose deployment nginx-webserver --type=“NodePort” --port 80”. Its exposed to the clusterIP which i am able to access. What should i do to make the pod access to other host machines on the same network.
Microk8s version: 1.26v
windows version: 10 Pro
Hypervisor: HyperV
Using Multipass
I tried to access the pod with vm IP address. But was not able to access to other host machine.
Also not accessible to the host ip address where vm is deployed.
I got the solution after lots of research.
Step1: Because the IP address keeps on changing I have take this step.
To make microk8s work on DNS instead of IP Address
Edit the config file after login into microk8s-vm shell using multipass shell micrk8s-vm in cmd. Login to root user.
sudo su
vi /var/snap/microk8s/current/certs/csr.conf.template
add line >>>>>> under alt.names>>>>DNS.6 = microk8s-vm.mshome.net
exit the vim editor
Update the .kube/config and Microk8s/config . Replace the IP Address with the given dns name(eg: microk8s-vm.mshome.net)
Microk8s stop
Restart the Host machine.
Step 2: Because Microk8s port forwarding fails i have to opt for windows port forwarding.
Configure Windows port forwarding :https://woshub.com/port-forwarding-in-windows/
Now i am able to access the nginx web server on other windows machine.

How to disable selinux/iptables in MacOS to visit docker server from Host computer?

I am running a docker container of python server in my computer (MacOS Catalina, the container can connect MySQL and Redis from host computer, the server is running normally, but I can't visit server on host computer), in Linux environment, we need to disable the selinux, firewall and iptables, for example, edit /etc/selinux/config
and type as below
SELINUX=disabled
SELINUXTYPE=targeted
How to disable selinux/iptables in MacOS or how to visit docker server from the Host computer, I already tried to use host.docker.internal instead of 127.0.0.1, but it doesn't work, if I use host.docker.internal in MySQL or Redis config, also failed, I only can use the really IP such as 192.168.1.45 instead of host.docker.internal or 127.0.0.1

Cannot access brew-installed Jenkins in VirtualBox

I installed the Jenkins through brew install jenkins-lts in macOS.
The macOS is running as VirtualBox VM instance on Windows Host.
On VirtualBox host Windows, I cannot access Jenkins through http://localhost:8080 or http://10.0.2.15:8080 from browser. (10.0.2.15 is my guest VM macOS's IP address)
What I've setup
Jenkins-lts service is started. macOS safari can access through http://localhost:8080
VirtualBox port forwarding is set, TCP/HOST: 0.0.0.0:8080 /GUEST: 10.0.2.15:8080
By the same port forwarding setup for SSH HOST: 0.0.0.0:22 /GUEST: 10.0.2.15:22, I can successfully connect to SSH.
By the default config file /usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist. brew-installed Jenkins's default listening address is 127.0.0.1 instead of 0.0.0.0. This causes Jenkins's web server only listen request from localhost instead of any network adapter.
Steps
Edit config file, vi /usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist
Find the row <string>--httpListenAddress=127.0.0.1</string> and change to <string>--httpListenAddress=0.0.0.0</string>
Restart Jenkins, brew services restart jenkins-lts
References
https://www.jenkins.io/doc/book/installing/, denoted httpListenAddress
https://medium.com/#vishnuteja/install-jenkins-as-a-service-on-macos-and-change-port-number-9aa097e5cfbf, denoted where brew-install Jenkins's config file.

Cannot access application running on JBOSS EAP 7 outside vagrant box

I am actually trying to access the application outside the vagrant box which is running on JBOSS EAP 7 server on port 8080. I did add the settings for port forwarding in vagrant file that is
config.vm.network :forwarded_port, guest: 3000, host: 8080
Port forwarding does shows in terminal log when i reloaded the vagrant. However when i access the application from browser outside of the vagrant box am getting error as ERR_CONNECTION_REFUSED on the browser. I also binded the address to 0.0.0.0 by running the below command but still no luck. Any suggestions please what i may be missing? I also did set the proxy settings but still no luck.
sudo ./standalone.sh -b 0.0.0.0
Below is the port binded with 0.0.0.0
Below is the log for my vagrant reload
Below is the port forwarding i set in my ubuntu vagrant box
Below is the error on the browser
I found something that could help.
I'm using a RHEL 7.6 and the firewall was on:
$ sudo firewall-cmd --state
running
After disabling:
$ systemctl stop firewalld
$ sudo firewall-cmd --state
not running
I successfully access Jboss console from the outside

Cento 7 Firewalld refuses all incoming connections to my web-server

I have Centos7 VM built using vagrant with private IP address of:192.168.56.255
I am running my Spring boot application on that VM on port 8443. It supports HTTPS. My issue is that when try to send https requests to 192.168.56.255 web server via Curl command i got
curl: (7) Couldn't connect to server
I have read many tutorials that explain how to configure my Firewall in Cento7 but still got the same issue one is provided by DigitalOcean
When I type
sudo firewall-cmd --list-all-zones
I got
public
target: default
icmp-block-inversion: no
interfaces:
sources:
services: ssh dhcpv6-client https http mysql
ports: 8443/tcp 3306/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
As you can see I enabled everything I need and more but still. I even shut down the Firewall but still the connection is refused from my host.
When I made the changes I did reload my firewall
sudo firewall-cmd --realod
So that is not the problem
The problem was not with the Firewalld but with the pre-configured IP address using Vagrant.
The IP address should not be 255 in the first byte as I did 192.168.56.255
because that indicates that this is a broadcast address. So i solved it by changing it to 192.168.56.10

Resources