Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Run from CD without copying database

Featured Replies

Hi,

 

I want to run an offline copy of a website with a large database(200+ MB) from CD/DVD. I came across uniserver while looking for a solution. I have looked at the run from CD Oily Rag, but I don't want to copy the database across since there will be no writing to it by the end user.

 

 

Will Uniserver do this? And if so, what additional changes will I need to make to enable me to do this?

 

Any help appreciated

I found your post interesting because I am currently working on a new plugin for Mona, will add this feature as a user option.

 

However the following is a solution for 3.5 note you do need to write some small temp files to c drive. To prevent copying that large database these are the changes required:

 

Assumes you are using uscd4.exe plugin

 

1] Prevent copying database:

 

Edit File: udrive\plugins\uscd2\uscd\new_Server_Start.bat

 

Delete the following lines:


:Copy complete database
XCOPY "%CD%\udrive\usr\local\mysql\data" %ustemp%\mysql\data\ /s /q
[/code]

2] Prevent update MySQL path 1

 

Edit file: udrive\plugins\uscd2\uscd\cd_mode.pl

Change this block of code:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"datadir = \"/usr/local/mysql/data/\""); # search for
push(@mpg,"datadir = \"$tpath/mysql/data/\""); # replace with
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

To:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

 

3] Prevent update MySQL path 2

 

Edit file: udrive\plugins\uscd2\uscd\us_mode.pl

Change this block of code:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"datadir = \"/usr/local/mysql/data/\""); # search for
push(@mpg,"datadir = \"$tpath/mysql/data/\""); # replace with
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

To:


#===MySQL
@mpg=(); # clear array
push(@mpg,"../../usr/local/mysql/bin/my-small.cnf"); # filepath
push(@mpg,"tmpdir = \"/tmp\""); # search for
push(@mpg,"tmpdir = \"$tpath/mysql/tmp\""); # replace with
update_files(@mpg); # search replace save file
#=== END MySQL
[/code]

That’s all you need to change!

 

All the best

Ric :)

  • 4 weeks later...

just as a thought: as mysql seems to be troublesome, you could export all mysql data and import it to a SQLite db. in that case you would not rely on the mysql server since the sqlite php extention messes with it.

as structure and commands are the same, you would only need to batch replace the mysql_* commands to sqlite_* ones in the php files.

 

downside: for every msql connection establishing, the replacement would be, for example, sqlite_open( string $filename )

 

i know, thats even more work... but could be usefull for a cd version...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.