GET /favicon.icon 404 error in ngrok - http-status-code-404

On running ngrok and going to the suggested url, i get
GET /favicon.icon 404 error in ngrok.
In which folder does ngrok search for the favicon.ico file ?
How do i fix this ?
Very new to ngrok. Do help me out
Thanks in advance

I ran into a similar problem with URIs from ngrok being served as 404s.
I have a local Apache, PHP and MySQL stack setup on macOS using *.dev domains.
So in my case, I needed to set the host-header option in ngrok to match the hostname of the virtual host Apache was configured for.
Here's the relevant part of my Apache virtual host configuration:
<VirtualHost *:80>
ServerName example.dev
ServerAlias www.example.dev
...
UseCanonicalName Off
</VirtualHost>
The necessary ngrok arguments to tunnel requests to my private development domain were:
$ ngrok http example.dev:80 -host-header=example.dev

What ngrok do is,make tunnels to localhost.That allows you tunnel requests from Internet to your local machine.
You can see following details after running : ngrok http 8888
Tunnel Status
online
Version 2.0.19/2.0.19
Web Interface http://127.0.0.1:4040
Forwarding http://299954c1.ngrok.io -> localhost:8888
Now all the data intended for 'http://299954c1.ngrok.io' url which is publically accessible will come to your local machine at port 8888
You need to have some server running on your local machine at port 8888 which can serve 'favicon.icon' static file
If you are able to get icon by hitting : localhost:8888/favicon.icon in your browser, You will surely get it from http://299954c1.ngrok.io/favicon.icon

Related

PgAdmin4 website hosting on port 443 (https)

For my project i configured the postgresql and pgadmin4 .. but now i want to make the website secure with proper DNS name and run over port 443. DNS is also done but how to make it run over 443 from 80. ie., from http to https. i made changes in httpd.conf file and added certificates required too. but website is not loading ,still the website is opening on http:// ip address but not on https://
I tried making changes in configuration file too
LL be Much thankful.
how to configure pgadmi4 on port 443 https

Apache2 conf file redirecting requests for other enabled sites

I'm running apache2 on ubuntu 16.04. I've configured apache2 to run multiple sites. One of the sites has https setup and to help support this I've added the following rule to redirect http requests to use https:
<VirtualHost *:80>
ServerName http://example.com
Redirect permanent / https://example.com/
</VirtualHost>
This has been too much of a blanket rule as it's redirecting other site's https requests to the domain above.
How can I re-configure the conf above to only redirect http requests for example.com and not the other sites on the same server?
The first listed virtualhost for each host:port acts as the default, catching all unmatched ServerNames. Make sure you don't define your special-case first.
See apachectl -S output for a summary of where your vhosts are loaded from and which one is the default.

VirtualBox: How to access virtual host on VM from host?

