Difference between revisions of "Script Re-Install SpeedyWiki"

From OnnoWiki
Jump to navigation Jump to search
 
Line 10: Line 10:
 
  vi /usr/local/bin/reinstall-wiki.sh
 
  vi /usr/local/bin/reinstall-wiki.sh
  
cd /usr/local/src
 
 
  rm -Rf /usr/local/src/var
 
  rm -Rf /usr/local/src/var
 
  rm -Rf /usr/local/src/wikidb*
 
  rm -Rf /usr/local/src/wikidb*
Line 17: Line 16:
 
  tar zxvf images.tar.gz
 
  tar zxvf images.tar.gz
 
  gunzip wikidb.sql.gz
 
  gunzip wikidb.sql.gz
 +
mkdir /usr/local/src/var/
 +
mkdir /usr/local/src/var/www/
 +
mkdir /usr/local/src/var/www/html/
 +
mkdir /usr/local/src/var/www/html/wiki/
 +
mkdir /usr/local/src/var/www/html/wiki/images
 +
mv /usr/local/src/data/imagewiki/* /usr/local/src/var/www/html/wiki/images/
 
  cp -Rf /usr/local/src/var/www/html/wiki/images /var/www/wiki/
 
  cp -Rf /usr/local/src/var/www/html/wiki/images /var/www/wiki/
 
  chown -Rf www-data.www-data /var/www/wiki
 
  chown -Rf www-data.www-data /var/www/wiki
  /etc/init.d/mysql restart
+
  service mysql stop
 +
service mysql start
 
  mysqladmin --user=root --password=123456 --force drop mediawiki
 
  mysqladmin --user=root --password=123456 --force drop mediawiki
 
  mysqladmin --user=root --password=123456 create mediawiki
 
  mysqladmin --user=root --password=123456 create mediawiki
 
  mysql -u mediawiki -pmediawiki mediawiki < /var/www/wiki/maintenance/tables.sql
 
  mysql -u mediawiki -pmediawiki mediawiki < /var/www/wiki/maintenance/tables.sql
 
  mysql -u mediawiki -pmediawiki mediawiki < /usr/local/src/wikidb.sql
 
  mysql -u mediawiki -pmediawiki mediawiki < /usr/local/src/wikidb.sql
  /etc/init.d/mysql restart
+
  service mysql stop
 +
service mysql start
 
  cd /var/www/wiki/maintenance
 
  cd /var/www/wiki/maintenance
 
  php update.php
 
  php update.php
  /etc/init.d/mysql restart
+
  service mysql stop
 +
service mysql start
 +
chown -Rf nobody.nogroup /var/data &
 +
chmod -Rf 777 /var/data &
 +
 
  
 
Ijinkan untuk di jalankan
 
Ijinkan untuk di jalankan

Latest revision as of 09:31, 31 July 2012

Asumsi

username root
password 123456
database mediawiki
Lokasi file images.tar.gz dan wikidb.sql.gz di /var/data/library/datawiki/

Buat Script misalnya

vi /usr/local/bin/reinstall-wiki.sh
rm -Rf /usr/local/src/var
rm -Rf /usr/local/src/wikidb*
cp -Rf /var/data/library/datawiki/* /usr/local/src
cd /usr/local/src
tar zxvf images.tar.gz
gunzip wikidb.sql.gz
mkdir /usr/local/src/var/
mkdir /usr/local/src/var/www/
mkdir /usr/local/src/var/www/html/
mkdir /usr/local/src/var/www/html/wiki/
mkdir /usr/local/src/var/www/html/wiki/images
mv /usr/local/src/data/imagewiki/* /usr/local/src/var/www/html/wiki/images/
cp -Rf /usr/local/src/var/www/html/wiki/images /var/www/wiki/
chown -Rf www-data.www-data /var/www/wiki
service mysql stop
service mysql start
mysqladmin --user=root --password=123456 --force drop mediawiki
mysqladmin --user=root --password=123456 create mediawiki
mysql -u mediawiki -pmediawiki mediawiki < /var/www/wiki/maintenance/tables.sql
mysql -u mediawiki -pmediawiki mediawiki < /usr/local/src/wikidb.sql
service mysql stop
service mysql start
cd /var/www/wiki/maintenance
php update.php
service mysql stop
service mysql start
chown -Rf nobody.nogroup /var/data &
chmod -Rf 777 /var/data &


Ijinkan untuk di jalankan

chmod -Rf 777 /usr/local/bin/reinstall-wiki.sh

Jalankan script

/usr/local/bin/reinstall-wiki.sh

Pastikan ke dua (2) halaman muka ini sama ..

http://localhost/wiki/index.php/Halaman_Utama
http://localhost/wiki/index.php/Main_Page

Referensi

Pranala Menarik