whatever i do i can't access the external URL for the site or UI - browser-sync

All external URLs work on my machine but not on other devices on the same network. In over a year it never really has but now it would be really handy for my workflow.
I have used dev-ip and set the correct IP. I use mamp pro and tried various ports and its defaults (80, 8888). The Ips are correct too.
Using those ports instead of the below yields no results. I think i should of been able to at least access the UI External from another device on the same network but cannot.
Any help appreciated or if any more info would help please let me know!
I have 30+ sites in mamp pro so always use the proxy setting incase i'm working on more than one at a time. Being able to use http://10.50.2.64:3000 on same network machines would be amazing!
[BS] Proxying: http://ggdev.jynk.net.local
[BS] Access URLs:
-----------------------------------
Local: http://localhost:3000
External: http://10.50.2.64:3000
-----------------------------------
UI: http://localhost:3001
UI External: http://10.50.2.64:3001
browserSync (latest version) & gulp settings -
browserSync.init({
files: ['{lib,templates,templates-misc}/**/*.php', '*.php'],
notify: false,
watchTask: true,
open:false,
proxy: config.devUrl,
host: "10.50.2.64",
snippetOptions: {
whitelist: ['/wp-admin/admin-ajax.php'],
blacklist: ['/wp-admin/**']
}
});
Any help appreciated. D.

Type this in your command line to open port 3000/tcp in your machine (Ubuntu):
sudo ufw allow 3000/tcp

Related

can not access http://192.168.56.1:3000 from mobile device while using browsersync

I have installed browsersync using command npm install -g browser-sync in windows 10 x64. nodejs version 10.11.0 browsersync version 2.26.3
everything is working fine in desktop. but when i try to access http://192.168.56.1:3000 from mobile device using same wifi, i get "this site can't be reached"
i have installed another tool named dev-ip which returns this in powershell:
[ '192.168.56.1', '192.168.0.120' ]
the ip series 192.168.0.120 used to work fine in my mobile devices.
now, how to use the ip 192.168.0.120 instead of 192.168.56.1 in browsersync globally?
Just specify the host in your configuration that you want the server to run on.
Eg. In you case it would be
host: "192.168.0.120"
You can refer to the link below for more information.
https://www.browsersync.io/docs/options#option-host
Hi, guys. This is how it worked for me:
Source:
windows 10
all firewalls are closed
network access (from windows) to the PC is disabled
external url from gulp 192.168.56.1:3000
proxying local php site from OpenServer
external device - iphone safari/chrome
external (virtual) device - vwware with macos
make sure that Windows Defender firewall monitor in high-risk mode -> rules for incoming connections -> Node.js: Server-side JavaScript is enabled (and other necessary apps)
Solution:
look at what ip address in the home network my PC has (all devices are connected to the same network) - for example 192.168.1.103
in the gulp file I specify it host: "192.168.1.103",
save
checking it out
Important:
for source - external device - iphone safari/chrome - correct url is only 192.168.1.103:3000
for source - external (virtual) device - vwware with macos - correct urls is 192.168.1.103:3000 and 192.168.56.1:3000 both
Visually in pic:
Result:
Checked on all devices, in virtual devices, on the PC itself
browsersync works
the Internet is not lost
there is no address conflict within the network
Hope this will help someone too 🙂
You don't have to change the settings.
run cmd using Administrator
run ipconfig
copy IPv4 address like 192.168.43.52
Now open google on mobile and add http:// at the front and :3000 or :5500 at the back.
like run http://192.168.43.52:3000

Docker request to own server

I have a docker instance running apache on port 80 and node.js+express running on port 3000. I need to make an AJAX request from the apache-served website to the node server running on port 3000.
I don't know what is the appropiate url to use. I tried localhost but that resolved to the localhost of the client browsing the webpage (also the end user) instead of the localhost of the docker image.
Thanks in advance for your help!
First you should split your containers - it is a good practice for Docker to have one container per one process.
Then you will need some tool for orchestration of these containers. You can start with docker-compose as IMO the simplest one.
It will launch all your containers and manage their network settings for you by default.
So, imaging you have following docker-compose.yml file for launching your apps:
docker-compose.yml
version: '3'
services:
apache:
image: apache
node:
image: node # or whatever
With such simple configuration you will have host names in your network apache and node. So from inside you node application, you will see apache as apache host.
Just launch it with docker-compose up
make an AJAX request from the [...] website to the node server
The JavaScript, HTML, and CSS that Apache serves up is all read and interpreted by the browser, which may or may not be running on the same host as the servers. Once you're at the browser level, code has no idea that Docker is involved with any of this.
If you can get away with only sending links without hostnames <img src="/assets/foo.png"> that will always work without any configuration. Otherwise you need to use the DNS name or IP address of the host, in exactly the same way you would as if you were running the two services directly on the host without Docker.

Mayan EDMS install, seems ok, but not working

I follow the steps on the below link, and build it on my ubuntu cloud, it seems ok, but not working on my browser.
https://mayan.readthedocs.io/en/v2.1.4/topics/installation.html
no matter on local: http://127.0.0.1:8000/
or on my cloud server: http://*..55.12:8000/
Can anyone help? I found less information on the internet about this EDMS.
The address 127.0.0.1 (or localhost) is a loopback address and only accesible to the same host only.
From the installation instructions:
Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your test server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0 or :: (with IPv6 enabled).
use:
./manage.py runserver 0.0.0.0:8000
Installation instructions

