Wednesday, September 23, 2015

docket rabbitmq

root@sam-clm2:~# docker exec 7931dc7e8611 /usr/sbin/rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
  mochiweb
  webmachine
  rabbitmq_web_dispatch
  amqp_client
  rabbitmq_management_agent
  rabbitmq_management

Applying plugin configuration to rabbit@ms-rabbit... started 6 plugins.
root@sam-clm2:~#


  wget http://guest:guest@localhost:15672/cli/rabbitmqadmin
  mv rabbitmqadmin.2 /usr/local/bin/rabbitmqadmin
  chmod +x /usr/local/bin/rabbitmqadmin
  rabbitmqadmin list exchanges

root@sam-clm2:~# rabbitmqadmin declare exchange name=exchange_Office type=direct
exchange declared
root@sam-clm2:~# rabbitmqadmin declare exchange name=exchange_PE type=direct
exchange declared
root@sam-clm2:~# rabbitmqadmin declare exchange name=exchange_JS type=direct
exchange declared
root@sam-clm2:~# rabbitmqadmin declare exchange name=exchange_ALL type=direct
exchange declared
root@sam-clm2:~# rabbitmqadmin declare exchange name=exchange_PDF type=direct




root@sam-clm2:~# docker exec 7931dc7e8611 /usr/sbin/rabbitmq-plugins list
 Configured: E = explicitly enabled; e = implicitly enabled
 | Status:   * = running on rabbit@ms-rabbit
 |/
[e*] amqp_client                       3.5.4
[  ] cowboy                            0.5.0-rmq3.5.4-git4b93c2d
[e*] mochiweb                          2.7.0-rmq3.5.4-git680dba8
[  ] rabbitmq_amqp1_0                  3.5.4
[  ] rabbitmq_auth_backend_ldap        3.5.4
[  ] rabbitmq_auth_mechanism_ssl       3.5.4
[  ] rabbitmq_consistent_hash_exchange 3.5.4
[  ] rabbitmq_federation               3.5.4
[  ] rabbitmq_federation_management    3.5.4
[E*] rabbitmq_management               3.5.4
[e*] rabbitmq_management_agent         3.5.4
[  ] rabbitmq_management_visualiser    3.5.4
[  ] rabbitmq_mqtt                     3.5.4
[  ] rabbitmq_shovel                   3.5.4
[  ] rabbitmq_shovel_management        3.5.4
[  ] rabbitmq_stomp                    3.5.4
[  ] rabbitmq_test                     3.5.4
[  ] rabbitmq_tracing                  3.5.4
[e*] rabbitmq_web_dispatch             3.5.4
[  ] rabbitmq_web_stomp                3.5.4
[  ] rabbitmq_web_stomp_examples       3.5.4
[  ] sockjs                            0.3.4-rmq3.5.4-git3132eb9
[e*] webmachine                        1.10.3-rmq3.5.4-gite9359c7

ang@sam-clm2:~$ rabbitmqadmin list exchanges
+--------------------+---------+
|        name        |  type   |
+--------------------+---------+
|                    | direct  |
| amq.direct         | direct  |
| amq.fanout         | fanout  |
| amq.headers        | headers |
| amq.match          | headers |
| amq.rabbitmq.log   | topic   |
| amq.rabbitmq.trace | topic   |
| amq.topic          | topic   |
| exchange_ALL       | direct  |
| exchange_JS        | direct  |
| exchange_Office    | direct  |
| exchange_PDF       | direct  |
| exchange_PE        | direct  |
+--------------------+---------+

ang@sam-clm2:~$ rabbitmqadmin list queues
+------------------+----------+
|       name       | messages |
+------------------+----------+
| queue_ALL_new    | 0        |
| queue_JS_new     | 0        |
| queue_Office_new | 0        |
| queue_PDF_new    | 0        |
| queue_PE_new     | 0        |
+------------------+----------+


install rabbit-mq in ubuntu

1, vim /etc/apt/sources.list