How to access from the host the Apache virtual domain created on virtual machine.
Settings of the VM on VirtualBox:
VM ubuntu/precise32 on VirtualBox created with vagrantfile from How to setup a LAMP development environment in Vagrant by Sanchit Jain Rasiya
installed Apache/2.2.22
installed Lynx browser
Virtual Host /etc/apache2/sites-available/example.com
ServerAdmin webmaster#example.com
ServerName example.com
DocumentRoot /home/vagrant/www/example.com
AllowOverride All
Order allow,deny
Allow from all
ErrorLog "/home/vagrant/www/example.com/logs/example.com-error.log"
CustomLog "/home/vagrant/www/example.com/logs/example.com-access.log" combined
From the browser on the host machine I can access VM's localhost as http://192.168.205.10/index.html
How can I access VM's example.com?
On the host's /etc/hosts I have added line for example.com
127.0.0.1 localhost
127.0.0.2 tmp.loc
127.0.0.3 temp.loc
192.168.205.10 example.com
When I try http://example.com/mj.html I get the 404 Not Found page from Apache/2.2.22 (Ubuntu) Server at example.com Port 80
On the virtual machine I can access page with the Lynx
lynx http://example.com/mj.html
This is noted in the /home/vagrant/www/example.com/logs/example.com-access.log file as
127.0.0.1 - - [03/Apr/2016:15:53:49 +0000] "GET /mj.html HTTP/1.0" 200 344 "-" "Lynx/2.8.8dev.9 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/2.12.14"
But when I try to access example.com from the host there are no logs neither in access.log nor /home/vagrant/www/example.com/logs/example.com-error.log
There are no logs in the host's Server files /opt/lampp/logs/access_log and /opt/lampp/logs/error_log
On Ubuntu /etc/hosts:
127.0.0.1 localhost
127.0.2.2 example.com
On Windows (VBox) C:\Windows\System32\drivers\etc\hosts:
10.0.2.2 localhost
10.0.2.2 example.com
Then just reboot your VBox Windows and type in browser (on Windows):
http://example.com/
I have the same issue, I've been trying to access my drupal project from my virtualbox vm but it is not working. One of the solutions I found on the Internet is using the outer keyword in your hosts file in the VM.
The following works fine for me:
In your host machine (let's say a ubuntu) type: ifconfig, and get the
inet address of wlan0 (example: 192.168.1.15)
Add this address to the host file in your virtualobox machine and use the outer keyword
[192.168.1.15 outer]
Now you can access your localhost from your virtualbox browser by typing the address of your wlan0 (ex: 192.168.1.15).
If you need to access a specific port on your host add the port number to
the address example 192.168.1.15:8001

Why does Nginx give a 502 error only for mobile devices?

Using Nginx, I'm getting the error:
Error 502 - Bad Request
The server could not resolve your request for uri: http://domain.name/file/path
Oddly, I only get this error when my phone is using data from my cell carrier. The server serves everything just fine when I am using my phone on Wi-Fi or when I'm using a desktop computer. It even works when I am using my iPad conneted to my phone via Wi-Fi with my phone acting as a mobile hotspot.
The 502 error code suggests that there's an issue with reverse proxying or serving requests with php-fpm. I'm doing neither of these.
Because this error is happening only under specific circumstances, I'm thinking it has to be something with the request my phone is sending. (Nexus 5, Chrome, Android Lollipop)
My nginx.conf and other configuration files are passing tests. I used:
sudo nginx -t
and it said "the configuration file syntax is okay" and "configuration file test is successful."
What could be going on?
After tripple-checking my Nginx configuration, I had the idea to look at all tcp activity on port 80 of my server.
I installed tcpdump:
sudo apt-get install tcpdump
Then ran it, looking only for port 80 tcp traffic:
sudo tcpdump 'tcp port 80' -i eth0
I noticed that all other traffic was just 'IP', but when I sent a request from my phone, it was 'IP6'.
My server wasn't ipv6 enabled, but that's an easy fix with an additional listen directive:
listen [::]:80;

Multiple Domains on a VPS with Apache

I am planning on getting a VPS soon and have two sites I want to host. I have my local vhosts setup for my development environment using host file to port it correctly.
My question is hopefully simple: When setting up with two separate domains that point to the one VPS server is Apache smart enough, like on the local environment, to automatically filter any requests for domain.com to the correct VHOST like it does locally? I would just like to be sure :)
Thanks!
Example of what I am asking:
Say Domain1.com and Domain2.com are both on my VPS.
When someone requests www.Domain1.com apache sees this and passes it through to the domain1.com vhost file.
When someone requests www.Domain2.com apache sees this and passes it through to the domain2.com vhost file.
Repasting my answer from Hosting two domains using only one VPS? as here it is even more relevant.
As complete beginner, I have been trying to host multiple domains on one Apache VPS. Tutorials had too much information that lead me to confusion.
Below I describe, for complete beginners, how to host multiple domains on one VPS server with Ubuntu and Apache.
IMPORTANT! You need to use root account to execute most operations.
IMPORTANT! If you have been trying to make some changes to apache configuration before, undo them.
Creating VirtualHosts
Create folders for your domains on server.
For example:
/home/apache/domain1
/home/apache/domain2
Put index.html file in each folder with any text.
This is domain1
This is domain2
Go to /etc/apache2/sites-available folder.
Create file domain1.conf
sudo nano domain1.conf
<VirtualHost *:80>
DocumentRoot /home/apache/domain1
ServerName domain1.com
ServerAlias www.domain1.com
</VirtualHost>
Create file domain2.conf
sudo nano domain2.conf
<VirtualHost *:80>
DocumentRoot /home/apache/domain2
ServerName domain2.com
ServerAlias www.domain2.com
</VirtualHost>
You can create subdomains same way.
sudo nano blog.conf
<VirtualHost *:80>
DocumentRoot /home/apache/blog
ServerName blog.domain.com
ServerAlias www.blog.domain.com
</VirtualHost>
Enable created sites
sudo a2ensite domain1.conf
sudo a2ensite domain2.conf
Restart apache
sudo service apache2 reload
Redirecting domain to server
Created VirtualHosts will work only if you redirect your domain name to server IP. Domains are just names that can be translated to IP numbers.
Local computer
To test your configuration on local machine, you need to edit hosts file.
sudo nano /etc/hosts
It should look like this.
127.0.0.1 localhost domain1.com domain2.com
Hosts file tells your computer that domain needs to be redirected to local machine.
IMPORTANT! If you create entry in hosts file for existing domain, for example
127.0.0.1 stackoverflow.com
you will loose access to this website.
Server
In order to redirect domain to you web server, you need to create or modify "A"-type DNS record for given domain to IP address of your server. You can do it by panel control provided by your domain registrar.
If you do not know IP address of your server, log in to that server and type in command line:
ifconfig
The simple answer is 'yes', Apache is that clever. If you are used to using a local vhost file in conjunction with your hosts file to simulate local domains, the exact same technique can be applied on a VPS. The part you are doing with the hosts file is essentially creating a local name server, other than that Apache doesn't know the difference. Simply set the ServerName directive for each named vhost and you should find it working the same as it does locally.

Resources