Jenkins (windows) on AWS works fine on localhost:8080, but not reachable from outside - apache

I installed Jenkins on an AWS instance along Apache (Bitnami WAMP stack) on a windows machine
Apache works great and can be contacted under http://locahost internally and http://x.x.x.x (my own IP) externally
Jenkins works great under http://locahost:8080 internally but does not work with http://x.x.x.x:8080 externally
I have opened an inbound TCP rule for port 8080 on the security group on AWS
I opened the jenkins.xml config and launched it each time with following parameters
--httpListenAddress=0.0.0.0
--httpListenAddress=x.x.x.x
I read that i should change the $HTTP_HOST variable, but not sure where i should do that on a windows machine
This is really frustrating me

Check the windows firewall configuration on the server. Usually Windows denies external access by default.
Check this for firewall configuration : http://www.codepuppet.com/2014/02/08/enabling-external-access-to-your-apache-web-server-on-windows-7/

Related

Acess local Burp proxy from WSL

My issue is rather simple: How do I configure my setup, so that my WSL (2) instance (ubuntu) could access and use a proxy server served using Burp Suite on the same physical computer, but on the Windows side?
Currently I am getting connection refused, whatever I do. The proxy obviously works fine if I test it in windows.
The proxy is setup to redirect localhost:3001 --> localhost:80. This is where it gets a bit tangly, as the localhost:80 server is in fact running on the WSL instance too.
So basically, I would like a program, FFUF in this case, on WSL to be able to send a request through my Burp Proxy which is on Windows. The proxy then redirects the request back to WSL to the apache2 server that is running there.
WSL (FFUF) --> Windows (Burp proxy) --> WSL (Apache at :80)
I believe there is something I am missing regarding localhost and what is localhost in what case.
localhost from Windows seems to work to reference services running on WSL, but I am not sure it works the other way around...
I have tried using localhost, 127.0.0.1, and the LAN IP of Windows as mentioned in the virtual WSL network. No luck from WSL side yet.
My apache is setup to listen to 0.0.0.0:80

Remote access of network computer

I am not sure how or if this can be done. I have a home network and would like to see a computer,not the server, via a remote location. I have Apache on my server. Example: the network computers I would like to see ip 152.254.1.33. Is there a way to add this ip to Apache root directory? I have tried to add a shortcut with in the root directory and it only works on the home network, will not via remote connection.
I need some clarification here on what you are trying to acomplish, are you trying to access the Apache website outside of the local network?
If that is the case, Apache is automatically set to listen on all network interfaces, you can check this in your virtual host configuration in the sites-enabled directory of your apache installation.
You should see something like in the 000-default.conf
You can test if apache is serving pages up correctly using the command
curl 127.0.0.1
You should see the HTML of the page being served.
If this is the case, then it's likely the firewall on your machine/router or your ISP is blocking the required ports. You can allow Apache through the firewall on Ubuntu using sudo ufw allow Apache Full
If you give me some more info in comments we can probably work this out.

How to enable SSL in docker with nginx hosted in Ubuntu

I have a web application that's running inside a docker container.
It's written in Play Framework. My host is an Ubuntu 16.04 server with apache. Docker application use the nginx server. The port 443 is directed to that container. SSL in my Apache server is turned off. Now when i try visiting my domain with https the browser give the warning which is annoying.
So i got some free certificates from sslforfree.com and used it with the docker application but still the warnings come up. Do i need to use those certificates in the apache server too?
Yes.
Your browser speaks with Apache server trying to establish an SSL communication at first, then Apache will try to forward the request to your docker container.
So, indeed, it's only mandatory to secure your Apache instead of the container to have the browser not complaining.

Apache HTTP ProxyPass inside Docker container linked to other containers: Wrong remote IP interpreted by linked container

I am migrating an Apache configuration from plain host-based Ubuntu to container-based CoreOS. I have only one instance of CoreOS for exploratory purposes and personal use, so I don't really need a cloud infrastructure compatible solution for this task. Assume all containers are running on the same physical machine.
That Apache configuration was a virtual host ProxyPass with ProxyPreserveHost On. On Ubuntu with an Apache installed on the host machine and no Docker, all is well. The objective is to host multiple web services on the same machine, with each web service being on its own subdomain, on port 443.
For instance, I currently have on my CoreOS installation:
example.com (website)
gitlab.example.com (gitlab)
jenkins.example.com (jenkins)
sonar.example.com (sonar)
monitoring.app.example.com (python)
event.api.example.com (java)
legacy.api.example.com (php)
Every one of these web services are running in separate containers, and their ports are NOT published (not accessible from the Internet). As for Apache, it's running on its own container, and its ports are exposed.
I am using container linking to achieve the virtual hosts to ProxyPass behavior: --link gitlab:gitlab \ and ProxyPass / https://gitlab:443/
I am now facing a problem: If I watch the Apache Logs, I can see incoming connections are logging with the expected client IP address. However, the recorded incoming connections seen by the target containers are a container's IP address i.e. 172.17.0.1.
Due to the diversity of the target container web services (gitlab, python, java, php...), I am NOT able to tweak the implementation of these web services so that they pick the IP from another location let's say X-Forwarded-For.
What would be a way to make it so the target containers see the desired IP address they would have seen if they weren't running in Docker? I am open to solutions that involve throwing away Apache HTTP as long as the desired use case is accomplished (port 443 exposed to Internet: one domain -> one webservice, client IP preserved).
Please note that I was not able to use --net=host on the Apache server, because this option is incompatible with container links.
Links are legacy technology which is being phased out, but you are right, container sharing host network cannot be connected to any other network type.
# docker network connect bridge container
Error response from daemon: Container sharing network namespace with another container or host cannot be connected to any other network
Use pipework to connect your apache to the outside network. Put apache and all other containers in the bridge network to provide internal connectivity.
Keep an eye on macvlan driver which you should use instead of pipework once it comes out of "experimental" build.

Cannot access JBoss using localhost in my machine but working fine with loopback IP and HostName even in Remote Machine

I am using JBoss Server with Maven plugin and I cannot access the JBoss Application using localhost:8080. But using loopback ip(127.0.0.1) or HostName is working fine. I can even access it in other machines in my network using hostname. But using localhost in my machine is not working.
I am using JBoss-7.1.1 on a windows7 machine.
This sounds like a network problem and not a JBoss issue.
Make sure that the loopback IP (127.0.0.1) is correctly set in your host file.
Also check the configured interfaces of JBoss.
https://docs.jboss.org/author/display/AS7/Interfaces+and+ports