Seks megasvære skridt
1. Opret views i Oracle databasen
Oprettes i DDETerm med SQL-Plus. Se beskrivelse her.
Hent script til oprettelse af views her. (Oracle.scripts.MDH-Views.rar)
2. Opret MySQL database + tabeller
Installér Oracle Instant Client
For at få linux-serveren til at snakke sammen med Oracle, skal der installeres Oracle Instant Client. Oracle Instant Client kan hentes her.
Opret en ny MySQL database med PHP og dansk tegnsæt
CREATE DATABASE $db CHARACTER SET latin1 COLLATE latin1_danish_ci
--- php start ---
$host = "localhost";
$user = "brugernavn";
$passwd = "kodeord";
$db = "databasenavn";
$con = mysql_connect($host,$user,$passwd);
if (!$con) die('Could not connect: ' . mysql_error());
if (mysql_query("CREATE DATABASE $db CHARACTER SET latin1 COLLATE latin1_danish_ci",$con))
echo "Database '$db' created";
else
echo "Error creating database '$db': " . mysql_error();
mysql_close($con);
--- php slut ---
Se beskrivelse af metoden her.
Hent SQL fil her og importer den til din database
Vi har lavet et dump af vores tabeller uden data. Du kan hente SQL filen her. Importer den til din database, så er tabellerne oprettet.
3. Download, udpak og FTP
- Hent hele pakken her (mdh_v_0_1.rar – 149 mb)
- Pak ud
- FTP til din linux server
4. Tilret filerne med lokale oplysninger
A) Indtast Oracle database brugernavn, kodeord og adresse i flg. fil:
/cronjobs/sql_functions.php - linie 52-54
B) Indtast MySQL database brugernavn, kodeord, adresse og navn i flg. filer:
/cronjobs/4_update_titleshistory.php - linie 8-9
/cronjobs/5_update_subjectshistory.php - linie 17-18
/cronjobs/6_cache_glemteskatte.php - linie 32-33
/cronjobs/7_cache_aldrigudlaant.php - linie 17-18
/cronjobs/8_update_grafhistory.php - linie 8-9
/cronjobs/cron_test.php - linie 9-10
/cronjobs/sql_functions.php - linie 27-28
/Graf2/make_list_10_mest_udlaante_emner.php – linie 20-21
/inc/config.php - linie 4-7
5. Opret importrutiner (cron jobs) på Apache webserveren
Du skal have den tekstbaserede Lynx browser installeret på serveren.
Erstat domain.tld/sti-til-mdh-scripts/ i nedenstående med dine egne oplysninger
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/1_import_items.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/2_import_itemshistory.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/3_import_titles.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/4_update_titleshistory.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/5_update_subjectshistory.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/6_cache_glemteskatte.php
lynx -dump http://domain.tld/sti-til-mdh-scripts/cronjobs/7_cache_aldrigudlaant.php
Seneste kommentarer