Ubuntu 14.04 with Apache 2.4.18 and 2 sites configure - apache

I have a new Ubuntu server, on the old server (12.something) we had api.mysite.com and portal.mysite.com running. We have since moved portal.mysite.com to the new server but now I am stuck getting the api to work.
I have the ip of api.mysite.com in my local windows 7 hosts file set to the ip of portal.mysite.com and it is my understanding that if I go to api.mysite.com(on my machine with the fudged ip in the hosts file) it will go to the new server but the header for my request will identify to apache that I want to go to api and not portal.
I am pretty sure that I am hitting portal - the config file on portal is set to redirect / to https://portal.mysite.com and that is not how I know - it is because there is a ServerAlias on portal that is portal.prod.mysite.com and if I go to api.mysite.com I end up at https://api.prod.mysite.com/
portal currently redirects to https and when I am done I want api to redirect to https as well. Portal has been running fine on the new server for a few weeks no.
What am I doing wrong? I need portal and api to run on the same server.
Thank you
API:
And portal:

Related

Centos 8 apache test page

I have a clean instalation of centos 8 server with the LAMP services installed.However I can only access the apache test page on the machine and not from the network.When trying to open the page the browser shows error in connetion.I have an old server running Centos 6 which everything is running fine. even switching the IPs of the servers the new server still cannot open the page.
What i have done so far
Configure httpd.conf to listen on port 80 on the ip address of the server.
Temporarily disabled server firewall.
When i check the apache logs i can only see the logs from when i access on the machine, nothing is generated when i try to access on the browser.
Copied the http.conf file from the old server to the new server to no avail
Can someone point me in the right direction.

How to use SSL-certificates to call https://localhost with apache2 on Raspberry Pi

So I am currently working on a project where I use the Instagram API to get some user Data onto my Localhost webpage on the Raspberry. The API however needs secure redirect uri (https). But when the API wants do redirect to https://localhost/instagram it says
"404 Not Found The requested URL /instagram was not found on this server. Apache/2.4.25 (Raspbian) Server at localhost Port 443"
In the url-bar it says "Not secure", the https part is marked red and is crossed out. When I test my stuff on another computer which has Xampp and Apache running everything works fine and even if I type https://localhost it redirects straight to localhost.
I found out that I might need a SSL certificate in order to make use of https links even if I'm running on localhost. But I don't really know how I should do this on my raspberryPi. There are already some SSL modules enabled inside the Apache2 folder.

How to configure Apache 2 to use a proxy server for external HTTPS request?

My requirement is to hit external HTTPS REST API from application server.i don`t have internet access in application server(JBOSS). so,i forwarded my request to web server(Apache24) and from web server i am calling HTTPS REST API services.
Public Rest URL-: https://publicdomain.com/tracking_number
I made below configuration on Apache server.
ProxyPass /tracking_number https://publicdomain.com/tracking_number
ProxyPassReverse /tracking_number https://publicdomain.com/tracking_number
With above configuration,following URL from application server https://WEBSERVER_IP:PORT/tracking_number, responding 503 proxy error.
Because in web server, internet can be access only through proxy server.
(For example, In IE browsers,if i configure proxy ip and host in LAN settings mean, URL is accessible from browser).
So, i need to configure similar configuration in Apache also. I tried with some configurations with help of http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyremote. But nothing worked out.
How to configure proxy server(host and ip) for external HTTPS request in Apache.
Apache Version -: 2.4.29
Operating System -: Windows

xampp Apache redirect to tomcat

Using Xampp on my Windows Server I recently installed some web apps using tomcat. Using the Apache to access phpMyAdmin. After deploying I noticed I access the tomcat webapp using a URL like this: domain.com:8080/someapp/.
I do not like that but the internet says its good for some security reasons so I did not change the port from 8080 to 80 in the server.xml.
But I want the end-user not to access my app using :8080 in the URL.
How can I redirect my Apache to Tomcat witgout losing my access to phpMyAdmin?

Bitnami djangostack Not serving any pages degault/app

I am new to cloud jargon. I initiated a GCE instance sometime back and installed bitnami djangostack. It all worked fine.
One fine day due to some issue instance restarted and changed my server IP.On typing new IP in browser Apache2 Debian page was back.This previously showed Bitnami default page.
I restarted each service using /opt/bitnami/ctl script but apache was not running.
Searched and changed default port to 8080 and from 443 to 8443 in httpd.conf file.
Apache started. But still when I type on browser new server IP - I get connection refused error.Also cannot load any apps using http://serverip/Project/ which previously used to work.
Apache Error log says
localhost:8443:0 server certificate does NOT include an ID which matched server name.
Searched and changed below in /apache2/conf/extra/httpd-ssl.conf
ServerName to localhost from www.example.com
But nothing is working and I still get same error.
Can anyone help.