Bitnami djangostack Not serving any pages degault/app - apache

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.

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.

apache not serving index.html unless specified

Im new to setting up apache - the site works fine on localhost but when I access it from the LAN it does now display the index.html file - instead the browser says:
This site can’t be reached
localhost refused to connect.
Ive tried editing the apache2.conf file but nothing seems to work
I think you made another mistake. When you are on a different Computer on you network, the Apache server is not available on http://localhost/ but on the domain name or IP of the Apache Server.
The browser tries to open a connection to your client computer. But its not on localhost.

Setting up Apache2 ubuntu non-ssl Server to handle incoming wss://

I am running a video chat program on my SSL site, but need to use a non-SSL server for the chat media server. Here is my setup:
Chat server is running on non-SSL Apache2 ubuntu Amazon instance on port 8080 (checked port is open and running)
Chat is sitting on ssl server using wss://[myserver]/wss/
I've enabled proxy_wstunnel on the server
I’ve added the ProxyPass to the apache2 virtual host
SSLProxyEngine On
ProxyPass /wss/ ws://[myserver]:8080
The chat is running on the server end just fine (aside from video and audio because it’s non-ssl)
It’s not working properly while sitting on the SSL server. I’m getting this error on the screen: “Websocket closed, please try reloading page later.” and this is the error in the console: “WebSocket connection to ‘wss://[myserver]/wss/?room=3’ failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR”
Any suggestions would be greatly appreciated! Thanks!
Update: After enabling ALL proxy modules, I was able to get this to work. This was the reference that saved me days of headache: https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension

WAMP localhost redirects to my IP

I had to recently wipe my PC and I'm setting up my development environment again using WAMP.
After installing WAMP, if I visit http://localhost instead of seeing the WAMP homepage I get redirected to http://x.x.x.x, where x.x.x.x is my IP.
I had this issue on another PC and after setting the inbound rules for Apache HTTP Server in my Windows Firewall settings to allow all domains it fixed the issue. I applied this to my PC, and the issue does not seem to be present for Internet Explorer, whereas for Chrome and Firefox the localhost to my IP redirect issue persists even after clearing the cache for each browser.
My C:\Windows\System32\drivers\etc\hosts file looks like this:
127.0.0.1 localhost
::1 localhost
and my firewall rules look like this:
I am not currently using vhosts and I'm on a network at my workplace (if that has any implications?)
I also encountered the same issue when using Laragon which uses vhosts and whenever I visited a virtual host, e.g. mysite.dev it didn't work properly either.
My question on the Laragon forum: https://forum.laragon.org/topic/126/accessing-mysite-dev-redirects-to-url-which-shows-index-php-at-root-folder/3
The Problem
I'm behind a proxy which is used for browsing the web at my workplace. The proxy seemed to be messing up the dns resolution whenever I made a call to localhost (when using wamp) or one of my vhosts (when using Laragon).
This was clear as when I ran the following from the command line: ping site.dev I was getting the expected response from 127.0.0.1. However, when going to site.dev in my browser I was getting redirected to my IP, so essentially my etc/hosts file was being ignored for dns resolution.
The difference between the two being that the browser is using the proxy whereas the command line isn't!
The Solution
After trying many different solutions which seemed to work for localhost (on wamp) only, but not vhosts (on Laragon) I finally got to the solution which was actually so simple!
So, for chrome I simply went to chrome://settings/ > Network - Change proxy settings > LAN Settings > Proxy Server - Advanced
Then in the Exceptions text box I added the following:
*.dev;localhost;127.0.0.1
Here's a screenshot of my settings from Chrome/Internet Options
And that did the trick! Hope this can help someone else.

Apache named virtual host not working after changing port

I have a jboss server and an apache web server on the same machine. Jboss has to stay listening on port 80, so I had to switch which port apache listened on. Before, when it was listening on port 80, everything worked fine. I set up a virtual host for a website I'm working on, and I was able to use the URL for that site as a I defined it in the virtual host file and my hosts file (I'm using Windows). After I changed the port it listened on, I get the following error:
Problem loading page: Unable to connect
I've restarted the server, restarted my machine, changed the port to several different numbers that weren't being used for anything else, and I even tried changing the localhost IP address from 127.0.0.1 to 127.0.0.2 to see if that would help, but none of this has worked. I changed the port in both httpd.conf and httpd-vhosts.conf, but nothing has really worked. I checked the IP address for the site with ping, and it showed that I'm using the right one. I would really appreciate some help because nothing is working.
Likely a local firewall issue. You should only need to change Listen, ServerName and <virtualhost>. You can use lsof or netstat to confirm the listening port.