B870 - instalace SQLtutor: Porovnání verzí

Z GeoWikiCZ
Skočit na navigaci Skočit na vyhledávání
m
Řádek 3: Řádek 3:
 
== Založení databáze ==
 
== Založení databáze ==
  
su - postgres
+
Pod uživatelem rootspustíme skript
  
spustíme
+
./instalace-sqltutor-b870.sh
  
su -l postgres < instalace-sqltutor-b870.sh
+
<pre>
 +
#!/bin/bash
 +
#
 +
#  apt-get -y install apache
 +
#  apt-get -y install libpqxx-2.6.8 libpqxx-dev
  
viz skript instalace-sqltutor-b870.sh
+
cat > tmp.b870-sqltutor <<EOF
 +
dropdb sqlquiz
 +
dropuser wwwquiz
 +
 
 +
createdb sqlquiz
 +
createuser -D -R -S wwwquiz
 +
psql -c "ALTER USER wwwquiz WITH PASSWORD 'xxxxxx';"
 +
psql -c "CREATE LANGUAGE plpgsql;"
 +
EOF
 +
 
 +
su -l postgres < tmp.b870-sqltutor
 +
rm -f tmp.b870-sqltutor
 +
 
 +
 
 +
chmod go= /home/pytel
 +
chmod go= /home/cepek
 +
 
 +
rm -rf /home/cepek/install-sqltutor
 +
mkdir  /home/cepek/install-sqltutor
 +
(cd /home/cepek/install-sqltutor && cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/sqltutor co sqltutor && cd sqltutor/sqltutor && ./configure && make )
 +
 
 +
cat > /home/cepek/install-sqltutor/install-sqltutor.sh <<EOF
 +
#!/bin/bash
 +
#
 +
DBNAME=sqlquiz
 +
DBUSER=wwwquiz
 +
PASSWD=xxxxxx
 +
 
 +
 
 +
# rm -rf sqltutor
 +
# cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/sqltutor co sqltutor
 +
 
 +
cd sqltutor/sqltutor
 +
 
 +
rm -f settings.cpp
 +
cvs update -dPA
 +
 
 +
sed -i /^T\ SQLtutor::db_connection/s/sqlquiz/\$DBNAME/ settings.cpp
 +
sed -i /^T\ SQLtutor::db_connection/s/wwwquiz/\$DBUSER/ settings.cpp
 +
sed -i /^T\ SQLtutor::db_connection/s/krok/\$PASSWD/    settings.cpp
 +
 
 +
make && cp -v sqltutor /usr/lib/cgi-bin/sqltutor
 +
EOF
 +
 
 +
chown -R cepek:cepek /home/cepek/install-sqltutor
 +
 
 +
rm -rf /usr/lib/cgi-bin/sqltutor
 +
mkdir  /usr/lib/cgi-bin/sqltutor
 +
chown -R cepek:cepek /usr/lib/cgi-bin/sqltutor
 +
 
 +
cp -av /home/cepek/install-sqltutor/sqltutor/sqltutor/sqltutor /usr/lib/cgi-bin/sqltutor
  
<pre>
 
 
</pre>
 
</pre>

Verze z 15. 5. 2008, 17:05

Obecné poznámky viz SQLtutor - instalace.

Založení databáze

Pod uživatelem rootspustíme skript

./instalace-sqltutor-b870.sh

#!/bin/bash
#
#   apt-get -y install apache
#   apt-get -y install libpqxx-2.6.8 libpqxx-dev

cat > tmp.b870-sqltutor <<EOF
dropdb sqlquiz
dropuser wwwquiz

createdb sqlquiz
createuser -D -R -S wwwquiz
psql -c "ALTER USER wwwquiz WITH PASSWORD 'xxxxxx';"
psql -c "CREATE LANGUAGE plpgsql;"
EOF

su -l postgres < tmp.b870-sqltutor
rm -f tmp.b870-sqltutor


chmod go= /home/pytel
chmod go= /home/cepek

rm -rf /home/cepek/install-sqltutor
mkdir  /home/cepek/install-sqltutor
(cd /home/cepek/install-sqltutor && cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/sqltutor co sqltutor && cd sqltutor/sqltutor && ./configure && make )

cat > /home/cepek/install-sqltutor/install-sqltutor.sh <<EOF
#!/bin/bash
#
DBNAME=sqlquiz
DBUSER=wwwquiz
PASSWD=xxxxxx


# rm -rf sqltutor
# cvs -d:pserver:anonymous@cvs.sv.gnu.org:/sources/sqltutor co sqltutor

cd sqltutor/sqltutor

rm -f settings.cpp
cvs update -dPA

sed -i /^T\ SQLtutor::db_connection/s/sqlquiz/\$DBNAME/ settings.cpp
sed -i /^T\ SQLtutor::db_connection/s/wwwquiz/\$DBUSER/ settings.cpp
sed -i /^T\ SQLtutor::db_connection/s/krok/\$PASSWD/    settings.cpp

make && cp -v sqltutor /usr/lib/cgi-bin/sqltutor
EOF

chown -R cepek:cepek /home/cepek/install-sqltutor

rm -rf /usr/lib/cgi-bin/sqltutor
mkdir  /usr/lib/cgi-bin/sqltutor
chown -R cepek:cepek /usr/lib/cgi-bin/sqltutor

cp -av /home/cepek/install-sqltutor/sqltutor/sqltutor/sqltutor /usr/lib/cgi-bin/sqltutor