I can't access my wamp server it's hostname from another computer - wampserver

I tried solving this for about days but I still can't find the error.
I added a hostname to my webserver and I can access it from the computer running Apache, but when I try to access the site from another computer it doesn't work. (Only using the hostname;the ip works fine)
I hope someone can help me with this!!!

Related

The question is about localhost, Swift URL, NetBeans and Xampp

everyone, I have a question to ask about "localhost"
I am a newbie and use NetBeans and Xampp as DATABASE to connect with Swift.
I use "http://localhost/" as my URL on the simulator of Mac, which works fine.
But when I change to my physical device, it has an error " can not connect to the server", how can I solve this problem?
And another question, if one day I publish the APP, what URL should I use? Is it still "http://localhost/" or anything else? I am really confused, can someone give me some advice? I would really appreciate!
localhost is 127.0.0.1 address, used only in current machine.
When you using simulator, simulator run in same machine with server, it will success access 127.0.0.1 address.
If you using real device, please find your server ip with command ifconfig and use that in App.
Hope to help you.
As was written in the comments, http://localhost/ only works on the current device (similar if you are using http://127.0.0.1). The simulator is running on your Mac, so it will work.
Since the physical device is not on your Mac, it will not work. So, for testing, you might want to set up a test server on your computer or on another machine. Then, you would replace the URL with the IP address or hostname of the server. For production, you would need to set up a server or find a hosting service. Then, you would use the URL for whatever server you go with in your app instead of http://localhost/.

why I am not able to access rails localhost on my mobile or other computer

I am trying to access my localhost of rails running project on my mobile device.
This is how I am trying.
http://ip:3000
But it says the webpage is not available.
I tried with another port as well and It doesn't work even there?
What's wrong here? I use to check earlier this way.
Please guide
Try running this code below to your server:
rails s -b 0.0.0.0
This worked for me!
Just give:
ip = your phone's ip address
(Check it in connection information if you are running this on Ubuntu)
ip:3000/your_page if you do not have mapped your root to some page.
Else ip:3000 will work if you have mapped root to some page.
Try it in Chrome and see as it doesn't need any http or https it automatically selects the required one.
Here is how I did it
Put both your computer and phone on the same wifi network
rails s -b 0.0.0.0
routerlogin.net (or however you access your router it will say on the back of router)
get attached devices to the router. Note your computers ip. Mine was 10.0.0.20
on phone go to 10.0.0.20:3000 (but use the ip for your computer from step 4)

Accessing Ruby on Rails app from a Remote PC/Network - Windows 7 WEBrick

I am making an app using Rails on my home pc, and need to access the page from a computer at work.
I've found a few questions relating to this, but nothing like a process which I can follow as someone who doesn't have an awful lot of networking experience.
I know I need to open the port which I am using, but I can't seem to do this, as in windows firewall/allow programs I cant see the 'add port' button...
Am I right in thinking that the server should be set up to use default gateway as the IP ($bin/ rails server -p 192.168.0.1), and then use my public IP to access it from my work PC?
Any help/guidance is much appreciated!
Follow one of the port forwarding tutorials which are easily found online.
The IP you set up which looks like 192.168.0.12 or similar is the local IP address. Use this too access the website on the home network: 192.168.0.12:3000 if you forwarded port 3000.
$/bin/ rails s -b 192.168.0.12 -p 3000
Now, to access the server from external network, navigate to: http://your.public.ip.address:3000, which can be found by searching "what is my ip address" in Google.
There are some projects/software that help the job easier:
https://ngrok.com
http://localtunnel.me
http://proxylocal.com

How do I make my ruby on rails app respond to external requests (visible to the public on the internet)?

