Results 1 to 14 of 14

Thread: home pc web server

  1. #1
    Join Date
    May 2014
    Posts
    99

    home pc web server

    Hello all and Happy New Year.

    I want my pc to be a web server without using any domain name. This is possible right ? I installed nginx and it works good, when I type "localhost" in my browser it displays index.html, but when my friend in another country types "http://5.46.89.182/" (my ip) in his browser he gets nothing, my page is not displayed. This is how it works right? What is the problem? my nginx conf file is as following:

    worker_processes 1;

    events {
    worker_connections 1024;
    }




    http {

    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;

    server {

    listen 80;
    server_name localhost;

    location / {
    root html;
    index index.html;
    allow all;
    }


    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root html;
    }

    }#server


    }#http


    -----------------------------------------------------------------

    Anybody knows how to serve static content using my pc? and let people be able access it using my ip?

    If anybody has experience with othrs, apache or IIS, I dont care what server program just need it to work.

  2. #2
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    14,592
    Very likely your cable box/router/link/thingy blocks incoming connections to port 80, which is what your URL with that IP will generate. Also, your OS firewall may block it. If you can access that IP URL from another pc, phone or tablet in your own LAN, then your OS firewall isn't the issue. I looked up the IP but at first glance it doesn't tell me much more than your country. If you're using a cable modem or something like that, fetch its manual and look up its firewall and router settings.

    To test if your OS firewall is interfering, you need to know your PC's local IP address, probably something like 192.168.1.2, and point a browser to that from another computer, tablet or maybe phone that's on the same LAN.
    ____________
    "Dumb all over, a little ugly on the side." -- Frank Zappa
    "Your right to hold an opinion is not being contested. Your expectation that it be taken seriously is." -- Jason Thompson
    "This is really very simple, but unfortunately it's very complicated." -- publius

    Moderator comments in this color | Get moderator attention using the lower left icon:
    Recommended reading: Forum Rules * Forum FAQs * Conspiracy Theory Advice * Alternate Theory Advocates Advice

  3. #3
    Join Date
    Jan 2005
    Location
    Anzakistan
    Posts
    10,823
    Yeah, to get this working on my systems, I had to do "port forwarding" in my router.

    So incoming requests on my external IP, on port 80, got routed to the local IP of the PC that was "serving".

    (I have to pay extra to my ISP for a fixed IP address, and the PC's on my local network also get fixed IP addresses from the router.)
    Attached Images Attached Images
    Measure once, cut twice. Practice makes perfect.

  4. #4
    Join Date
    May 2014
    Posts
    99
    My firewall is definitely not problem, all switched off. My laptop connects to internet via my phones hotspot. What can be done to make this work in this situation ?

  5. #5
    Join Date
    Feb 2003
    Location
    Depew, NY
    Posts
    11,208
    Quote Originally Posted by roboticmhd View Post
    My firewall is definitely not problem, all switched off. My laptop connects to internet via my phones hotspot. What can be done to make this work in this situation ?
    A lot of things behave like servers, like Skype and trillian. The other issue is, your phone might not be "listening" to the ports you need and you might not able to forward ports like you could a router.
    Solfe

  6. #6
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    14,592
    Quote Originally Posted by roboticmhd View Post
    My firewall is definitely not problem, all switched off. My laptop connects to internet via my phones hotspot. What can be done to make this work in this situation ?
    Ah, yes, I can understand that might be difficult to get working. I have no idea how configurable a hotspot can be. IF your provider allows it, and doesn't block it technically, I guess you'll need to find some guide to open an incoming network port on your phone, and some way to forward traffic through that port to your PC, like Solfe said. Risky, it makes the phone more vulnerable to hacking too. Way out of what I ever played with or worked on though... maybe you can find some kind of tutorial or something on it.

    Also, your IP address is probably not fixed then, so you'd have to check it every time you want to let someone connect. Or use some kind of dynamic DNS thingy.
    ____________
    "Dumb all over, a little ugly on the side." -- Frank Zappa
    "Your right to hold an opinion is not being contested. Your expectation that it be taken seriously is." -- Jason Thompson
    "This is really very simple, but unfortunately it's very complicated." -- publius

    Moderator comments in this color | Get moderator attention using the lower left icon:
    Recommended reading: Forum Rules * Forum FAQs * Conspiracy Theory Advice * Alternate Theory Advocates Advice

  7. #7
    Join Date
    May 2014
    Posts
    99
    I downloaded port forwarder app on my android phone. It is called fwd: port forwarder. Now, it has settings:

    Port forward, From: X Y
    To: K M

    Where for K I write my ip address (internal) (target ip), for M I write my port 80 on pc (target port)

    But I dont know what to do with X and Y(port), can you guys help?

    Three selections available for X: Io, rmnet0 or wlan0. Y is also a port number (must be above 1023)

    The website is http://support.elix.sr/#!/products/f...arted_with_fwd

    I wrote to them with no reply yet.

    What X and Y must be ?

  8. #8
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    14,592
    Looks like you got K and M correct. For X I believe you must use TCP, and for Y any port greater than 1024 (and below 65536) that you like to use, may need to experiment which one will work. If you choose to use e.g. Port 1999, the URL your friend must use should be in the form of http://5.46.89.182:1999/ , I think.
    ____________
    "Dumb all over, a little ugly on the side." -- Frank Zappa
    "Your right to hold an opinion is not being contested. Your expectation that it be taken seriously is." -- Jason Thompson
    "This is really very simple, but unfortunately it's very complicated." -- publius

    Moderator comments in this color | Get moderator attention using the lower left icon:
    Recommended reading: Forum Rules * Forum FAQs * Conspiracy Theory Advice * Alternate Theory Advocates Advice

  9. #9
    Join Date
    May 2014
    Posts
    99
    Quote Originally Posted by slang View Post
    Looks like you got K and M correct. For X I believe you must use TCP, and for Y any port greater than 1024 (and below 65536) that you like to use, may need to experiment which one will work. If you choose to use e.g. Port 1999, the URL your friend must use should be in the form of http://5.46.89.182:1999/ , I think.
    I tried it all just now, no success. set from 1050 to 80, and write http://ip:1050 still not work. Don't know what to do...

  10. #10
    Join Date
    Jan 2005
    Location
    Anzakistan
    Posts
    10,823
    What are you using to re-verify the IP address the world sees you as?
    Measure once, cut twice. Practice makes perfect.

  11. #11
    Join Date
    May 2014
    Posts
    99
    Quote Originally Posted by pzkpfw View Post
    What are you using to re-verify the IP address the world sees you as?
    I type "my ip address" in google search, and it brings me my public ip address, as the world sees me. Other sites like whatismyip dot com also give same result.

  12. #12
    Join Date
    Feb 2003
    Location
    Depew, NY
    Posts
    11,208
    I am wondering if your software is confusing the public and the private IP address. You have the public one that you are picking up via your "whatismyip" and such. There has to be the public ip to connect to the internet, but there is a private to get your phone and computer synced up on the hotspot.

    I would hate to think that you are 99.9% of the way there and the private ip address is in the settings someplace causing you trouble. Another thing to consider is, where did your private ip come from? Did you type or is it generated for you? A little glitch there could mean your phone is ready, but the computer isn't.

    I recall setting up my old macs for high speed internet and all of the heartache caused by not knowing if my service provider gave me ip addresses automatically or if I had to type something. I'd have to dig through the lame user guide they gave me every time I had a problem. And I knew that it was me forgetting a detail, not the computer.
    Solfe

  13. #13
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    14,592
    Quote Originally Posted by roboticmhd View Post
    Three selections available for X: Io, rmnet0 or wlan0. Y is also a port number (must be above 1023)
    [...]
    What X and Y must be ?
    Sorry! I started to read the document you linked to (which mentioned udp/tcp), and totally forgot you listed those three options. I assume you tried with all three, right? If I would have to guess I'd choose wlan0 first for X. (But IF you have to choose between UDP and TCP, choose TCP.)

    Quote Originally Posted by roboticmhd View Post
    I type "my ip address" in google search, and it brings me my public ip address, as the world sees me. Other sites like whatismyip dot com also give same result.
    Maybe your cellphone network is using some funky proxy stuff that makes the IP the world sees you at as not really your phone's IP. Why not cheaply rent a server somewhere and avoid all this hassle and risk? (ETA: a quick search showed me I can rent a small low traffic server for 1 euro per month)
    ____________
    "Dumb all over, a little ugly on the side." -- Frank Zappa
    "Your right to hold an opinion is not being contested. Your expectation that it be taken seriously is." -- Jason Thompson
    "This is really very simple, but unfortunately it's very complicated." -- publius

    Moderator comments in this color | Get moderator attention using the lower left icon:
    Recommended reading: Forum Rules * Forum FAQs * Conspiracy Theory Advice * Alternate Theory Advocates Advice

  14. #14
    Join Date
    May 2014
    Posts
    99
    I get my pc's private ip from ipconfig and from my hotspot details (they match).

    Here are setting for port forwarder app:

    select TCP

    from: tried all three, 1050
    to: my pc private ip, 80

    run nginx which listens to port 80 on pc
    my friend checks: http://mypublicip:1050

    doesn't work.

    By the way the company that created port forwarder app replied to me saying: "Hi Mehdi,
    Thank you for getting in touch! We understand you have raised a question related to Fwd, we will be in touch very shortly with a solution"

    I also thought maybe it's the phone networks thing, so I plan to download android web server app and try it that way to check.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •