localhost is not working on browser but i can ping it - apache

am using debian , and am working on a php laravel project
so first thing to do is
sudo service apache2 start
sudo service mysql start
every thing working fine , the project is working great my sql is working ,
the problem is in the browser i when i go to localhost or 127.0.0.1 or localhost/phpmyadmin
it gives me Unable to connect
How ever i can ping localhost it give me this result
64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.048 ms
and ping 127.0.0.1 result :
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.044 ms
so i assumed that the problem in hosts file that the domains is not resolving for a reason ,
am not sure what happend , last thing i was doing i was trying to install tor service and browser
please help me , all my work is on hold , and i tried many things .
i also thinking that it might be a DNS problem.

This means that your application is running under a different port. When not specifying a port, your browser will assume 80 for http and 443 for https traffic.
Try other commonly used ports like 8080 or 8000:
http://localhost:PORT
ping has nothing to do with your web server, by using it you can check if a host is reachable.

Related

Can't access Vue3 app on server using domain name, but works with IP

I have a Digital Ocean droplet running two Docker containers, one that is a Vue3 app which I'm having issues with, and a Django server that I'm not having issues with.
vue-cli-service serve --mode production --host 0.0.0.0 --public http://XXX.YYY.ZZZ.XXX:8080
If I go in Chrome and type www.websitename.com
This site can’t be reached websitename.com refused to connect.
If I go in Chrome and directly type the IP and the port I can see the website load. Is this a DNS resolution issue? I really don't think so, here's why:
If I go in Chrome and type http://websitename.com:8000/admin
I see a Django administration site. This means that I have no problem with Django, only with Vue3.
I tried setting --host 0.0.0.0, I tried adding --public with the website name and with the IP directly.
Also nmap seems to show everything working fine
nmap -F websitename.com <---- No issue with DNS resolution
Starting Nmap 7.80 ( https://nmap.org ) at 2022-07-26 20:14 PDT
Nmap scan report for XXX.YYYY.ZZZ.XXX <---- Correct IP
Host is up (0.090s latency).
Not shown: 92 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp filtered smtp
111/tcp filtered rpcbind
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
445/tcp filtered microsoft-ds
8000/tcp open http-alt <---- Django
8080/tcp open http-proxy <---- Vue3
If you do not provide a port in Chrome - it will default to port 80. But your Vue3 Docker is running on port 8080. Therefore you have to either provide this port when you type the URL in Chrome - or you must run your Docker on port 80.
You are providing port 8000 for the Django administration site - do the same (with port 8080) for your Vue3 application.

WAMP SSL - LOCALHOST and connection problem from another VM

I set up 2 VMS connected to each others , ping is working on both machine.
After that , I set up a WAMP serveur on machine 1 and managed to configure SSL on it. It's working on local host as described on this tutorial.
https://zuziko.com/tutorials/how-to-enable-https-ssl-on-wamp-server/
Now my problem is i need to be able to connect from the browser of VM 2 on the wamp server with SSL.
That's where i have a problem.
From Vm2 when i connect to VM 1 ( 192.168.56.10:8080) it's working
when i connect to 192.168.56.10:443 i have a bad request.
I am missing something .. can someone point me out where to look ?
thank you very much
enter image description here

Can't Connect to Apache Server on LAN

I have a very simple LAN setup and am trying to connect to an Apache server running on the LAN. The server IP is 192.168.1.178. I'm trying to connect from a box on same LAN with IP of 192.168.1.161. Attempting to connect from browser results in error saying site is unreachable. I can ping the server and SSH into the server. But, telnet and curl result in no route to host errors.
Both boxes are set up with static IPs. DNS for static connection is 192.168.1.1. Both boxes are running Manjaro and no firewalls are turned on. Apache access logs show no attempt to connect and there are no errors in the Apache error logs.
I also set up a test python server (sudo python -m http.server 80) to try that. Attempting to curl to that server results in 'connection refused' error as opposed to 'no route to host' error for the Apache server.
Traceroute results are:
traceroute 192.168.1.178
traceroute to 192.168.1.178 (192.168.1.178), 30 hops max, 60 byte packets
1 raptor (192.168.1.178) 0.434 ms !X 0.366 ms !X 0.400 ms !X
I discovered that a firewall daemon was running, which was causing the problem. Disabling the firewall solved the issue.

Why is connection refused by Vagrant box in Windows 10?

I've been having problems with Vagrant since upgrading to Windows 10. At first I had the "host-only adapter" problem that many people seem to be experiencing. This was fixed by updating VirtualBox to the latest version, and my Vagrant box now seems to provision and start ok, and I can SSH into it, but can't connect via HTTP. If I try to access it from a browser, I get "Unable to connect". If I try curling it, I get the message:
Failed to connect to test.dev port 80: Connection refused
I've checked and Apache seems to be running on the VM (and in fact if I SSH into the VM and then run curl 127.0.0.1 the expected homepage is returned). At this point I've drawn a blank: I don't know whether the problem is in Windows or the VM's settings. Any help would be greatly appreciated!
(For what it's worth, I'm using VirtualBox 5.0.15r105158 + Vagrant 1.8.1)
Update: it turns out that the VM is accessible from test.dev:8888 in the browser, so I'm guessing the problem is to do with port-forwarding? I don't know much about this though, so have no idea why this wouldn't be working in Windows 10. (In case it helps, my Vagrantfile contains the line config.vm.network :forwarded_port, guest: 80, host: 8888)
I think you have answered all by yourself - you might read the vagrant doc on port forwarding
Vagrant forwarded ports allow you to access a port on your host
machine and have all data forwarded to a port on the guest machine,
over either TCP or UDP.
For example: If the guest machine is running a web server listening on
port 80, you can make a forwarded port mapping to port 8888 (or
anything) on your host machine. You can then open your browser to
localhost:8888 and browse the website, while all actual network data
is being sent to the guest.
when you add the line config.vm.network :forwarded_port, guest: 80, host: 8888 to your vagrant file, the VM (i.e. call also guest or guest VM) )will forward all the stream going on its port 80 to the host (in you case the windows machine) on port 8888, so in this case when you point your browser to listen on port 8888 you can see the website running from the VM
When you are within the VM though, you point to the expected 80 port.
one additional point (hope not to confuse you): in your Vagrantfile, did you define something for networking ? (param config.vm.network) you probably define a fixed IP (since you point to test.dev) in such case you dont need to do port forwarding, you can correctly access http://test.dev (on default port 80) as nothing else is bounding to this port. Port forwarding is really useful when you use public network and you do not define a fix IP to the guest VM, so in this case you access the site running on the VM from localhost/127.0.0.1, and as such you cannot just point to port 80, as something on your host can already be running.

Install Apache server on 4G Network

I have installed XAMPP to run Apache server on windows,So the Apache server run great on LAN (Local Area Network ).
But i need to run the server ,so the public can access it from WAN
(Wide Area Network) .
I have forward HTTP port 80 on 4G portable router ,but no device can access the Apache server from Public (WAN)
** I have tried DDNS solutions also with no success.
The issue is most likely the 4g network itself. It seems they don't allow servers to wait on their network.