Index: trunk/phase3/maintenance/dev/install.sh |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 5 | +DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
| 6 | + |
| 7 | +$DEV/installphp.sh |
| 8 | +$DEV/installmw.sh |
| 9 | +$DEV/start.sh |
Property changes on: trunk/phase3/maintenance/dev/install.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 10 | + * |
Index: trunk/phase3/maintenance/dev/installmw.sh |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 5 | +DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
| 6 | + |
| 7 | +set -e |
| 8 | + |
| 9 | +PORT=4881 |
| 10 | + |
| 11 | +cd $DEV/../../; # $IP |
| 12 | + |
| 13 | +mkdir $DEV/data |
| 14 | +$DEV/php/bin/php maintenance/install.php --server="http://localhost:$PORT" --scriptpath="" --dbtype=sqlite --dbpath=$DEV/data --pass=admin "Trunk Test" $USER |
| 15 | +echo "" |
| 16 | +echo "Development wiki created with admin user $USER and password 'admin'." |
| 17 | +echo "" |
Property changes on: trunk/phase3/maintenance/dev/installmw.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 18 | + * |
Index: trunk/phase3/maintenance/dev/start.sh |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 5 | +DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
| 6 | + |
| 7 | +PORT=4881 |
| 8 | + |
| 9 | +echo "Starting up MediaWiki at http://localhost:$PORT/" |
| 10 | +echo "" |
| 11 | + |
| 12 | +cd $DEV/../../; # $IP |
| 13 | +$DEV/php/bin/php -S localhost:$PORT |
Property changes on: trunk/phase3/maintenance/dev/start.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 14 | + * |
Index: trunk/phase3/maintenance/dev/installphp.sh |
— | — | @@ -0,0 +1,41 @@ |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +if [[ "x$BASH_SOURCE" == "x" ]]; then echo '$BASH_SOURCE not set'; exit 1; fi |
| 5 | +DEV=$(cd -P "$(dirname "${BASH_SOURCE[0]}" )" && pwd) |
| 6 | + |
| 7 | +set -e # DO NOT USE PIPES unless this is rewritten |
| 8 | + |
| 9 | +if [ -d $DEV/php ]; then |
| 10 | + echo "PHP is already installed" |
| 11 | + exit 1 |
| 12 | +fi |
| 13 | + |
| 14 | +TAR=php5.4-latest.tar.gz |
| 15 | +PHPURL=http://snaps.php.net/$TAR |
| 16 | + |
| 17 | +cd $DEV |
| 18 | + |
| 19 | +# Some debain-like systems bundle wget but not curl, some other systems |
| 20 | +# like os x bundle curl but not wget... use whatever is available |
| 21 | +echo -n "Downloading PHP 5.4" |
| 22 | +if command -v wget &>/dev/null; then |
| 23 | + echo "- using wget" |
| 24 | + wget $PHPURL |
| 25 | +elif command -v curl &>/dev/null; then |
| 26 | + echo "- using curl" |
| 27 | + curl -O $PHPURL |
| 28 | +else |
| 29 | + echo "- aborting" |
| 30 | + echo "Could not find curl or wget." >&2; |
| 31 | + exit 1; |
| 32 | +fi |
| 33 | + |
| 34 | +echo "Extracting php 5.4" |
| 35 | +tar -xzf $TAR |
| 36 | + |
| 37 | +cd php5.4-*/ |
| 38 | + |
| 39 | +echo "Configuring and installing php 5.4 in $IP/maintenance/dev/php/" |
| 40 | +./configure --prefix=$DEV/php/ |
| 41 | +make |
| 42 | +make install |
Property changes on: trunk/phase3/maintenance/dev/installphp.sh |
___________________________________________________________________ |
Added: svn:executable |
1 | 43 | + * |
Index: trunk/phase3/maintenance/dev/README |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +maintenance/dev/ scripts can help quickly setup a local MediaWiki for development purposes. |
| 3 | + |
| 4 | +Wikis setup in this way are NOT meant to be publicly available. They use a development database not acceptible for use in production and place a sqlite database in an unsafe location a real wiki should never place it in. |
| 5 | + |
| 6 | +Running maintenance/dev/install.sh will download and install a local copy of php 5.4, install a sqlite powered instance of MW for development, and then start up a local webserver to view the wiki. |
| 7 | + |
| 8 | +After installation you can bring the webserver back up at any time you want with maintenance/dev/start.sh |