WordPress.org

Forums

[resolved] Using WordPress without an Internet Connection (21 posts)

  1. john.coleman24
    Member
    Posted 1 year ago #

    Hi There,

    I have a unique problem. I need to install WordPress to use in a classroom that does not have access to the internet. Installing WordPress went as smoothly as it ever does, but it is loading pages incredibly slowly (often, close to a minute-long page loads, even loading them locally, sometimes timing out before the page loads completely and an empty site). We did a test with a fairly large static HTML site and it loads super-snappy, so I do not think it is a web server/networking issue.

    My guess is that there are calls being made to external websites. And, if that is the issue, I am curious if there is any way to disable all external calls from WordPress.

    Anyhow, I know this is, at best, an edge case, but I sure could use some help with it. WordPress would be a great resource in this classroom for these students, but as slow as it is, it is not really usable. Thank you!

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Many good teachers bring an internet connection to the classroom. Have you reviewed such options, that is not connecting thru the school site (for security reasons)? Many IPS's provide such access.

  3. john.coleman24
    Member
    Posted 1 year ago #

    Thanks for your reply. To put it simply, internet access is strictly forbidden and will never be an option.

    However, it is a program teaching graphic design, web design, scripting, UI design, etc., and having a working, contemporary platform to deploy to would really help the program out. As such, I am hopeful to find a way to make WordPress run (happily) in a fully offline environment.

  4. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    internet access is strictly forbidden

    You can but you will need to setup a server and find a way for your class members to connect to it. Such will also likely violate such terms so I suggest you work with school administration for such. This forum is not here to help you circumvent school policy.

  5. john.coleman24
    Member
    Posted 1 year ago #

    Maybe I am not understanding you, but the WordPress server is in the classroom. And, WordPress is up and works, other than being too slow to actually use. My thought is that it is so slow because of a complete lack of Internet access, so my hope is that there is some way to disable all external calls. I am not looking to violate any policy, I just want to stand up a local, offline WordPress server with a "normal" level of performance.

  6. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Did you bring this device that has WPORG on it or is it a school provided machine?

  7. john.coleman24
    Member
    Posted 1 year ago #

    It is school provided, it is also the file/print server for the class.

  8. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Then the local group policy or other network/admin scripts/setup is invoking rules, all of which your admins can and will be aware of. Again, you need to work with your school's folks on this.

  9. Dave Naylor
    Member
    Posted 1 year ago #

    @john.coleman

    Are you able to monitor network connections on your computer? I'm not sure which platform you're on but if you can run a tool to monitor connection attempts it could help you debug your WordPress problem.

  10. john.coleman24
    Member
    Posted 1 year ago #

    @pioneer, I appreciate the help, but I am not sure where you are going with that. Lack of Internet is not a group policy, or even firewall setting. There is physically no Internet in this facility.

    @WPRanger, that is a good idea. It is a Win2008 Server, so I will look around for some options. My gut is that it is the core updates that are the biggest problem, but I am betting there are some API calls (or something similar) in there too.

    Thanks for the help!

  11. john.coleman24
    Member
    Posted 1 year ago #

    OK, so I fixed this issue, but in a somewhat unorthodox/kludgey way. But, for the benefit of anyone who reads this later, here is how I got the speed up.

    The issue was external website calls from WordPress. Tracking these down was no easy feat. What ended up working the best, mentioned by @WPRanger was to install a network monitor on the server. Since this is a Windows Server, I used Microsoft Network Monitor:

    Microsoft Network Monitor

    But, that wasn't enough to trap these. That is, since there is no Internet access, these requests were never making it out of the network card of the server. So, what I did was setup a test server (with just WP installed on it), used my main server as the DNS server, and then logged all DNS requests.

    From there, I was able to trap a list of all of the hosts MY installation was trying to call. To simplify things, I installed a plugin to completely turn off core updates, and I removed the URI's and version numbers from my plugins to keep them from checking for updates.

    Then, with my list of DNS requests, I simply set each host to my localhost IP in my hosts file. As such, here is what my hosts file looks like (yours might be different, based on your plugins):

    127.0.0.1 fonts.googleapis.com
    127.0.0.1 1.gravatar.com
    127.0.0.1 wordpress.org
    127.0.0.1 gmpg.org
    127.0.0.1 0.gravatar.com
    127.0.0.1 http://www.w3.org
    127.0.0.1 update.wordpress.org
    127.0.0.1 api.wordpress.org
    127.0.0.1 ajax.aspnetcdn.com
    127.0.0.1 planet.wordpress.org
    127.0.0.1 codex.wordpress.org

    Once I made those additions to my host file, WordPress runs about 20X faster (page loads in much less than a second, vs 5-10 seconds). It would be nice if there was a plugin that did this, but again, I get that I am an edge case. I hope that helps!

  12. Pukeko Creative
    Member
    Posted 1 year ago #

    @john.coleman

    I have spent SO long searching for the answer to this same issue and appreciate your final post, it is incredibly useful. I'm surprised that there a so few installations of WordPress on closed networks - judging by the documentation for such a setup, which is non-existent. If you ever write a plugin to solve this issue I will be downloading it! In fact, I'd love a copy of the plugin you have written if you're able to share it? Thanks, Karen

  13. hbirch
    Member
    Posted 1 year ago #

    @john.coleman24

    I'm stunned by the initial lack of help you received. I find it very frustrating as someone who works offline often being told that the problem is my choice to work offline, not the software's insistence on reaching a host no-matter-what. It's a real failure on wordpress' part to not either have a configuration option to deal with this problem OR some instructions on server setup that would help shorten the DNS wait time before giving up. I have been running into the same problem locally off and on... there really must be some server configuration we can do to cause wordpress/php/local-browser to fail quicker when it DNS is unresolvable or a destination IP is unreachable.

  14. fasc
    Member
    Posted 1 year ago #

    Thank you john.coleman24! It was exactly what I needed!

  15. mishamsk
    Member
    Posted 8 months ago #

    Great, seems to be just what I was looking for! Though the process is inconvenient, shame on wordpress.

    I am developing my site locally on my laptop and I would like to do it even without internet (i.e. during long flights). Changing hosts all the time is an option, but it would be a blessing to have normal solution.

  16. najamelan
    Member
    Posted 6 months ago #

    This definitely is a wordpress bug. Moreover it's a security issue, cause it most definitely leaks that you have wordpress running, as well as the plugins you have and probably also your site url or blog name. You might not always want that, and for security you might run a server that doesn't allow outbound connections.

    Working around this is not easy, but I think that there are several options.
    - hosts file
    - firewall
    - php.ini settings disabling the functions that connect out

    still haven't found anything convenient though.

  17. screampuff
    Member
    Posted 4 months ago #

    does define('WP_HTTP_BLOCK_EXTERNAL', true); in wp-config.php not accomplish this?

    I'm running a company intranet site, if I disable functions that connect out in php.ini, will that also block connections to our internal users?

    This is incredibly frustrating, I switched over from Drupal and I'm shocked it's such a hassle to install WP in a closed network.

  18. wpwalker
    Member
    Posted 4 months ago #

    I have also been frustrated with my wordpress sites' slowness on local dev, and had also tried john.coleman24's method of blocking in my hosts file. Trouble is, that keeps us from accessing things in our normal surfing.

    Thank you john.coleman24 for not giving up and keeping this up on the radar, and to screampuff for the mention of define('WP_HTTP_BLOCK_EXTERNAL', true); ! That sent me sniffing on the trail, and i believe that yours is the Solution:

    in wp-config.php
    define('WP_HTTP_BLOCK_EXTERNAL', true);

    This will prevent plugins from working and core functionality, so to allow them, add:

    define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org');

    If you have any other sites/services you want to allow, you can just add them comma-delimited:
    define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org, site1.com, site2.com');

    I posted the TL:DR version of my adventures at http://www.tibetangeeks.com/technologies/web_development/cms/wordpress/10-and_beyond-Performance/External_Connections_and_Phoning_Home/external_connections_from_wordpress.html

    Hope this helps.

    -- wpwalker

  19. mishamsk
    Member
    Posted 4 months ago #

    @wpwalker nice one, I'have actually read it through;)

  20. wpwalker
    Member
    Posted 4 months ago #

    @mishamsk wwwwwwow! :)

  21. najamelan
    Member
    Posted 4 months ago #

    I now use HTTP_BLOCK_REQUEST as well.

    I made changes to the wordpress core in order to make the user interface consistent with the fact that it cannot connect to the internet.

    You can see my changes on github.

Topic Closed

This topic has been closed to new replies.

About this Topic