Monthly Archives: September 2018

How to set up HTTPS on Tomcat

Apache Tomcat, often referred to as Tomcat Server, is an open-source Java Servlet Container developed by the Apache Software Foundation (ASF). Tomcat implements several Java EE specifications including Java Servlet, JavaServer Pages (JSP), Java EL, and WebSocket, and provides a “pure Java” HTTP web server environment in which Java code can run.

This Tomcat Tutorial will show you how to create a self signed cert that you can then use to secure Tomcat.

Step 1

Open a command prompt window and navigate to your JAVA_HOME bin folder, in our case:

C:\Program Files\Java\jre1.8.0_171\bin

Step 2

Enter the command:

keytool -genkey -alias tomcat -keyalg RSA -keystore “C:\apache-tomcat-8.5.34\conf\localhost.jks”

Note: You should update the tomcat path to match your path 

Step 3

You will then be prompted for a series of values, in our case we entered:

enter Keystore password: password
retype keystore password: password
what is your first and last name: localhost
what is the name of your orgainsation unit: IT
what is the name of your organisation: Darren
what is the name of your city: Dublin
what is the name of your state or province: Leinster
What is the two-letter country code for this unit: IE

When prompted type yes to confirm all is correct.

Next you will be asked to use the same password for <tomcat>, press enter here:

Step 4

Now open the tomcat server.xml file, in our case the file is located here:

C:\apache-tomcat-8.5.34\conf\server.xml

Step 5

Add the following block to the file:

	<Connector
		protocol="HTTP/1.1"
		port="8443" maxThreads="200"
		scheme="https" secure="true" SSLEnabled="true"
		keystoreFile="conf\localhost.jks" keystorePass="password"
		clinetAuth="false" sslProtocol="TLS" />

Step 6

Restart Tomcat.

Step 7

Navigate to https://localhost:8443.

You should first see a certificate warning, click to bypass the warning.

Step 8

You should now see Tomcat working over HTTPS

A full video tutorial can be found here:

How to create a drop down menu in Excel

This short tutorial will show you how to create a drop down menu in Excel. The Drop down menu will allow you to ensure that only the correct data gets entered into a field.

In this example we want to ensure that the end user can only enter the following information into a selection of cells

  1. On Time
  2. Late
  3. Early
  4. Cancelled.

Step 1

Enter the the options for your drop down menu in cells in your workbook. in Our case we entered them in column M.

Step 2 

Now highlight the cells you want to have the drop down menu in and click Data.

Step 3

Click data Validation and data validation again

Step 4

In the box that appears select List

Step 5

Click into the Source menu box and then highlight the values that you want to be in your drop down menu, in our case M2 to M5. Then click ok

Step 6

Your Drop down options should now appear:

A full video tutorial ca be found here:

How to Run Wildfly on CentOS 7

WildFly, formerly known as JBoss AS, or simply JBoss, is an application server authored by JBoss, now developed by Red Hat. WildFly is written in Java and implements the Java Platform, Enterprise Edition (Java EE) specification. It runs on multiple platforms.

WildFly is free and open-source software, subject to the requirements of the GNU Lesser General Public License (LGPL), version 2.1.

This tutorial will show you how to install Wildfly on Centos 7.

Step 1

To run Wildfly you need Java, so we will download it now, run the command:

yum -y install java-1.8.0-openjdk

Confirm that it is installed correctly by running:

java -version

Step 2

Let’s get the firewall ready, there are two ports we need open, lets open them now, run the following commands:

sudo firewall-cmd –zone=public –add-port=8080/tcp –permanent
sudo firewall-cmd –zone=public –add-port=9990/tcp –permanent

Now reload the firewall to ensure the changes take effect:

sudo firewall-cmd –reload

Step 3

Now lets download wildfly, run the command:

wget http://download.jboss.org/wildfly/14.0.1.Final/wildfly-14.0.1.Final.tar.gz

Step 4

Now lets un-pack the tar file, run:

sudo tar -zxf wildfly-14.0.1.Final.tar.gz

Step 5

Now let’s edit some config files first we need to move to the relevant directory, run the command.

cd wildfly-14.0.1.Final/standalone/configuration

We need to edit the standalone.xml file.

We will use vi for this, run:

vi standalone.xml

look for the section:

<interfaces>
<interface name=”management”>
<inet-address value=”${jboss.bind.address.management:127.0.0.1}”/>
</interface>
<interface name=”public”>
<inet-address value=”${jboss.bind.address:127.0.0.1}”/>
</interface>
</interfaces>

Note the 127.0.0.1 we will change this to 0.0.0.0, the block of text should look like so:

