简体   繁体   中英

Accessing virtual host by ip

I have a Virtual Host in my machine with this configuration:

<VirtualHost 127.0.0.1:80>
  ServerName codigos
  DocumentRoot /home/code/codigos/app/webroot
  SetEnv APPLICATION_ENV "development"
  <Directory /home/code/codigos/app/webroot > 
     AllowOverride All
     Order allow,deny
     Allow from all
  </Directory>
  </VirtualHost>

Ok, that works nice when I type this in my browser: codigos/some_path and 127.0.0.1/some_path But now I'm working with PayPal and I need a url for the IPN. I know that I cant' put localhost in the url, so I suppose that it would be something like this: my.dynamic.ip/some_path/ipn.php ... and thats my problem, I don't know how to configure my apache file to achieve this. Thanks.

  1. Register at http://www.noip.com/ (or any other dynamic dns site)
  2. Set up their software so that you was possible to ping blabla.noip.com host (or whatever host you've got after the registration and setting up process) and see it resolves to your ip (you can check it with my ip in google)
  3. After that put the given hostname blabla.noip.com to the ServerName or (better) ServerAlias directive

After that you'll be able to access to your virtual host from outside (assuming your firewall doesn't reject connections and you have white IP address)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM