Skip to main content

Posts

Showing posts from August, 2017

How to Eureka Service Registration and Discovery

Build with Maven First you set up a basic build script. You can use any build system you like when building apps with Spring, but the code you need to work with  Maven  is included here. If you’re not familiar with Maven, refer to  Building Java Projects with Maven . Create the directory structure In a project directory of your choosing, create the following subdirectory structure; for example, with  mkdir -p src/main/java/hello  on *nix systems: └── src └── main └── java └── hello eureka-service/pom.xml <? xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0.0 </modelVersion> <groupId> com.example </groupId> <arti...

How To Install and Secure phpMyAdmin on Ubuntu 14.04

Install phpMyAdmin : To get started, we can simply install phpMyAdmin from the default Ubuntu repositories. $ sudo apt-get update $ sudo apt-get install phpmyadmin The only thing we need to do is explicitly enable the  php5-mcrypt  extension, which we can do by typing: $ sudo php5enmod mcrypt Afterwards, you'll need to restart Apache for your changes to be recognized: $ sudo service apache2 restart You can now access the web interface by visiting your server's domain name or public IP address followed by  /phpmyadmin : http:// localhost /phpmyadmin When you log in, you'll see the user interface, which will look something like this: $ sudo service apache2 restart Issues :  ## Server is not found Issue ## sudo service apache2 restart * Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's ...

How to Install PHP 7.0, Apache 2.4, & MySQL 5.6 on Ubuntu 16.04 & 14.04

## Install Apache 2.4 ## $ sudo apt-get update $ sudo apt-get install apache2 ## Install MySQL 5.6 ## $ sudo add-apt-repository -y ppa:ondrej/mysql-5.6  $ sudo apt-get update $ sudo apt-get install mysql-server-5.6 ## Install PHP 7 ## $ sudo apt-get install libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-json $ sudo apt-get install php7.0-mcrypt ##curl install## $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install php-curl ##First, allow changes in the .htaccess file. Open the default Apache configuration file using nano or your favorite text editor##. $ sudo nano /etc/apache2/sites-enabled/000-default.conf or $ cd /etc/apache2/sites-available $ sudo vi 000-default.conf ##Inside that file, you will find the <VirtualHost *:80> ....</VirtualHost>. Inside of line## <Directory /var/www/html>      Options Indexes FollowSymLinks MultiViews      AllowOverride All     ...

How to Installing and Deploying Eureka service registry

Installing Eureka Standing up an instance of the Eureka service registry is easy if you have  org.springframework.boot:spring-cloud-starter-eureka-server  on your classpath. package registry ; import org . springframework . boot . SpringApplication ; import org . springframework . boot . autoconfigure . SpringBootApplication ; import org . springframework . cloud . netflix . eureka . server . EnableEurekaServer ; @SpringBootApplication @EnableEurekaServer public class Application { public static void main ( String [] args ) { SpringApplication . run ( Application . class , args ); } } My nominal  src/main/resources/application.yml  looks like this these days. server : port : $ { PORT : 8761 } eureka : client : registerWithEureka : false fetchRegistry : false server : waitTimeInMsWhenSyncEmpty : 0 The service’s port is defaulted to the well-known 8761 if  Cloud Foundry ’s  VCAP_APPL...

How to Configure Consul in a Production Environment on Ubuntu 14.04

Install Consul : #Download Consul : Below are the available downloads for the latest version of Consul (0.8.5). Please download the proper package for your operating system and architecture. $ cd /usr/local/bin $ sudo wget https://releases.hashicorp.com/consul/0.8.5/consul_0.8.5_linux_amd64.zip $ unzip *.zip $ rm *.zip #Create Consul User :   $ adduser consul #Make a directory  $ mkdir -p /etc/consul.d/{bootstrap,server,client} $ mkdir /var/consul $ chown consul:consul /var/consul $ chown consul:consul /var/consul ##  Creating the Bootstrap Configuration ## $ sudo vi /etc/consul.d/bootstrap/config.json ##  Create the first file in the bootstrap subdirectory:  {     "bootstrap": true,     "server": true,     "datacenter": "nyc2",     "data_dir": "/var/consul" } ## In the terminal, we can use the consul command to generate a key of the necess...