Web Site Help: How do I make the computer run the site locally?

I am trying to move a Wiki website (backup of one anyway) to a laptop so we can show people the site without it being connected to the internet.

Essentially I want to run the site entirely locally and not have the computer think it needs to go to the web. So, internal links in the Wiki need to pull up pages from the internal website.

Is there a way to tell my PC to do that?

file --> save as --> webarchive.

it should then load up as normal on your PC.

Someone else will come along with a more detailed answer, but basically you need…

All your links to be document or site-root relative…

<a href=“/pages/page-about-bunnies.htm”> A Page about bunnies</a> - Good.

<a href=“…/page-about-bunnies.htm”> A Page about bunnies</a> - Good.

<a href=“page-about-bunnies.htm”> A Page about bunnies</a> - Good.

<a href=“http://yourwebsiteurl.com/pages/page-about-bunnies.htm”> A Page about bunnies</a> - Bad.
And if your page uses ASP - your computer needs to be running as an ASP enabled web server (Install Microsofts Internet Information Services) and you access your site via http://localhost.

Same for if your site uses PHP - you need your computer to be running a PHP server (Apache) and you access the site from http://localhost.
But mainly, if you’re testing a basic html page with links on it, and you want your links to work - they all have to be document or site root relative. once you move your site to a web server all the links should still work - as long as the directory structure remains the same.

That sounds very specific to a particular website authoring application. My answer refers to websites in general…

Ideally all links should be document or site-root relative. Unless the link is to an external website (different server with a different url) in which case they have to be ‘absolute’ (not relative to the current file, but a complete address, such as the last ‘bad’ example in my previous post)

While this is good practice, if you are unfortunate enough to have a bunch of hard-coded URL’s in there which reference the domain, it may be easier to add an entry to the HOSTS file on the machine you want to use, to define yoururl.com as 127.0.0.1. This way, links to the domain will be served up from the local machine.

A bunch of HTML pages could just be dumped on a PC and accessed without further ado, but a Wiki is not just a collection of static web pages, it’s an editable content database. “Wiki” is kind of a generic term and there is more than one way to implement one. The one that Wikipedia uses (we use the same one at my office) uses PHP. Therefore

I am not sure what database it uses.

I also do web site development on my home PC using PHP and MySQL. I use a free package called EasyPHPwhich bundles PHP, MySQL, and Apache. It’s not very difficult to get it going but you do have to get it configured properly.

If the Wiki has links outside the Wiki, then you have a whole nother issue to deal with based on how you’re connected to the network (but not connected to the Internet?).

I use WAMP (Well I don’t because I now have a hosted website. But I have used wamp)

Well, it works in IE. I think you have to do it for each specific page you want to view, though.

And I think it would get messy. I could be wrong but if you were to ‘redeploy’ the website back to a web server it would fail spectacularly.

No, the most ‘correct’ solution is to make sure your links work on and offline by making them all relative.

What about using $wgAllDBsAreLocalhost?

Says it makes the database go to LocalHost.

If (as I surmise from the previous link) you are using MediaWiki…

First, you need a WAMP (I am assuming a Windows laptop here) setup - there are several WAMP installers available, I would use a portable one, like The Uniform Server or similar.

Then you need to copy the html directory for MediaWiki (including all resource files) into a directory of the WAMP http server. Then you will need to dump the MediaWiki MySQL tables from your working system and load the dump onto the MySQL on your WAMP system. Ensure you set the access accounts on the WAMP MySQL server to match the accounts on the working MySQL server. I am guessing that your MySQL server is on the same host as your apache server. If not, edit your config.php (or similar) to fix this.

Once you have done this, you should be good to go - MediaWiki uses relative html and does not (seem to) need to know the local server name to generate URLs, so http://localhost/mediawiki should just work. However, it may be an idea to add your final domain to the local HOSTS file (C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS) as a redirection to localhost, so you can see the urls as they should be.

Si