WebStorm to serve on 0.0.0.0 instead of localhost - webstorm

When I press browser icon in the upper right corner in the IDE it opens it in the browser in localhost address. All I am doing is using my computers IP with same port as in IDE but it doesn't opens in my smartphone.

So since i'm not getting any answer for this question i think jetbrains do not provide support for this. Currently what i'm using is python SimpleHTTPServer i go into the project directory and run this simple command in the terminal
python -m SimpleHTTPServer and this does the job for me.

Related

Get err_connection_refused accessing django running on wsl2 from Windows but can curl from Windows terminal

I got the err_connection_refused when trying to accessing django running on wsl2 (http://localhost:8000) from Windows but when I use curl http://localhost:8000 from Windows terminal bash, it's working fine. I have tried to add a new firewall inbound rule for port 8000 but it's still not working. Is there anything else I need to take care of.
Thanks a lot
Seems like a forwarding problem. WSL2's interface is NAT'd, whereas WSL1 was bridged by default. WSL seems to do some "auto-forwarding" of ports, but only on localhost. However, sometimes this auto-forwarding mechanism seems to "break down". The main culprit seems to be hibernation or Windows Fast Startup (which are both closely-related features).
Does the problem resolve if you do a wsl --shutdown and then restart the WSL2 session? If so, try disabling Windows' Fast Startup. I already had Fast Startup disabled due to a different (non-WSL issue) on my system, so that could be related to why I am not able to reproduce.
Along the same lines, do you Hibernate instead of powering off? In that case, a wsl --shutdown might resolve as well.
For future readers, note that the above two points seem to resolve the issue for most people who have upvoted and responded in the comments. However, if that does not work for you, the following were my original "additional suggestions":
For some additional ideas, see this github issue. There are some suggestions on services that might be needed. (Side question - Are you running Windows Home or Professional?)
Is there any chance that your Windows hosts file (e.g. c:\windows\system32\drivers\etc\hosts) points localhost to an IP other than 127.0.0.1? If I attempt to access via my local Windows IP address, rather than 127.0.0.1 or localhost, I get an ERR_CONNECTION_REFUSED as well.
Since you were looking at the firewall rules, maybe look at a forwarding rule instead of just an inbound allow?
If all else fails, try exporting/backing up the WSL2 session (see wsl --export), then import it in as a new WSL1 session. See if it works there.
On my WSL2/Ubuntu 20.04 system, I attempted to reproduce (but haven't been able to yet) with the following steps:
mkdir -p ~/src/dj-test
cd ~/src/dj-test
python3 -m venv dj
source dj/bin/activate
pip install Django
django-admin startproject config .
python manage.py runserver
(although I used activate.fish since I'm running the fish shell)
From Vivaldi web browser in Windows, accessed localhost:8000, which returned "The install worked successfully! Congratulations! ..."
curl under Powershell Core worked as well.

We couldn't find a server running on this port – are you sure there is a server running? Ruby on Rails at Nitrous.IO

Hi I am complete new to web technologies. I am learning Ruby on rails right now. I am using service from www.nitrous.io. The problem is when I tried to view my work I always get following error:
We couldn't find a server running on this port – are you sure there is
a server running? Make sure to bind your server to host 0.0.0.0
(instead of localhost/127.0.0.1).
Please refer to this support article for more details.
I tried all the ports 3000, 4000, 8080 and it still didn't worked. If some expert can pin point the problem it would be great.
try this command:
rails s -b 0.0.0.0
This might seem obvious, but just in case: you need to actually start your Rails server in the Nitrous console before you hit the preview tab. Type:
rails s
You can have multiple consoles open (just click the + tab), so you'll often have the server running in one console and the other open for typing commands.
I highly recommend you carefully follow this guide through to get up and running. Read it all and read it again if you're not sure what you did. Good luck!
http://guides.rubyonrails.org/getting_started.html
Just use rails s -b 0.0.0.0 and ensure you are in the application directory when tuning Rails.

Wamp server icon will not turn green

I read many similar questions about it but the solutions are not working for me.
The icon says WAMP Server online but it stays orange.
when I test port 80 under Apache/services/Test port 80 it says that port 80 is actually used by: Server: Apache/2.2.8 PHP/5.2.6
Shouldn't that be a good thing? As there are no other programs using port 80, despite that when I type local host I get a weird page instead of the normal one, it has pink bars
The AppServ Open Project - 2.5.10 for Windows
phpMyAdmin Database Manager Version 2.10.3
PHP Information Version 5.2.6
About AppServ Version 2.5.10 for Windows
AppServ is a merging open source software installer package for Windows includes :
Apache Web Server Version 2.2.8
PHP Script Language Version 5.2.6
MySQL Database Version 5.0.51b
phpMyAdmin Database Manager Version 2.10.3
ChangeLog
README
AUTHORS
COPYING
Official Site : http://www.AppServNetwork.com
Hosting support by : http://www.AppServHosting.com
Change Language :
Easy way to build Webserver, Database Server with AppServ :-)
I really need to start working in this project but this is preventing me from even starting.
I have solution...
Click WampServer icon in tray icons -> Apache -> Service -> Install service
(same for mysql -> Service -> Install service )
Then, Apache -> Service -> Start service (same for MySql -> Service -> Start service)
done! Enjoy :-)
If you are running Skype, stop it since it uses port80 which is needed by WAMP
You can also switch the port needed for Wamp.
Follow this article
How to change port number for apache in WAMP
Unless you really know what you are doing you should only have ONE Apache on your system.
Basically WAMPServer and APPServ are the same thing, that is they are installers for the WAMP Stack i.e. Apache, MySQL and PHP.
You only need one of them so uninstall the other, of course remember to backup anything you may want to move over to the other before you uninstall one of them.
Check if MySQL is running or not
Click on Wamp icon in icon tray then
MySQL->Service
if Start/Resume Service is visible and clickable it means your MySQL service is not running that's why it is giving you problem.
It's possible that you have installed some other application that installed and running MySQL - so already having one MySQL running is what conflicting with wamp's MySQL.
How to stop other MySQL from running?
Simply go to My Computer and search for file name "my.ini" (without quotes)
There should be at-least two my.ini files on your computer delete all other my.ini except the one in wamp directory
Restart your computer and start the wamp server it should solve your problem
As of WampServer 2.5 (64bit), these are the things I had to do to get it to go green:
In your my.ini
Change [wampmysqld] to [wampmysqld64]. Now when you start/stop wamp you should get information in your mysql log file (and errors if you have any).
I uncommented all the innodb lines under where it says Uncomment the following if you are using InnoDB tables (except for innodb_log_arch_dir and innodb_additional_mem_pool_size).
Make sure the innodb_data_home_dir is set properly, like innodb_data_home_dir = C:/wamp/bin/mysql/mysql5.6.17/data/. Do the same for innodb_log_group_home_dir.
Change the locale line to read lc-messages=en_US for English.
You can confirm mysql is up and running with Wamp Icon > Mysql > Service (Start/Resume service should be greyed out)
Install and start apache:
Wamp Icon > Apache > Service > Install Service.
Wamp Icon > Apache > Service > Start. (you can click on "test port 80" to see if something was blocking it like others have mentioned, such as skype, sql reports, etc.)
During the starting of WAMP server, the Apache service should be started as well. In case, it doesn’t start; WAMP server won’t perform as it should be.
To fix this issue, navigate to the WAMP server icon in the system tray > Apache > Service administration ‘wampapache64’ > Install Service.
it will open the Command Prompt on your screen. After closing the Command Prompt, go to the same path and click on Start/Resume Service.
The WAMP server icon should turn to green right away.
In case you can have all these but still, the icon is displaying orange color, you need to click on Restart Service button.

change port in pydev

Hi everyone i'm trying to learn the django framework and I'm using PyDev (Eclipse Python Development Framework/Plugin). When I try to run my application I get an error:
Error: [Errno 10013]
I know that this is because of the port. I use the port 8000 and i want to change it to 8080. Does anyone knows what exactly should i do to change the port?
pydev debugger: starting
Validating models...
0 errors found
Django version 1.3.1, using settings 'muapp.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Error: [Errno 10013]
It might be useful to point out that PyDev, like Eclipse, runs the configured command when the Run button is pressed. How is the default command and/or its options changed?
Have a look at this video tutorial. Skip about 14 minutes in. Then use runserver 8080 instead of runserver in the arguments.
Please take a look at the PyDev Documentation on how to change the Run configuration.
Run/Debug as Django
Run as Django/Debug as Django are available (note that they set the
--noreload by default).
This will create a default Run configuration, so, you may edit it
later through run > run configurations (or debug > debug
configurations) if you want to change a parameter.
Note: to know how to rerun the last launch see: the Rerun Last Launch
topic on PyDev Launching
Note 2: if the --noreload is not passed, only the parent process will
be killed from Eclipse and the others will only be killed when they'd
be reloaded (i.e.: on a code-change).
Whether it's "Eclipse" or "PyDev", right-click on the Project and select "Run As" --> "Run Configurations..."
Additionally, according to the django Documentation,
runserver [addrport]¶
Starts a lightweight development Web server on the local machine. By
default, the server runs on port 8000 on the IP address 127.0.0.1. You
can pass in an IP address and port number explicitly.
Therefore, in your Project's Run Configuration, on the Arguments tab, simply add:
runserver 0.0.0.0:8080
This should have the server listen on all interfaces/IPs. Alternatively, you can make it more specific to your public-facing IP instead:
runserver 123.456.789.123:45678
Please, note that in this case, my IP would be "123.456.789.123" and the port would be "45678".
The following Answers might also be of use:
How to make Django's devserver public ? Is it generaly possible?
How can i get the running server URL
External Link; Third-party blog-post

Local sites not displaying in VirtualBox when using Django's local development server?

I develop web applications using Django on Mac OSX 10.6. I use Django's built in local development server which I run on my computer's IP (such as: http://192.168.0.11:8001/). I test my applications in Firefox, Safari and Chrome and all display fine. I use Sun's VirtualBox with 3 different instances of Windows XP that have IE6, IE7 and IE8 on them.
For whatever reason, these sometimes just don't display the Django sites. They come up with 'The page cannot be displayed'. Eight times out of ten, they display fine and function normally but for no reason at all they won't display. Sometimes restarting Django's local development server from the Terminal will fix the problem, sometimes it won't.
Is there some sort of VirtualBox settings or Django settings that I need to set to ensure smooth operation of this? Am I overlooking something? Has anyone else had these problems?
By default the dev server binds to localhost. to run it on all interfaces use ./manage.py runserver 0.0.0.0:8000
I found the best way to do this is using the normal localhost:8000 or localhost:8001 (any port you need, especially if running multiple Django projects at the same time) in the Mac Terminal.
Then in VirtualBox with Windows, using the ipconfig command in the Command Prompt to find out the IP settings. Grab the Default Gateway (mine was 10.0.2.2 for example) then, in the browser, use this as the address to get to your Django project along with the original port setting that was set in the terminal. So in this case: http://10.0.2.2:8000/
I've been running it like this now for almost a week and it seems to of stopped the problems I was getting before totally. I couldn't really tell you why though!