Nginx proxy for Solritas

2015-03-16 Thread LongY
Dear Community Members,

I have searched over the forum and googled a lot, still didn't find the
solution. Finally got me here for help.
 
I am implementing a Nginx reverse proxy for Solritas
(VelocityResponseWriter) of the example included in Solr.
. Nginx listens on port 80, and solr runs on port 8983. This is my Nginx
configuration file (It only permits localhost
to access the browse request handler).

*location ~* /solr/\w+/browse {
   proxy_pass  http://localhost:8983;

allow   127.0.0.1;
denyall;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
  
}*

when I input http://localhost/solr/collection1/browse in the browser address
bar. 
 The output I got is this. 
 
The supposed output should be like this 
 

I tested the Admin page with this Nginx configuration file with some minor
modifications, it worked well,
but when used in velocity templates, it did not render the output properly.
 
Any input is welcome.
Thank you.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Nginx-proxy-for-Solritas-tp4193346.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Nginx proxy for Solritas

2015-03-16 Thread LongY
Thank you for the reply.

I also thought the relevant resources (CSS, images, JavaScript) need to 
be accessible for Nginx. 

I copied the velocity folder to solr-webapp/webapp folder. It didn't work.

So how to allow /browse resource accessible by the Nginx rule?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Nginx-proxy-for-Solritas-tp4193347p4193352.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Nginx proxy for Solritas

2015-03-16 Thread LongY
Thanks to Erik and Shawn, I figured out the solution.

* place main.css in velocity folder into
/usr/share/nginx/html/solr/collection1/admin/file/
* don't forget to change the permission of main.css by sudo chmod 755
main.css
* add main.css to the configuration file of Ngix:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
index main.css;
server_name localhost;
location ~* /solr/\w+/browse {
proxy_pass   http://localhost:8983; 
allow   127.0.0.1;
denyall;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
 
} 
}
That will work.
Also /var/log/nginx/error.log is good for debugging.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Nginx-proxy-for-Solritas-tp4193347p4193415.html
Sent from the Solr - User mailing list archive at Nabble.com.


import data into solr from velocity (aka Solritas)

2014-10-17 Thread LongY
hello everyone, 

I did lots of search, and did not find a proper way to solve this problem,
and 
it brings me to here ask for help. 

I am trying to import data from velocity into solr. I defined a new link
which 
is localhost:8983/solr/collection1/browse/importdata. This webpage is used
to 
collect the data imported. However, it seems the velocity is only able to
define 
only one main template, in other words, I am not able to add one more
webpage 
in this velocity UI. 

I also checked DIH (data import handler), it seems it only works with
relational databases or XML files. 

My question is: how can I import data from velocity UI. 

Any input is welcome.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread LongY
Thanks a lot. Eric.

I still used the same /browse request handler in the example.

My goal is to create a webform UI to collect user input to be further
indexed.
My thoughts is adding a new webpage to the existing user interface, the link
is
localhost:8983/solr/collection1/browse/. I added a new link which is
localhost:8983/solr/collection1/browse/importdata.

The problem is: how to add a new webform in the existing velocity response
writer.
Velocity seems allow only one html layout file.

Regarding DIH, it seems does not have this functionality. It is not able to
collect the user input
from a webpage, like a webform.





--
View this message in context: 
http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751p4164784.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: import data into solr from velocity (aka Solritas)

2014-10-18 Thread LongY
Thanks for pointing this out.

The web server I developed is only for internal use, and users are
trustworthy.

Yes, I agree with you. Velocity/Solaritas is never intended to be a
user-facing app.
It need a middleware layer if user is public.









--
View this message in context: 
http://lucene.472066.n3.nabble.com/import-data-into-solr-from-velocity-aka-Solritas-tp4164751p4164787.html
Sent from the Solr - User mailing list archive at Nabble.com.


javascript form data save to XML in server side

2014-10-20 Thread LongY
hello list,

The functionality I would like to add the the existing /browse request
handler is using a user interface (e.g.,webform) to collect the user's
input.

My approach is add a javascript form into the velocity template, below is
the code I added to the velocity
template(for example):

  First name: 
  Last name: 


And I am using this ProcessData.php to process the user input to generate a
XML in the server.

My question is 
1) how to make solr to run this ProcessData.php? It seems solr does not
support php?
2) Where is this ProcessData.php going to be placed in the solr directory?

I am a newbie in web programming. I tried very hard to catch up with it.

Thank you.









--
View this message in context: 
http://lucene.472066.n3.nabble.com/javascript-form-data-save-to-XML-in-server-side-tp4165025.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: javascript form data save to XML in server side

2014-10-20 Thread LongY
I guess the admin UI for adding docs you mentioned is Data Import Handler. 
If I understand your reply correctly, the idea is to post the javascript
form data from the webpage to /update/extract handler. Thank you for
shedding some light.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/javascript-form-data-save-to-XML-in-server-side-tp4165025p4165059.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: javascript form data save to XML in server side

2014-10-20 Thread LongY
The solr users are trustworthy and it's only for internal use. The purpose of
this form is to allow user to directly input data to be further indexed by
solr. I am interested in this sentence from your reply which is "Or you can
run Javascript to post back to Solr". Please bear with me if I ask very
simple question on the web programming. From my understanding, javascript is
client-side programming language, how is it possible to post the form data
back to Solr using javascript. Thank you.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/javascript-form-data-save-to-XML-in-server-side-tp4165025p4165061.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: javascript form data save to XML in server side

2014-10-20 Thread LongY
thank you very much. Alex. You reply is very informative and I really
appreciate it. I hope I would be able to help others in this forum like you
are in the future.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/javascript-form-data-save-to-XML-in-server-side-tp4165025p4165066.html
Sent from the Solr - User mailing list archive at Nabble.com.