Add the following line to your /etc/apt/sources.list:
deb http://www.rabbitmq.com/debian/ testing main


 2,    wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
 

3,  apt-key add rabbitmq-signing-key-public.asc

4,    apt-get update

5,  apt-get install rabbitmq-server
 
6,  apt-get -f install


  61  rabbitmqadmin list exchanges
   62  rabbitmqadmin list exchanges -u guest -p guest
   63  rabbitmq-plugins list
   64  rabbitmq-plugins enable rabbitmq_management
   65  rabbitmq-plugins list
   66  rabbitmqadmin list exchanges -u guest -p guest
   67  rabbitmqadmin list exchanges
   68  rabbitmqadmin list queues
   69  history

Tuesday, August 11, 2015

install qpid on ubuntu 14

# install qpid
apt-get install qpidd qpid-doc qpid-client python-qpid-extras-qmf python-qpid python-cqpid

wget http://apache.mirrors.tds.net/qpid/0.32/qpid-tools-0.32.tar.gz
tar zxvf qpid-tools-0.32.tar.gz
cd qpid-tools-0.32/
./setup.py build
./setup.py install

sub-process /usr/bin/dpkg returned an error code (1) ubuntu apache2 (OpsWorks)

When do
apt-get install apache2
got error:
sub-process /usr/bin/dpkg returned an error code (1) ubuntu apache2

Solution:  do these first:

apt-get remove --purge apache2
apt-get install -f
apt-get autoremove

may need if you remove apache2 got same issue:
umount /var/log/apache2
umount /var/www


Then:
apt-get install apache2


Friday, August 7, 2015

ES AWS

updatedb
apt-get update
apt-get upgrade

add-apt-repository ppa:webupd8team/java

apt-get update
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.deb

dpkg -i elasticsearch-1.7.1.deb

apt-get install oracle-java8-installer

cd /usr/share/elasticsearch
bin/plugin install elasticsearch/elasticsearch-cloud-aws/2.7.0

cat /dev/null > /etc/elasticsearch/elasticsearch.yml
vim /etc/elasticsearch/elasticsearch.yml

/etc/init.d/elasticsearch start
/etc/init.d/elasticsearch status

Friday, July 10, 2015

enable https (comodo cert) for apache2 & ubuntu 14

1, make xxxxxxxxxxxx.ca-bundle file

cat AddTrustExternalCARoot.crt COMODORSAAddTrustCA.crt COMODORSADomainValidationSecureServerCA.crt yourdomain_com.crt > yourdomain_com.ca-bundle

2, create cert folder under /etc/apache2/cert

3, copy all file from comodo to this folder

root@cnew:/etc/apache2/cert# ll
total 36
drwxr-xr-x 2 root root 4096 Jul 10 23:15 ./
drwxr-xr-x 9 root root 4096 Jul 10 21:34 ../
-rw-r--r-- 1 root root 1521 Jun 28 07:31 AddTrustExternalCARoot.crt
-rw-r--r-- 1 root root 7515 Jul 10 23:15 yourdomain_com.ca-bundle
-rw-r--r-- 1 root root 1891 Jun 28 07:31 yourdomain_com.crt
-rw-r--r-- 1 root root 1675 Jun 28 07:31 yourdomain.key
-rw-r--r-- 1 root root 1952 Jun 28 07:31 COMODORSAAddTrustCA.crt
-rw-r--r-- 1 root root 2151 Jun 28 07:31 COMODORSADomainValidationSecureServerCA.crt

4: vim /etc/apache2/sites-available/default-ssl.conf


                SSLCertificateFile  /etc/apache2/cert/yourdomain_com.crt
                SSLCertificateKeyFile /etc/apache2/cert/yourdomain_com.key

                SSLCertificateChainFile /etc/apache2/cert/yourdomain_com.ca-bundle

5:  enable ssl mod and ssl site
a2enmod ssl
a2ensite default-ssl.conf
service apache2 restart