Last updated August 29, 2012. Created by dman on September 3, 2008.
Edited by swiftarrow, emmajane, BioALIEN, lejon. Log in to edit this page.
The Scenario
Server2Go is a portable WAMP stack (Windows-Apache-MySQL-PHP) that runs out of the box without any installation, and can even run on write protected media (like a CD). This means that you can use Server2Go to develop your Drupal site locally (or copy over a Drupal site you have already made) and then burn it to a CD. The CD version will be fully searchable and will run all Drupal's php magic!
You can also put the files on a USB pendrive, and carry your full blown Drupal server in your pocket!
How it Works
The clever part is that Server2Go copies all the databases to a temp folder once the CD is launched. This means your Drupal site will behave as if it is live so it can be searched, edited, etc. However, although you can also add content to the site when it is launched from the CD this will obviously not be recorded to the CD as the CD is read only! The next time you launch the CD you'll be back with your original burnt site.
On the other hand, you can configure it to run more "normally" (i.e. not mirroring the databases) on a USB pendrive.
The Tutorial
This tutorial is quite long, but the result is worth it in the end.
Get Server2Go
- Download a Server2Go package. (NOTE: this tutorial has been confirmed to work with the mini package [Apache 2.0.61], and with the latest version [Apache 2.2.15].
- Unzip it where you want it - to a temporary development folder if you're planning to burn to a CD, or to a USB Stick / pendrive. The folder will be called 'server2go'. In this tutorial we will rename the folder 'Drupal_S2G' to make file addresses easier to write out.
- Check that Server2Go is working by double clicking the Server2Go.exe file. You should get the splash screen saying "congratulations...." opening up in Internet Explorer.
Configure Server2Go for Development
Change the following settings in the pms_config.ini file in (Drupal_S2G) the main folder (use a program like Notepad++ to change it):
- [line 21] StartLocal=1 (this is for using when you want to develop the website and have to write files. If you want to use server2go to run off a read-only CD at a later point, you will have to change it back to =0)
- [line 61] BrowserSize=MAXIMIZE (This only works for Internet Explorer.)
- [line 69] LocalMirror=0 (this is so that the things you do to build your site are saved rather than carried out in a temporary folder)
Make a note of these values: 'HostName=127.0.0.1' [line 33] and this 'MySQLPort=7188' [line 80], as we will need them later.
Create a Drupal-Friendly Environment
- Make the following changes in (Drupal_S2G > server > config_tpl > php.ini) to make sure Apache has the right settings to run Drupal, and can provide clean-urls:
- [line 201] max_execution_time = 60 (instead of 30)
- [line 202] memory_limit = 64M (or larger)
- [lines 488-493] Put a semi-colon in front of "extension=php_sqlite.dll" and "extension=php_pdo_sqlite.dll". This prevents SQLite from loading.
- [lines 488-493] Remove the semi-colon in front of these lines: "extension=php_mysql_libmysql.dll", "extension=php_mysqli_libmysql.dll", "extension=php_pdo_mysql.dll". This enables MySQL and makes it available to Drupal.
- Change the following setting in (Drupal_S2G > server > config_tpl > httpd.conf)
- [line 164] Remove the '#' so it reads LoadModule rewrite_module modules/mod_rewrite.so
Prepare Drupal's Files
- Download Drupal and unzip it into the htdocs folder. You can unzip it so that it sits in a folder inside the htdocs folder. This means you'll have a folder inside htdocs called 'drupal-7.14' or something similar.
NOTE: YOU CAN IMPORT A SITE YOU HAVE ALREADY DEVELOPED. SEARCH THE DRUPAL HANDBOOK FOR ADVICE ON IMPORTING A DRUPAL SITE TO A LOCAL INSTALLATION.
You can rename it to anything you want, but in this case we'll call it 'drupal' so all Drupal's files will sit in (Drupal_S2G > htdocs > drupal ).
- Do the things the Drupal set up will tell you to do which are:
- Create a folder called 'files' in the main drupal folder i.e.(Drupal_S2G > htdocs > drupal > files)
- Create a 'modules' folder and a 'themes' folder in the default folder, this is where you will place your add-on modules and themes i.e. (Drupal_S2G > htdocs > drupal > sites > all
> modules) and (Drupal_S2G > htdocs > drupal > sites > all > themes) - Copy the default settings file and rename it settings i.e. copy (Drupal_S2G > htdocs > drupal > sites > default > default.settings.php) and paste it in the same folder,
re-naming it to settings.php
For Drupal 6.X
Create a Database for Drupal
- Start server2go.exe in the 'Drupal_S2G' folder. It should open up the Server2Go start-page in a new browser
- Go to the phpmyadmin link under 'Tools' on the right-hand side.
- Click on priveleges
- Click on 'Add user'
- Under username put 'drupal_db' (or whatever you want to call your user); set 'host' as 'localhost' and set your own password (write it down!)
- Under database for user, choose 'Create a Database of the same name and grant all privileges'
- Click on the picture of a house to go to the phpmyadmin home page. Then select 'databases' and click on 'drupal_db'.
- Click on the 'privileges' tab at the top of the page and check that 'drupal_db' is one of the users listed as having access to the database. All done!
NOTE: READ OTHER DRUPAL HANDBOOK INFORMATION ABOUT SECURITY AND CREATING DATABASES. THIS IS A QUICK METHOD AND NOT NECESSARILY VERY SECURE...
Install Drupal
- Now we're going to set up Drupal. Go to http://127.0.0.1:4001/drupal/ (or
http://127.0.0.1:4001/whatever-you-called-the-folder-you-unzipped-drupal...) and you should see the Drupal set-up page. - After you've selected which language you are installing Drupal in, you will be asked to fill in the database details. In our case the database name is 'drupal_db'; the database username is 'drupal_db'; and the password is whatever password you chose.
- Click on the 'Advanced options'. In 'Database host' put: 127.0.0.1 and in 'Database port' put 7188, the settings we noted earlier.
- Save and continue.
- Follow all the rest of the stuff as in the Drupal Handbook.
- As you're installing on a local site, you might get this message:
warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
It's harmless. If it really worries you, try this: http://drupal.org/project/smtp
- To check everything works, add some test content to your site and then close the browser. Restart Server2Go.exe once the server has shut down. If your content is there, bingo! It works!
OPTIONAL: Bundle in Firefox Portable
You can skip this step if you can assume that anyone launching your site will be happy using Internet Explorer. However, you can include Portable Firefox as the browser. To do this:
- Download the latest version of Portable Firefox (tested working with Firefox 2 and 3).
- Install Portable Firefox in the 'Drupal_S2G' folder (click on 'Browse' to locate the folder on your computer).
- Launch Portable Firefox by clicking on FirefoxPortable.exe in (Drupal_S2G > FirefoxPortable). You can choose to disable session store. You can choose a blank page as the firefox home page in 'Options' and hide the Bookmarks Toolbar so you have a cleaner looking browser window when it launches. Close Portable Firefox. Opening and closing the application is important!
- Go to (Drupal_S2G > FirefoxPortable > App > firefox) and rename firefox.exe to ffp.exe IMPORTANT: Leave the FirefoxPortable.exe in (Drupal_S2G > FirefoxPortable) unchanged!
- Create a file FirefoxPortable.ini in (Drupal_S2G > FirefoxPortable). You can use a program like Notepad++ to do this.
- Paste the following in the file:
[FirefoxPortable]
FirefoxDirectory=App\firefox
ProfileDirectory=Data\profile
SettingsDirectory=Data\settings
PluginsDirectory=Data\plugins
FirefoxExecutable=ffp.EXE
AdditionalParameters=
LocalHomepage=
WaitForFirefox=true
DisableSplashScreen=true
AllowMultipleInstances=true
DisableIntelligentStart=false
SkipChromeFix=false
SkipCompregFix=false
RunLocally=falseNOTE: THESE SETTINGS ARE FOR SITE DEVELOPMENT. THEY WILL NEED TO BE CHANGED WHEN BURNING THE SITE TO CD (see instructions below).
- Open the pms_config.ini in (Drupal_S2G) and change the following:
[line 52] BrowserType=PORTABLEFIREFOX
[line 56] BrowserPath=FirefoxPortable/FirefoxPortable.EXE - Check it works by launching the Server2Go.exe
Moving from Development to a CD
If you want to run some tests without wasting loads of CDs you can create an ISO of your files (you should be burning all the files INSIDE 'Drupal_S2G' and not just copying the 'Drupal_S2G' folder itself onto CD, otherwise the autorun will not work) by using software such as PowerISO (the free version will create ISOs up to 300MB in size, which should be enough for testing).
There are lots of nice settings to change, including the splash screen (Drupal_S2G > splash.png) which you could replace with any graphic you like and you can even change the name of the server i.e. replace 'Server2Go' with 'My Drupal Site on CD'. See the Server2Go website for more info. The following settings MUST be changed to make your site work on CD:
- In the pms_config.ini file in the (Drupal_S2G) folder:
- [line 21] StartLocal=0
- [line 39] DefaultFile=drupal/ (or whatever the folder is called where you have your drupal files. Don't forget the trailing slash)
- [line 69] LocalMirror=1
- In the pms_config.ini file in the (Drupal_S2G) folder.
- [line 14] KeepRunningAfterBrowserClose=1
- [line 17] ShowTrayIcon=1 (you need this to be able to shut down the server once you've finished with the CD).
- In the FirefoxPortable.ini in (Drupal_S2G > FirefoxPortable ):
- AllowMultipleInstances=false
- RunLocally=true
If you are using Firefox portable, you will also have to change the following. Annoyingly, you can't be running firefox already when you start the CD and closing the browser will not shut down the server, this has to be done from the tray icon instead.
Comments welcome on this as the method has only been tested briefly.
Comments
great and ... great!
This tutorial was so clear, I went right ahead and tried it out with a few modifications to clone an existing site without even testing the dry-run way first. And it worked!
Some of my experience:
Steps 1-6 were perfect. I also later had to go back and change the php.ini
post_max_size = 64Mand
upload_max_filesize = 64Mbecause my test site was a bit huge.
I skipped 7 and 8 and instead copied across an existing site folder.
I placed my drupal directly in /htdocs/ instead of a subdir. That overwrites the s2g welcome screen, but phpmyadmin is still available under http://127.0.0.1:4001/phpmyadmin/
But my site is the clean http://127.0.0.1:4001/ so that was a winner.
Here's where I found a problem - my import database was too big and messy. phpmyadmin refused the big files (so I upped the limit) then timed out. The performance of this system doesn't seem to hot, even on a damn grunty desktop.
In order to roll out a clean distribution, I decided to clean out the clutter, so on my original (or rather, working backup) database I ran
truncate cache ;truncate cache_contentr ;
truncate cache_filter ;
truncate cache_menu ;
truncate cache_page ;
truncate cache_views ;
truncate accesslog ;
truncate watchdog ;
then re-exported the DB and tried to import again. I use MySQL GUI Tools by choice, so it was just a 'backup database' procedure.
Third time lucky I got a happy result.
I modifed the settings.php by hand to reflect the local db. Interestingly, the 'Database port' = 7188 didn't actually need to be set because both the client (PHP) has its default set correctly thanks to some magic in php.ini from s2g.
mysql.default_port = %CDPMS:MYSQLPRT%so that's optional.
At that point, things were just working for me (bar some unique issues, like a leech-blocker in my .htaccess hiding my images)
Server2Go does not run a visible application, so I was unsure how to shut it down/restart it, but found that just closing the portableFirefox session caused it to close down. Good behaviour. The ShowTrayIcon tweak fixes that.
The rest of the pms_config.ini is also really readable - and useful options. I guess we can set the http port back to 80 to be really clean, but I'd prefer to avoid conflicts.
From observing the performance, I figured it had been a bit mean to kill the cache like that, so I ran a lightweight link spider -Xenu over the site to refresh all those pages. That was also a good test procedure to see that things WERE working as needed!
Looks like the s2g process isn't taking advantage of a quad core (no surprise there) but both apache and mysql are in the same box, and only able to use 25% of the resources between them. Shame.
hint:
An even quicker way of previewing autorun CD 'images' is to share that directory, then mount it yourself from your own network. This makes the system think it's a drive that's just been attached. Setting it to read-only when sharing allows you to test that read-only works, while you can still actually make changes to the real files (like adding the logo.ico). Autorun may still be available on right-click. You can also test from a totally different machine. This may not work for everyone, so YMMV.
.. I'm yet to commit a burn, as it's so much fun tweaking :-). Thanks for this!
.dan.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
I imported a live site , but
I imported a live site , but every link whether on the back end or elsewhere takes me to the front page . Can't figure out where it went wrong
If you want your drupal site
If you want your drupal site to be the start page try:
# In the pms_config.ini file in the (Drupal_S2G) folder:
[line 39] DefaultFile=drupal/ (or whatever the folder is called where you have your drupal files. Don't forget the trailing slash)
Otherwise I can only suggest going through the instrucitons step by step again. Hope it works out!
That is what I have and my
That is what I have and my drupal site displays . The only problem is that I can't get beyond the front page. every link takes me back to front page.
server2go
Hello, unfortunately I have no luck with a Server2Go installation. I have a database with the name "created drupal". The user I have just as they are left in place. I have the setup of drupal as a database "drupal" as user "root" and port "7188" entered. The setup runs through it. when re-start of Server2Go the database but not any more. it's gone! what can be wrong? Many thanks for an answer.
matthis
User left solution Server2go Drupal
You can easily change user. First you must assign a password to root for each address in your phpmyadmin (production,127.0.0.1,localhost).
http://127.0.0.1:4001/
It works perfectly!
With Ultra Iso by one click in your folder Add to Iso File
Then test an emulator eg Deamon Tools.
The project is not maintained further. An instance is still active at the close of the launcher although properly configured in pms_config.
twitter.com/stephanearrami
Great! Thanks!
Thanks a lot for the fantastic tutorial!
I had messed up my installation by trying to change MySQL passwords! I had to cleanup & have fresh copy of S2G to work.
If someone wishes to change MySQL passwords, here is the help page from authors - http://www.server2go-web.de/wiki/securemysql
I also tried it on a Pen Drive (copied all the files within Drupal_S2G folder to root of the Pen Drive) & tried auto run, worked fine!
Thanks again.
Prasad
www.marathiwebsites.com
Prasad
designs2drupal.com
Server2GO works slow
Hi, I'm using the Server2GO, but sometimes my sites works so slow. Anyone know why?.
The package: PHP 5.2.8, SQLite, MySQL 5.0.41 for Apache 2.2.11, Drupal 6.12
and Internet Explorer.
Thank you.
Problems running from cd on some computers
Has anyone done this and had problems running on some computers? I think I've narrowed the problem down to the way it interacts with a cd drive. On a particular computer, it will hang when run from the cd, but if all the files from the cd are copied to a local disk, it runs fine. This exact same CD will work in several other computers.
I have an enhanced process viewer that indicates Sever2Go is hangs while repeatedly generating an "invalid device request" this immediately follows an attempt to write to the cd-rom drive.
best to contact server2go
You'll get better support from the server2go people I think
http://www.server2go-web.de/forumng
If you get a positive result, post it here! Good luck!
Problem while creating database
I am trying to setup server2go to make a portable pdf viewer application to run through a cd. While following the steps exactly as they are listed, i am stuck at the database creation just after copying drupal files. i successfully created the admin user will all the privileges and after that i can successfully create a database, but after that when i check privileges under that database to check the existence of my admin user, i get the following error..
Error
SQL query: DocumentationEdit
(SELECT `User`, `Host`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `Index_priv`, `Alter_priv`, `References_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Execute_priv`, `Event_priv`, `Trigger_priv`, `Db` FROM `mysql`.`db` WHERE 'nsc' LIKE `Db` AND NOT (`Select_priv` = 'N' AND `Insert_priv` = 'N' AND `Update_priv` = 'N' AND `Delete_priv` = 'N' AND `Create_priv` = 'N' AND `Drop_priv` = 'N' AND `Grant_priv` = 'N' AND `References_priv` = 'N' AND `Create_tmp_table_priv` = 'N' AND `Lock_tables_priv` = 'N' AND `Create_view_priv` = 'N' AND `Show_view_priv` = 'N' AND `Create_routine_priv` = 'N' AND `Alter_routine_priv` = 'N' AND `Execute_priv` = 'N' AND `Event_priv` = 'N' AND `Trigger_priv` = 'N')) UNION (SELECT `User`, `Host`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `Index_priv`, `Alter_[...]
MySQL said: Documentation
#1054 - Unknown column 'Event_priv' in 'field list'
i even tried to move on to next step where i install drupal ; obviously it failed. Please help me out with this as i just cant fix this even after trying everything...
Also, what i am trying to do is to create an autorun cd which will firstly show some flash intro and then show some introductory pages and then a listing of various pdf files to be provided with the cd with the facility of searching and sorting. I found this server2go tempting as this will allow me to create a complete portable app without requiring the user to install flash plugins and adobe viewers as they can be integrated with firefox portable. Anymore suggestions with this ??
www.udyamo.com
Mini version
One reason why the latest non-mini version did not work could be that for some reason the default httpd.conf specifies "AllowOverride=None" for the entire htdocs directory, rendering Drupal's .htaccess file useless. Setting this to "all" made it work fine for me.
just a few notes...
I have had to work on a few projects getting an environment to work on CD or otherwise. Server2Go is a nice clean version of a self-contained environment. Having a "portable" or "mobile" version of Drupal or other projects on CD or USB has many values.
It can get a little tricky with some configurations but for the most part, compared to other options, Server2Go is pretty friendly.
Thanks for posting this great instructional footprint.
As a note: People should know up front that so far a MAC version is not fully working, to the best of my knowledge.
I think a MAC Leopard version is being worked on (I hope) and I, myself, have yet to get a MAC version operational.
As stated, you might want to look into setting your AllowOveride=All
Also, most people or some people are/or might want to get the Mod_Rewrite functionality working in Apache by simply going to /server/(thats whats nice everything is self-contained)/Apache/conf/http.conf
and, of course, comment out ; to install the required modules [mod_rewrite.so] or other modules you might need
You also might want to make a few alterations to your php.ini file located at server2go\server\config_tpl\
An error appears...
I followed the instructions and when I burn the CD the next errors appear in the browser.
Warning: require_once(./includes/bootstrap.inc) [function.require-once]: failed to open stream: No such file or directory in E:\htdocs\drupal\index.php on line 14
Fatal error: require_once() [function.require]: Failed opening required './includes/bootstrap.inc' (include_path='.;E:\server\php\PEAR') in E:\htdocs\drupal\index.php on line 14
Could somebody help me?
Thanks
update the cd contents from a live site?
hello
i want to use this feature of drupal with server to go.. but i wanted to have the ability to syncronize content from the live site to the user media .. even this might be cd or usb..
any help would be much appretiated..
I am trying to setup
I am trying to setup server2go to make a portable application to run through a cd. While following the steps exactly as they are listed, i am stuck at the database creation just after copying drupal files. i successfully created the admin user will all the privileges and after that i can successfully create a database, but after that when i check privileges under that database to check the existence of my admin user, i get the following error..
Error
SQL query: DocumentationEdit
(SELECT `User`, `Host`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `Index_priv`, `Alter_priv`, `References_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Execute_priv`, `Event_priv`, `Trigger_priv`, `Db` FROM `mysql`.`db` WHERE 'nsc' LIKE `Db` AND NOT (`Select_priv` = 'N' AND `Insert_priv` = 'N' AND `Update_priv` = 'N' AND `Delete_priv` = 'N' AND `Create_priv` = 'N' AND `Drop_priv` = 'N' AND `Grant_priv` = 'N' AND `References_priv` = 'N' AND `Create_tmp_table_priv` = 'N' AND `Lock_tables_priv` = 'N' AND `Create_view_priv` = 'N' AND `Show_view_priv` = 'N' AND `Create_routine_priv` = 'N' AND `Alter_routine_priv` = 'N' AND `Execute_priv` = 'N' AND `Event_priv` = 'N' AND `Trigger_priv` = 'N')) UNION (SELECT `User`, `Host`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `Index_priv`, `Alter_[...]
MySQL said: Documentation
#1054 - Unknown column 'Event_priv' in 'field list'
i even tried to move on to next step where i install drupal ; obviously it failed. Please help me out with this as i just cant fix this even after trying everything...
I found this server2go tempting as this will allow me to create a complete portable app without requiring the user to install flash plugins and adobe viewers as they can be integrated with firefox portable. please help me by giving your valuable suggestions ??