sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Add the following line to your sources.list
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
apt-get update
apt-get install mongodb-10gen
This install adds an upstart script to
/etc/init/ and a mongodb.conf to /etc, and the data will be stored in
/var/lib/mongodb.
mongo
at the prompt:
use graylog2
db.addUser("graylog2","password")
wrapper.java.additional.10=-Des.config=%ES_HOME%/config/elasticsearch.yml
cluster.name: my_cluster
node.name: my_node
http.port: 9200
/var/lib/elasticsearch/bin/service/elasticsearch install
Now start up Elasticsearch and we will see that it works. Run the following to check that it is working (If you don't have links or prefer to use a browser you can open
http://<server_IP>:9200 in your favourite browser):
links http://localhost:9200
cd /usr/share/src && wget http://cloud.github.com/downloads/Graylog2/graylog2-server/graylog2-server-0.9.6.tar.gz | tar zxv
cp -R graylog2-server-0.9.6/ /var/lib/graylog2/server/
Now you need to link the conf file (or copy it if you want) into the
/etc folder
cd /etc/ && ln -s /var/lib/graylog2/server/graylog2.conf.example graylog2.conf
Now you need to modify the graylog2.conf to reflect the MongoDB user account and password you created earlier and make sure that the Elasticsearch section references the correct port etc.
cd /usr/share/src && wget http://cloud.github.com/downloads/Graylog2/graylog2-web-interface/graylog2-web-interface-0.9.6.tar.gz | tar zxv
cp -R graylog2-web-interface-0.9.6/ /var/lib/graylog2/web/
Install apache and passenger
apt-get install apache2 libapache2-mod-passenger
Now create a site for the web interface (
/etc/apache2/sites-availab <VirtualHost *:80>
DocumentRoot /varlib/graylog2/web/public
<Directory /var/lib/graylog2/web/public>
Allow from all
Options -MultiViews
SetEnv MONGOID_HOST localhost
SetEnv MONGOID_PORT 27017
SetEnv MONGOID_USERNAME graylog2
SetEnv MONGOID_DATABASE graylog2
</Directory>
ErrorLog /var/log/apache2/graylog2_error.log
LogLevel warn
CustomLog /var/log/apache2/graylog2_access.log combined
</VirtualHost>
To install the web interface you need to have Rubygems and bundler installed
apt-get install rubygems && gem install bundler --no-ri --no-rdoc
Once these are installed navigate into
/var/lib/graylog2/web and run:
bundle install
Now you will want to make sure that the conf/mongoid.yml and the conf/indexer.yml config files have the proper values for your configuration.
a2ensite graylog2 && a2dissite 000-default
Restart Apache and check it out. Graylog2 web runs on port 80 now, so just just hit your server in a web browser. You will be prompted to create your first user and then will have a working and accessible Graylog2 install.
*.* @<graylog server IP address>
Restart rsyslog and wait patiently for your logs to show up. It won't take long until you have data to mine.
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)