<interfaces>
<interface name=”management”>
<inet-address value=”${jboss.bind.address.management:0.0.0.0}”/>
</interface>
<interface name=”public”>
<inet-address value=”${jboss.bind.address:0.0.0.0}”/>
</interface>
</interfaces>

Step 6

Now lets add a management user. First run:

cd wildfly-14.0.1.Final/bin

Next run the command:

./add-user.sh

You will be greeted with a series of prompts:

a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a):

  • Press enter for the default.

Enter the details of the new user to add.
Using realm ‘ManagementRealm’ as discovered from the existing property files.
Username:

  • Enter a Username

Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
– The password should be different from the username
– The password should not be one of the following restricted values {root, admin, administrator}
– The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :

  • Enter a password.

What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user ‘wildfly’ for realm ‘ManagementRealm’
Is this correct yes/no

  • Type yes.

Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no?

  • Type no.

Step 7

Now we will start Wildfly, ensure that you are still in the bin directory and run the following command:

./standalone.sh

If the command is successful output should like so (You can ignore any ssl warnings):

Step 8

Lets confirm wildfly is up, open and web browser and navigate to the IP address of your CentOS server and append the port 8080 to the address, in our case it looks like so:

http://192.168.125.3:8080

You should see a screen that looks like so:

Step 9

Now let’s ensure the management interface is working, navigate to

http://192.168.125.3:9990

You should be prompted for a login, enter the username and password you set in step 6.

You should then see the Wildfly management interface.

A full video tutorial can be found here:

Install God Mode On Windows

“The Windows Master Control Panel shortcut, labeled All Tasks and also called Windows God Mode by bloggers and All Tasks folder by at least one Microsoft developer,[1] is a short-cut to access various control settings in Windows Vista and later operating systems, including Windows 10”

You first need to create a new folder:

 

You then need to name it exactly with this line:

GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

 

 

Hit enter, the icon now changes to god mode.

If you double click into it you see a full list of admin settings:

if you are on windows 10 and god mode is not working please ensure that you have GodMode. in front of the first { and that you are running as an admin account Once this is done, you will then be able to access god mode in windows.

 

A full video tutorial can be found here:

How to Host Multiple Websites on IIS

Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server created by Microsoft for use with the Windows NT family.[2] IIS supports HTTP, HTTP/2, HTTPS, FTP, FTPS, SMTP and NNTP. It has been an integral part of the Windows NT family since Windows NT 4.0, though it may be absent from some editions (e.g. Windows XP Home edition), and is not active by default.

This IIS tutorial will show you how to host multiple websites on one IIS server. To get to this point you will need to have IIS installed, you can see how to do so here:

How to install IIS on server 2016

If you are testing on one server you may want to edit the hosts file like i did, you can see how to do so here:

How to edit the hosts file on Windows Server 2016

Step 1

I edited my hosts file so i had the two urls:

testsite1.com

testsite2.com

Both looking at 127.0.01 (Localhost)

Step 2

Open IIS, and right click sites and select Add Website

Step 3

Enter values relevant to you, if you are following along exactly with the tutorial enter the following values.

Sitename: testsite2

Physical path: C:\inetpub\wwwroot\testsite2

Binding: testsite2.com

Then click ok.

Step 4

Click explore on the right hand side of the screen .

Step 5

Create a file called index.html in this directory.

Enter the text, this is test site 2.

Step 6

Move up one directory level to.

C:\inetpub\wwwroot

Create a file called index.html

enter the text:

This is test site 1

Step 7

Open a browser and navigate to:

http://testsite1.com

You should see the test site 1 page:

Step 8

Open a browser and navigate to:

http://testsite2.com

You should see the test site 2 page:

A full video tutorial can be found here:

How to install IIS on server 2016

Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server created by Microsoft for use with the Windows NT family.[2] IIS supports HTTP, HTTP/2, HTTPS, FTP, FTPS, SMTP and NNTP. It has been an integral part of the Windows NT family since Windows NT 4.0, though it may be absent from some editions (e.g. Windows XP Home edition), and is not active by default.

This IIS web server tutorial will show you how to install IIS 10 on Windows server 2016.

step 1

Click on the start menu and then server manager

Step 2

Next click on manage and then add Roles and Features.

Step 3

Click Next

Step 4

Click Next again.

Step 5

Click next one last time.

Step 6

Scroll down and click Web Server (IIS)

Step 7

In the screen that appears click Add Features.

Step 8

Click Next.

Step 9

Click Next

Step 10

Click Next again.

Step 11

Leave the default and click next.

Step 12

Click install

You should now see a message saying Install successful. Click close to exit the installer.

A full video tutorial can be found here: