Wampserver on a USB drive
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: January 02, 2018 08:30AM

My main application is the genealogy program TNG. Historically as a backup, I have used MoWeSII installed both on my PC and on a USB flash drive to provide me with a localhost environment. When MoWeSII was discontinued the same function was taken over by USBWebserver on both my PC and on the USB drive.

Is it possible to do the same with Wamp? A couple of months ago to that I copied the whole of my Wamp64 directory - including the installed TNG to a USB drive (Ksmiling smiley as a backup but have not done anything with it. This is version 3.0.6 with PHP set to 5.6

My PC version of Wamp is now 3.1 with PHP set to 7.1.12. I have now changed the line in wampmanager.conf on the K drive installation to read: installDir ="k:/wamp64"

When activating Wamp from the K drive and clicking on the green icon I can see that it is still the old version of 3.0.6 However, how do I now set it to read the copy of my site from the directory on the K: drive. Currently it defaults to localhost on the c:/ drive.

Many thanks Alan

Options: ReplyQuote
Re: Wampserver on a USB drive
Posted by: Otomatic (Moderator)
Date: January 02, 2018 03:30PM

Hi,

Wampserver is not a basic portable application.
Running Wamp64 after copying to a USB K: does not require only one modification.
- Changing installDir in wampmanager.conf only affects internal Wampserver scripts.

It must also be replaced as supposed the original install is c:\wamp64
- Define INSTALL_DIR K:/wamp64 in K:\wamp64\bin\apache\apache2.4.29\conf\httpd.conf

- Replace all c:/wamp64 by k:/wamp64 in files :
-- K:\wamp64\bin\apache\apache2.4.29\conf\extra\httpd-vhosts.conf
-- All php.ini and phpForApache.ini files for all php versions
-- All my.ini files for all mysql and mariadb versions
-- in all wamp64/alias/xxxx.conf files
-- in wampmanager.ini file

AND, before lauching k:\wamp64\wampmanager.exe "as an administrator" we must delete old services with opening a command windows and type :
sc delete wampapache64
sc delete wampmysqld64
sc delete wampmariadb64

Now we can launch k:\wamp64\wampmanager.exe "as an administrator", the tray icon will be red.
We have to create new services by Left-Click and
- Apache -> Service -> Install service
- MySQL -> Service -> Install Service
- MariaDB -> Service -> Install Service
- Start all services

It works, I did it exactly like this, on a K:\wamp64 USB stick after copying my original j:\wamp64 folder.

Important : The USB stick must be NTFS formatted and always take the letter K: at each connection.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 01/02/2018 03:44PM by Otomatic.

Options: ReplyQuote
Re: Wampserver on a USB drive
Posted by: Newfloridian (---.16-2.cable.virginm.net)
Date: January 03, 2018 10:58AM

Thank you, I will test that out.

Two points of clarification:
If I have everything mounted on a K: drive (Wampserver and my offline copy of TNG), does that mean I cannot run it from that drive when plugged into a computer that also has Wampserver on the C: drive - even if it is dormant and not loaded?

The main reason for using TNG on a USB drive using a "mobile" localhost (MoWeSII or USBWebserver) is that it can be made drive independent AND run on any USB enabled computer that doesn't have acccess to the internet.

The line which is placed in the (TNG) config file reads:

$rootpath = getenv("DOCUMENT_ROOT"winking smiley."/";

Can something like mthat work in Wampserver?

Many thanks

Alan

btw: there is a large population of TNG users out there worldwide who would delight in a simple way of achieving this!

Options: ReplyQuote
Re: Wampserver on a USB drive
Posted by: Otomatic (Moderator)
Date: January 03, 2018 12:08PM

Hi,

> also has Wampserver on the C: drive - even if it is dormant and not loaded?
You have to delete services and create new ones from USB stick as explained before.(*)

> $rootpath = getenv("DOCUMENT_ROOT"winking smiley
$_SERVER['DOCUMENT_ROOT'] is the value of DocumentRoot in the VirtualHost. See The need for Virtual Host
So, use VirtualHost on K: for TNG

(*)For a future version of Wampserver (3.1.2) I will probably create an additional integrated tool:"Reinstall all services".

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 2 time(s). Last edit at 01/03/2018 01:30PM by Otomatic.

Options: ReplyQuote
Re: Wampserver on a USB drive
Posted by: artedigital (---.sabanet.ir)
Date: January 10, 2018 03:18PM

thanks for share this post
very very good

Options: ReplyQuote


Sorry, only registered users may post in this forum.