Problem:
My rails app (on my local machine) only responds to requests sent from the same machine to localhost, 127.0.0.1, or my internal ip address. When I try to hit it using my internet ip or from any other machine, inside or outside of my network, it just times out. I'm on Mac OS 10.9.1, ruby 1.9.3, rails 4.0.0.
I've done a lot of searching but all I can find is problems where people didn't forward their ports or bind the right ip.
Here are the areas I've investigated:
Ports -
I've tried several different ports. I configured my router to forward every port I tried but got the same result. I thought maybe there was a problem with the router so I built a simple server in Java and bound all the same ports I was binding with my rails app. Sure enough, when I hit the Java app using my internet ip it worked just fine so the router/firewall/port forwarding isn't the problem. Also, I run an apache server on port 80 and that has never had any problems. I turned apache off and tried port 80 for my rails app but that didn't fix the problem.
Rails Server -
I started with WEBrick and I thought that perhaps there was some setting inside that blocked external requests. I searched google extensively and found nothing on that matter. Just to be safe I installed Thin and got the exact same result I did with WEBrick. One interesting thing is that when the rails server is started, the external request takes a long time to time-out, but the server console displays no output at all. However if I try to send the same request w/out starting the server at all it fails immediately.
User Permissions -
I started the server with root (i'm starting to just shoot in the dark here) and it had no effect.
Environment -
I was starting in development environment originally because I'm developing but just for fun I tried starting in production and it also made no difference.
PLEASE HELP ME SMART PEOPLE
Update:
I installed the app on my Ubuntu machine and it doesn't have this problem! So that suggests the problem may have something to do with Mac OS.
SOLVED:
It turns out that in the System Preferences -> Security & Privacy -> Firewall in Mac OS, it was somehow set to block incoming connections to Ruby 1.9.3. I must have accidentally set that some time ago.
The problem is you are probably trying to request the page from your local machine (or any computer on your local network, behind your firewall) to your public IP expecting a result... not unless you setup routes through your firewall for this (and not usually available on a consumer level router... linksys, dlink, etc)
So forward port 80 if you are using something like pow, or 3000 for web bricks default port to your local machine
Then have someone outside your local lan request your external (public) IP
This may be related: Rails 3.1 on Ubuntu 11.10 under VirtualBox very slow
Your mention of slowness combined with the use of webrick makes me think you've got some reverse-DNS lookup awfulness going on. A quick first step is hacking /etc/hosts to bypass this lookup.
The situation I dealt with on Ubuntu was solved in the short-term by hacking /etc/hosts. You could do this quick hack in order to see if it is indeed just webrick's reverse-DNS lookup. Edit /etc/hosts and add a line for the external user's IP address, something like this:
156.123.48.55 TestPerson
Replace the IP address with the tester's IP address. Since you said you can get the external request to hit an Apache server on port 80, you can grab their IP address from the Apache access logs if necessary, otherwise just ask the person testing.
You could also try a different web server, such as unicorn, which may help out. Add "gem unicorn-rails" to your Gemfile, run bundle install, and then (according to their docs), rails server will just use unicorn directly.
With any local server, you'll need to correctly configure port forwarding on your firewall. Like said by CaptChrisD, tests must be done by an external IP/browser (if you own a server, ssh on it, then w3m to test).
I already had same symptom (server started => timeout, server stopped => fail) and the origin was an issue with firewall configuration. I think it is your problem.
With MacOS, Pow is really awesome: installation is easy, no configuration required (no /etc/hosts…). Moreover, they give you a hook for external access to your virtualhosts (but you still need port forwarding on your firewall).
Otherwise, there is other solutions like Forward to do it without firewall configuration (30-days free trial).
Hope this helps!

Error when trying to open my localhost

Hello guys
i have installed wamp server Version 2.0 .. and i have tried some things and every thing ok ..
i have reboot my Desktop then some thing goes wrong when i am trying to open my local host
EMDAEMON
HTTP/1.1 404 , Not Found
should i consider re-installation ??
Reboot desktop? Open your local host? If you want to do web development you should get familiar with basic computer terminology, at least to a point when you are able to make questions that make a minimum sense.
I'll assume you have installed a bundle that includes the Apache web server and you want to configure a virtual host that's served when you load http://emdaemon in your web browser. The exact details to do so vary slightly depending on your platform. Being a newbie, I suggest you reuse the main site that's already configured and can be loaded through http://localhost. It's roughly explained at http://www.wampserver.com/en/presentation.php. Leave multiples sites for the future :)
Solved .... it seems that we have conflicts in ports ..change port in apache make it works

Resources