Thursday, July 18, 2013

Avoiding fake server requests in nginx

I have been having requests to my server with HTTP_HOST header or which are not related to me. They were causing error mails sent to me by my Django site since these domains were not listed in my ALLOWED_HOSTS list. I was tired of having error messages every day so after some research  I found the solution.

I told my nginx server to listen only my own domains but it was listening to other domains as well. I added the following block to the top of my config file

server {
        return 404;

before the original server settings:

server {
       listen 80;

This way any domain that is not in my list gets 404 by default. Hope it helps!

Monday, July 8, 2013

Adding local maven dependencies to Ivy

If you want to use your local maven packages in your app configured with ivy, you should add some lines to ivy.xml and ivysettings.xml. Below is an example.


  <property name="my.local.maven"


    <dependency org="org.apache.giraph" name="giraph-core" rev="1.1.0-SNAPSHOT" conf="*->default"/>
    <dependency org="org.apache.giraph" name="giraph-examples" rev="1.1.0-SNAPSHOT" conf="*->default"/>
    <dependency org="org.apache.giraph" name="giraph-hbase" rev="1.1.0-SNAPSHOT" conf="*->default"/>
    <dependency org="org.apache.hbase" name="hbase" rev="0.90.5" conf="*->default"/>

Thursday, July 4, 2013

Adding maven dependencies into the target jar file

I wanted to add hbase and giraph-hbase dependencies to giraph-example module. I realized that I should specify scope for each to get the into the resulting giraph-example.jar.