Browsersync within Vagrant VM does not properly proxy

I'm having an issue where browser-sync is not properly proxying my apache2 server. I'm running browser-sync through gulp within an Ubuntu 14.04 VM with Ubuntu 15.04 on the host. I'm using the following configuration:
browserSync({
proxy: 'localhost:80',
port: '8081',
open: false
});
The guest machine's port 80 is mapped to 8080 on the host. The gulp task runs without issue and I get the expected output from browser-sync. If I visit localhost:8081/index.php, it works without any issue. If I try to visit localhost:8081/foo/index.php, however, my browser is redirecting to localhost:8080/foo/index.php, and browser-sync does not function.
If I set logLevel to debug, I see output when I visit localhost:8081/index.php:
[BS] Browser Connected: Chrome, version: 45.0.2454.85
There is no output, however, when I visit localhost:8081/foo/index.php
Is there a bug with browser-sync when used within a VM?

Vagrant port forwarding 80 to 8000 with Laravel Homestead

My Problem:
I can only access my sites through port 8000, but not 80, which makes me think it is not redirecting 80 to 8000 as it says it should be. I want to simply type local.kujif.com into my browser and it loads the site, which I read was port 80 by default. I am using curl to check it and it returns:
curl 'http://local.kujif.com'
curl: (7) Failed connect to local.kujif.com:80; No error
However if I add :8000 to the url then it works; it returns my index.php which simply prints 'test':
curl 'http://local.kujif.com:8000'
test
My Details:
I am using Laravel Homestead and Vagrant with Oracle VM VirtualBox.
In the Homestead.rb it has the port forwarding. I haven't edited it at all:
config.vm.network "forwarded_port", guest: 80, host: 8000
config.vm.network "forwarded_port", guest: 3306, host: 33060
config.vm.network "forwarded_port", guest: 5432, host: 54320
I also have Microsoft IIS installed for my work stuff. I obviously stop that service whenever I need vagrant to use the localhost.
"vagrant up" shows:
My Homestead.yaml file:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: /Users/Tyler/.ssh/id_rsa.pub
keys:
- /Users/Tyler/.ssh/id_rsa
folders:
- map: C:\DEV\Linux
to: /var/www/
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: local.kujif.com
to: /var/www/kujif
variables:
- key: APP_ENV
value: local
You should continue to use ports above 1024 since they are non-privileged ports, BUT if you do want you can run as port 80 on the Homestead VM, as long as you don't have anything holding on to that port on the host machine. Just tried it and it worked, with a few gotchas. First, you change that line in the .rb file from:
config.vm.network "forwarded_port", guest: 80, host: 8000
to
config.vm.network "forwarded_port", guest: 80, host: 80
When you fire your VM up after saving you will get a warning from vagrant:
==> default: You are trying to forward to privileged ports (ports <= 1024). Most
==> default: operating systems restrict this to only privileged process (typically
==> default: processes running as an administrative user). This is a warning in case
==> default: the port forwarding doesn't work. If any problems occur, please try a
==> default: port higher than 1024.
==> default: Forwarding ports...
default: 80 => 80 (adapter 1)
But it worked for me. Now, to actually get to the VM I had to use it's private IP instead of the localhost name:
http://192.168.10.10/
But sure enough my site was there and everything was working. If you decide to keep it that was you can add that IP address to your hosts file to give it a nice short name.
Hope this helps.
I see there is an accepted answer, but this alternative may also help someone.
If I understand correctly you really dislike the port "8000"!
Have you tried setting a private network?
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
/*other config stuff here */
config.vm.network :private_network, ip: "192.168.33.22"
This way you can simply use that IP address, or edit you hosts file to map the local domain to that IP.
Take a look at the Vagrant docs:Vagrant Private Networks
BTW, You shouldn't need to shutdown your IIS local server as that is running on a totally different IP range. I have Apache running locally while also accessing the VM server. This allows you to use tools like composer (to pull in laravel) on your local if needed.
I'm not sure what the confusion is - this is the way it's supposed to work.
The web server on the VM listens on port 80. Vagrant/VirtualBox forwards that port from 80 (on the VM) to 8000 (on localhost) so that you can access the site at http://localhost:8000.
Port 80 on the VM's domain name is not going to be available - that domain name probably resolves to localhost.
Try the following: dig local.kujif.com (or nslookup or even ping - I don't know what tools are available on Windows) to find out what IP address that name is resolving to. You will probably find that it's 127.0.0.1 (localhost).
You could try using the IP address set in the homestead file instead: http://192.168.10.10/ - this might work, but it will depend on how networking is configured in the VM.
Ideally, you need to set networking to "bridged" in the VM - this will make the VM look (to your network) like any other device on the network. Other networking options in the VM (sorry, I'm not familiar with the options in VirtualBox) will set the VM up with its own network that is not accessible outside the VM - this is why port forwarding is used to expose network services on the VM.
You can disable the default port forwarding completely by adding the following to the Homestead.yaml:
default_ports: false
Or configure however you like by adding something like:
ports:
- send: 80
to: 80

Resources