blob: 50fffbe113e0994df93f810247f8ff39a02876a5 (
plain)
- #!/bin/bash
- #
- # /usr/local/sbin/localmoffycreate
- # Copyright 2001 Jonas Smedegaard <dr@jones.dk>
- #
- # $Id: localmoffycreate,v 1.2 2002-03-07 16:22:51 jonas Exp $
- #
- # Create local Moffy website
- #
- set -e
- user="moffy"
- passwd="oscerciv"
- db="moffy"
- mysqladmin -uroot -p create $db
- echo "GRANT ALL ON $db.* TO '$user@localhost' IDENTIFIED BY '$passwd' WITH GRANT OPTION;" | mysql -uroot -p
- #mysql -u$user -p$passwd $db < $basedir/sql/publish.sql
- dbstring="INSERT INTO eZUser_User VALUES (1,'$user',password('$passwd'),'$user@$domain','admin','user','false','',0,0);"
- cat $basedir/sql/publish.sql | sed "s/^INSERT INTO eZUser_User VALUES.*\$/$dbstring/" | mysql -u$user -p$passwd $db
- su $user -c "zcat $basedir/data.tar.gz | tar -xv -C $basedir"
- mysql -u$user -p$passwd $db < $basedir/sql/data.sql
- #su $user -c "cd $basedir && ./modfix.sh"
- #su $user -c "cd $basedir && ./secure_clearcache.sh"
- #su $user -c "echo \"
- #RewriteEngine On
- #RewriteRule ^/stats/store/(.*).gif\\\$ $basedir/ezstats/user/storestats.php [S=2]
- #RewriteRule ^/filemanager/filedownload/([^/]+)/(.*)\\\$ $basedir/ezfilemanager/files/\\\$1 [T=\\\"application/oct-stream\\\",S=1]
- #RewriteRule \!\.(gif|css|jpg|png)\\\$ $basedir/index.php
- #\" > $basedir/.htaccess"
- #su $user -c "echo \"
- #RewriteEngine On
- #RewriteRule \!\.(gif|css|jpg|png)\\\$ $basedir/index_admin.php
- #\" > $adminbasedir/.htaccess"
- su $user -c "
- cd $basedir
- ./modfix.sh
- ./secure_modfix.sh $user $group
- ./clearcache.sh
- ./secure_clearcache.sh
- cat site.ini | sed 's/^SiteURL=publish.ez.no\$/SiteURL=$host/' > site.ini.tmp && mv site.ini.tmp site.ini
- cat site.ini | sed 's/^Database=publish\$/Database=$db/' > site.ini.tmp && mv site.ini.tmp site.ini
- cat site.ini | sed 's/^User=publish\$/User=$user/' > site.ini.tmp && mv site.ini.tmp site.ini
- cat site.ini | sed 's/^Password=publish\$/Password=$passwd/' > site.ini.tmp && mv site.ini.tmp site.ini
- cat site.ini | sed 's/^Database=publish\$/Database=$db/' > site.ini.tmp && mv site.ini.tmp site.ini
- "
- echo "
- <VirtualHost *>
- ServerName $host
- ServerAdmin $user@$domain
- DocumentRoot $basedir
- user $user
- group $group
- php_flag magic_quotes_gpc off
- RewriteEngine On
- RewriteRule ^/stats/store/(.*).gif\$ $basedir/ezstats/user/storestats.php [S=2]
- RewriteRule ^/filemanager/filedownload/([^/]+)/(.*)\$ $basedir/ezfilemanager/files/\$1 [T="application/oct-stream",S=1]
- RewriteRule !\.(gif|css|jpg|png)\$ $basedir/index.php
- </VirtualHost>
- <VirtualHost *>
- ServerName $adminhost
- ServerAdmin $user@$domain
- DocumentRoot $basedir
- user $user
- group $group
- php_flag magic_quotes_gpc off
- RewriteEngine On
- RewriteRule !\.(gif|css|jpg|png)\$ $basedir/index_admin.php
- </VirtualHost>
- " > $webcfg
- echo "Remember to reload Apache..."
|