Thursday, August 25, 2016

DNSMASQ as internal DNS server with a PHP mangement page (GUI)





Environment

  • Apache as the web server. (In my server apache set to run in port 9000)
          PHP and SQLite DB files located at "/var/www/html/dnsmasq" and the same path set as the root directory.

         service accessed via http://server1/dnsmasq/login.php
  • login.php
  • admin.php - add/remove/modify host entries and update the DB
  • admin.db - user logins
  • db.php - DB connections
  • hosts.db - host entry DB
  • update.sh - updates the local hosts file when invoked from the PHP file
  • dnsmasq.conf - replace dnsmasq initial file with this
* make sure to grant dnsmasq service reload access to apache user in visudo
   # visudo
   -- add below entry
    apache  ALL = NOPASSWD: /etc/init.d/dnsmasq reload

* current user in admin.db is "admin", password is "password"
   to change the login or to add a user use below sql commands;
   
   change admin user password ---  sqlite3 admin.db "update logins set password='123456' where username='admin'"

   add a user --- sqlite3 admin.db "insert into logins (username,password) values ('admin','password')"




Thursday, February 25, 2016

Configure HornetQ in JBoss EAP 6 to work with NAT (Eucalyptus Cloud network environment)



You need to apply below changes in "server\default\deploy\hornetq\hornetq-configuration.xml" file.

<connectors>
      <connector name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="192.168.1.5 – this is the NATTED IP"/>
         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
      </connector>
     
      <connector name="netty-throughput">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
         <param key="host"  value="192.168.1.5 – this is the NATTED IP "/>
         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
         <param key="batch-delay" value="50"/>
      </connector>

      <connector name="in-vm">
         <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
         <param key="server-id" value="${hornetq.server-id:0}"/>
      </connector>

   </connectors>

   <acceptors>  
      <acceptor name="netty">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
         <param key="host"  value="10.1.2.9 – this is the server private IP"/>
         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
      </acceptor>
     
      <acceptor name="netty-throughput">
         <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
         <param key="host"  value="10.1.2.9 – this is the server private IP "/>
         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
         <param key="batch-delay" value="50"/>
         <param key="direct-deliver" value="false"/>
      </acceptor>

      <acceptor name="in-vm">
        <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
        <param key="server-id" value="0"/>
      </acceptor>

   </acceptors>

Change the "run.conf" file as below;

-Djboss.bind.address=10.1.2.9  -Djava.rmi.server.hostname=192.168.1.5