salve a tutti..volevo porvi un problema forse già noto, ma che non ho visto affrontato in maniera tale che anche un principiante come me potesse capirlo.
Si tratta di Nutch..devo installarlo seguendo questi passi, ma VI GIURO CHE NON CI CAPISCO NIENTE!!!
Requisiti
1. Java 1.4.x, either from Sun or IBM on Linux is preferred. Java 1.4.x, sia da sole o IBM su Linux è preferito. Set NUTCH_JAVA_HOME to the root of your JVM installation. Impostare NUTCH_JAVA_HOME alla root della vostra installazione di JVM.
2. Apache's Tomcat 4.x. Tomcat di Apache 4.x.
Fino a un gigabyte di spazio libero su disco, una connessione ad alta velocità, e più o meno un'ora.
Starte
È possibile scaricare una versione da http://lucene.apache.org/nutch/release/. Scompattate il rilascio e collegare alla sua directory di livello superiore.. Oppure, fare check-out l'ultimo codice sorgente di sovversione e di costruire con Ant.
Provare il seguente comando:
bin/nutch bin / Nutch
Ciò visualizzerà la documentazione per lo script di comando Nutch.
Now we're ready to crawl. Ora siamo pronti per eseguire la scansione. There are two approaches to crawling: Ci sono due approcci per la scansione:
1. Intranet scansione, con il comando di scansione.
2. Tutta la web-crawling, con un controllo molto più grande, utilizzando il più basso livello di iniezione generare, fetch e updatedb comandi.
Whole-Crawling web
Tutta la web-crawling è progettato per gestire grandi scansioni che può richiedere settimane per completare, in esecuzione su macchine multiple.
Tutto-web: Concetti
Dati Nutch è composto da:
1. Il database di scansione, o crawldb. Questo contiene informazioni su tutte le url noto Nutch, tra cui se è stato recuperato, e, se sì, quando.
2. Il database di link, o LinkDB. Questa contiene l'elenco di link a conoscenza di ciascuno url, compresi sia l'URL di origine e il testo di ancoraggio del collegamento.
3. Un insieme di segmenti. Ogni segmento è un insieme di URL che sono stati scaricati come unità. Segmenti sono le directory con le seguenti sottodirectory:
4.
* un crawl_generate nomi di una serie di URL da prelevare
*un crawl_fetch contiene lo stato di caricamento di ogni URL
*un contenuto contiene il contenuto di ogni URL
*ntiene il testo analizzato di ogni URL
* a parse_data contains outlinks and metadata parsed from each url uno parse_data contiene outlinks e metadati analizzato da ogni URL
* a crawl_parse contains the outlink urls, used to update the crawldb uno crawl_parse contiene l'URL outlink, utilizzati per aggiornare la crawldb
5. The indexes are Lucene-format indexes. Gli indici sono Lucene-indici in formato.
Whole-web: Boostrapping the Web Database Tutto-web: Boostrapping il database Web
The injector adds urls to the crawldb. L'iniettore aggiunge URL del crawldb. Let's inject URLs from the DMOZ Open Directory. Let's iniettare URL dal DMOZ Open Directory. First we must download and uncompress the file listing all of the DMOZ pages. (This is a 200+Mb file, so this will take a few minutes.) Prima di tutto dobbiamo scaricare e decomprimere il file che elenca tutte le pagine di DMOZ. (Si tratta di un + 200 Mb di file, quindi ci vorrà qualche minuto).
wget http://rdf.dmoz.org/rdf/content.rdf.u8.gz wget http://rdf.dmoz.org/rdf/content.rdf.u8.gz
gunzip content.rdf.u8.gz gunzip content.rdf.u8.gz
Next we select a random subset of these pages. (We use a random subset so that everyone who runs this tutorial doesn't hammer the same sites.) DMOZ contains around three million URLs. Poi si seleziona un sottoinsieme casuale di queste pagine. (Usiamo un sottoinsieme casuale in modo che tutti coloro che gestisce questo tutorial non martello negli stessi siti.) DMOZ contiene circa tre milioni di URL. We select one out of every 5000, so that we end up with around 1000 URLs: Selezioniamo uno ogni 5.000, così che si finisce con circa 1000 URL:
mkdir dmoz mkdir dmoz
bin/nutch org.apache.nutch.tools.DmozParser content.rdf.u8 -subset 5000 > dmoz/urls bin / org.apache.nutch.tools.DmozParser nutch content.rdf.u8-sottoinsieme 5000> dmoz / URL
The parser also takes a few minutes, as it must parse the full file. Il parser prende anche pochi minuti, come si deve analizzare il file completo. Finally, we initialize the crawl db with the selected urls. Infine, abbiamo inizializzare il db eseguire la scansione con gli URL selezionati.
bin/nutch inject crawl/crawldb dmoz bin / Nutch iniettare scansione / dmoz crawldb
Now we have a web database with around 1000 as-yet unfetched URLs in it. Ora abbiamo una base di dati nella rete, con circa 1000 as-URL unfetched ancora in essa.
Whole-web: Fetching Tutto-web: Scaricare
Starting from 0.8 nutch user agent identifier needs to be configured before fetching. A partire da 0,8 identificativo dell'utente nutch agente deve essere configurato prima di caricare. To do this you must edit the file conf/nutch-site.xml , insert at minimum following properties into it and edit in proper values for the properties: Per fare questo è necessario modificare il file conf /-nutch site.xml, inserire al minimo i seguenti immobili in esso e modificare i valori corretto per le proprietà:
<property> <property>
<name>http.agent.name</name> <name> http.agent.name </ name>
<value></value> <value> </ value>
<description>HTTP 'User-Agent' request header. utente <description> HTTP '-Agent' richiesta. MUST NOT be empty - NON DEVE essere vuota --
please set this to a single word uniquely related to your organization. Si prega di indicare una sola parola univocamente correlati alla tua organizzazione.
NOTE: You should also check other related properties: NOTA: Si dovrebbe controllare anche altri immobili connessi:
http.robots.agents http.robots.agents
http.agent.description http.agent.description
http.agent.url http.agent.url
http.agent.email http.agent.email
http.agent.version http.agent.version
and set their values appropriately. e impostare i loro valori in modo appropriato.
</description> </ description>
</property> </ property>
<property> <property>
<name>http.agent.description</name> <name> http.agent.description </ name>
<value></value> <value> </ value>
<description>Further description of our bot- this text is used in <description> ulteriore descrizione dei nostri bot-questo testo viene utilizzato in
the User-Agent header. User-Agent. It appears in parenthesis after the agent name. Appare tra parentesi dopo il nome dell'agente.
</description> </ description>
</property> </ property>
<property> <property>
<name>http.agent.url</name> <name> http.agent.url </ name>
<value></value> <value> </ value>
<description>A URL to advertise in the User-Agent header. <description> Un URL di pubblicizzare in User-Agent. This will Ciò
appear in parenthesis after the agent name. appare tra parentesi dopo il nome dell'agente. Custom dictates that this Custom impone che questo
should be a URL of a page explaining the purpose and behavior of this dovrebbe essere un URL di una pagina per spiegare lo scopo e il comportamento di questo
crawler. crawler.
</description> </ description>
</property> </ property>
<property> <property>
<name>http.agent.email</name> <name> http.agent.email </ name>
<value></value> <value> </ value>
<description>An email address to advertise in the HTTP 'From' request <description> Un indirizzo e-mail per pubblicizzare in HTTP 'From' richiesta
header and User-Agent header. intestazione e User-Agent. A good practice is to mangle this Una buona pratica è quella di storpiare questo
address (eg 'info at example dot com') to avoid spamming. info indirizzo (ad esempio, 'a esempio dot com') per evitare lo spamming.
</description> </ description>
</property> </ property>
To fetch, we first generate a fetchlist from the database: A prendere, abbiamo innanzitutto generare un fetchlist dal database:
bin/nutch generate crawl/crawldb crawl/segments bin / Nutch generare crawl / crawl crawldb / segmenti
This generates a fetchlist for all of the pages due to be fetched. The fetchlist is placed in a newly created segment directory. The segment directory is named by the time it's created. Ciò genera un fetchlist per tutte le pagine che dovrà essere recuperata. Fetchlist La si trova in una directory appena creata segmento. La directory segmento è nominato dal momento in cui essa ha creato. We save the name of this segment in the shell variable s1 : Salviamo il nome di questo segmento nella variabile s1:
s1=`ls -d crawl/segments/2* | tail -1` s1 = `ls-d crawl/segments/2 * | tail -1`
echo $s1 echo $ s1
Now we run the fetcher on this segment with: Ora corriamo il fetcher su questo segmento con:
bin/nutch fetch $s1 bin / Nutch fetch $ s1
When this is complete, we update the database with the results of the fetch: Quando questo è completo, abbiamo aggiornato il database con i risultati del recupero:
bin/nutch updatedb crawl/crawldb $s1 / bin crawl nutch updatedb / crawldb $ s1
Now the database has entries for all of the pages referenced by the initial set. Per ora il database è voci relative a tutte le pagine a cui fa riferimento il set iniziale.
Now we fetch a new segment with the top-scoring 1000 pages: Ora siamo cercare un nuovo segmento con il top-scoring 1000 pagine:
bin/nutch generate crawl/crawldb crawl/segments -topN 1000 bin / Nutch generare crawl / crawl crawldb / segmenti-topn 1000
s2=`ls -d crawl/segments/2* | tail -1` s2 = `ls-d crawl/segments/2 * | tail -1`
echo $s2 echo $ s2
bin/nutch fetch $s2 bin / Nutch fetch $ s2
bin/nutch updatedb crawl/crawldb $s2 / bin crawl nutch updatedb / crawldb $ s2
Let's fetch one more round: Let's prendere uno più rotondo:
bin/nutch generate crawl/crawldb crawl/segments -topN 1000 bin / Nutch generare crawl / crawl crawldb / segmenti-topn 1000
s3=`ls -d crawl/segments/2* | tail -1` s3 = `ls-d crawl/segments/2 * | tail -1`
echo $s3 echo $ s3
bin/nutch fetch $s3 bin / Nutch fetch $ s3
bin/nutch updatedb crawl/crawldb $s3 / bin crawl nutch updatedb / crawldb $ s3
By this point we've fetched a few thousand pages. A questo punto abbiamo recuperato qualche migliaio di pagine. Let's index them! Indice Let's them!
Whole-web: Indexing Tutto-web: indicizzazione
Before indexing we first invert all of the links, so that we may index incoming anchor text with the pages. Prima di indicizzazione in primo luogo abbiamo invertito tutti i collegamenti, in modo che possiamo testo indice arrivo di ancoraggio con le pagine.
bin/nutch invertlinks crawl/linkdb crawl/segments/* / bin Nutch invertlinks scansione / crawl LinkDB / segmenti / *
To index the segments we use the index command, as follows: Per indicizzare i segmenti si usa il comando indice, come segue:
bin/nutch index crawl/indexes crawl/crawldb crawl/linkdb crawl/segments/* / bin scansione nutch index / indici di eseguire la scansione / crawl crawldb / crawl LinkDB / segmenti / *
Now we're ready to search! Ora siamo pronti per la ricerca!
Searching Searching
Simplest way to verify the integrity of your crawl is to launch NutchBean from command line: Il modo più semplice per verificare l'integrità della vostra scansione è di lanciare NutchBean da riga di comando:
bin/nutch org.apache.nutch.searcher.NutchBean apache / bin apache org.apache.nutch.searcher.NutchBean Nutch
After you have verified that the above command returns results you can proceed to setting up the web interface. Dopo aver verificato che i risultati di cui sopra torna comando che si può procedere alla costituzione l'interfaccia web.
To search you need to put the nutch war file into your servlet container. Per effettuare la ricerca è necessario mettere la guerra nutch file nel servlet container. (If instead of downloading a Nutch release you checked the sources out of SVN, then you'll first need to build the war file, with the command ant war .) (Se invece di scaricare una versione Nutch Hai controllato le fonti di SVN, quindi per prima cosa devi creare il file di guerra, con la guerra di comando ant.)
Assuming you've unpacked Tomcat as ~/local/tomcat, then the Nutch war file may be installed with the commands: Supponendo che hai estratto Tomcat come ~ / local / tomcat, quindi il file Nutch guerra può essere installato con i comandi:
rm -rf ~/local/tomcat/webapps/ROOT* rm-rf ~ / local / tomcat / webapps / ROOT *
cp nutch*.war ~/local/tomcat/webapps/ROOT.war cp Nutch *. guerra ~ / local / tomcat / webapps / ROOT.war