Post centos installation after a minimal installation

Reading Time: < 1 minute

1. Auto network discovery there is an app called dhclient. It will easily discovery ip address and launch network right away dhclient -v


2.  install Gnome gui

yum -y groupinstall “X Window System” “Desktop” “General Purpose Desktop”

3.start gui on startup

nano /etc/inittab

change id to 5

# Default runlevel. The runlevels used by RHS are: 
#   0 - halt (Do NOT set initdefault to this) 
#   1 - Single user mode 
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking) 
#   3 - Full multiuser mode 
#   4 - unused 
#   5 - X11 
#   6 - reboot (Do NOT set initdefault to this) 
#  id:3:initdefault:

4.installing vmware tools in vmware choose Install VMware tools

yum -y install perl
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
mkdir /installs
cp VMware*.tar.gz /installs
cd /installs/
tar -zxvf VMware*.tar.gz
cd vmware-tools-distrib

restart pc for the default values I kept pressing on entep  r

Creating and converting an ssl certificate in numerous formats

Reading Time: < 1 minute

Creating a key file 

openssl genrsa -des3 -out tugrul.key 1024

Creating CSR(Certificate Signing Request) file

openssl req -new -key tugrul.key -out tugrul.csr

Creating a CRT  Self-Signed SSL Certificate

openssl x509 -req -days 365 -in tugrul.csr -signkey tugrul.key -out tugrul.crt

Converting a Certificate File to PKCS#12(PFX) Format

 openssl pkcs12 -export -out tugrul.p12 -inkey tugrul.key -in tugrul.crt -certfile tugrul.crt

for pfx format alter “-out tugrul.p12” as “-out tugrul.pfx ”

Converting .crt file into the Microsoft .cer format

Double Click the crt file and Skip to the Details tab


then choose the format you wish to be exported as



LAMP Stack on Windows

Reading Time: 2 minutes

Apache 2.4 Installation

Download Apache 2.4.16 win32 from Apache lounge –

Unzip entire content to C: and keep the folder name as given

Visual C++ Redistributable for Visual Studio 2015 package for Win32 and install it –

Go to unzipped Apache folder –> conf edit httpd.conf and edit those lines;

Listen *:80

remove # from the line of  LoadModule rewrite_module modules/

AllowOverride All

run Command line and go to Apache2.4 bin folder

then issue httpd -t

you will see Syntax OK message

then run the apache as service — but run the command line as admin!

httpd -k install

issue services.msc command in run and start apache server and go to localhost and see the landing page then voila if all works out1

PHP 5.6 Installation

Download Php 5.6 threadsafe win32,

make sure you install win32 thread safe package(includes apache php lib file) and x86 one not X64 otherwise it does fail for some reason! e.g –

unzip everything in C folder php

then go to the folder and rename php.ini-development to php.ini

open php.ini file, find and alter those lines

this is important make sure you enter the correct path and its not backslashes!!

extension_dir = "C:/php/ext"

uncomment necessary extensions

;extension=php_exif.dll      ; Must be after mbstring as it depends on it
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client

add php folder to your environment variable


reopen apaches httpd conf file and add index.php

DirectoryIndex index.php index.html

and add the below line to the end of file

# PHP5 module
LoadModule php5_module "c:/php/php5apache2_4.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

then issue httpd -t to make sure syntax is correct

then start the service in services.msc

Mysql Installation

Download the mysql community edition + workbench bundle full stack —

How to write exponential numbers

Reading Time: < 1 minute

While I was working on completion of my CS notes, I was looking for writing exponent numbers and googled it. In Turkish results I’ve come to have found this solution

Write n2 and hightligh the number, then later on keep pressing on Alt and 0178 will give you this outcome n², ALT 0179 will give you n³

configure ssl

Reading Time: < 1 minute

Export from JKS to PKCS #12.
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias <jkskeyalias> -deststorepass <password> -destkeypass <password>
mv keystore.p12 /root
cd /root

convert to key
openssl rsa -outform der -in private.pem -out private.key

nano /etc/httpd/conf.d/ssl.conf

find the line <VirtualHost _default_:443>

uncomment ServerName and type servername:443

SSLEngine on

SSLCertificateFile /root/downloadedcertificate.crt

SSLCertificateKeyFile /root/private.key

save and exit
restart httpd

service httpd restart

then test



Configure SSL on Apache and Glassfish and forward traffic to Glassfish

Reading Time: 2 minutes

keytool -keysize 2048 -genkey -alias -keyalg RSA –dname “,O=company,L=Istanbul,S=Istanbul,C=TR” -keystore keystore.jks

keytool –certreq –alias –keystore keystore.jks –file cert_req.csr

keytool -import -alias -keystore keystore.jks -trustcacerts -file

send that csr to generate your ssl file then download x509 certificate from geotrust

then move the certificate to /root



download x509 format

and save first server certificate as root.crt

save last intermediate.crt and transfer all files to your ftp

then copy them to domain folder


keytool -import -alias intermediate -keystore keystore.jks -trustcacerts -file intermediate.crt

keytool -import -alias root -keystore keystore.jks -trustcacerts -file

keytool -import -alias yourdomain -keystore keystore.jks -trustcacerts -file

then nano domain.xml

here change all s1as as your domain name and fire  up your server

export key file

keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias jkskeyalias  -deststorepass password -destkeypass password

openssl pkcs12 -in keystore.p12  -nokeys -out cert.pem
openssl pkcs12 -in keystore.p12  -nodes -nocerts -out key.pem
convert pem to key
openssl rsa -outform der -in private.pem -out private.key

then move the key file to /root for security

edit /etc/httpd/conf.d/ssl.conf below

<VirtualHost _default_:443>

SSLProxyEngine on
ProxyPreserveHost On
ProxyPass / https://localhost:8181/
ProxyPassReverse / https://localhost:8181/

SSLEngine on

SSLCertificateFile /root/X509CERTIFICATE FROM GEOTRUST.crt

SSLCertificateKeyFile /root/private.key(EXPORTED FROM KEYTOOL)




if you only want https when http request is received then do the following in /etc/httpd/conf/httpd.conf

<VirtualHost *:80>
   ServerName <span class="highlight"></span>
   Redirect permanent /

add firewall

<tt class="COMMAND">iptables -A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT</tt>
<tt class="COMMAND">iptables -A OUTPUT -p tcp -m tcp --dport 433 -j ACCEPT 

service iptables save

service iptables restart</tt>
<tt class="COMMAND"></tt>

Apache Mod_proxy to forward http traffic to Java App server 8080

Reading Time: < 1 minute

In my vps server I wanted to forward http port 80 to glassfish 8080 ports without having glassfish config changed. So I assume httpd apache server is installed. So

cd /etc/httpd/conf

nano httpd.conf

Add the below lines and save and restart apache

<VirtualHost *:80>
# Your domain name
ServerName Domain_NAME_HERE

ProxyPreserveHost On

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

# The location of the HTML files, and access control information
DocumentRoot /var/www
<Directory /var/www>
Options -Indexes
Order allow,deny
Allow from all





Installing Wildfly 8 on Centos

Reading Time: 2 minutes

I’ll show you how to set up Wildfly 8 server for standalone not for the domain mode

download the package and unzip

cd /opt
unzip -d /opt/

rename the unzipped folder

mv wildfly-8.2.0.Final wildfly

create the wildfly user

groupadd wildfly
useradd -s /bin/bash -g wildfly wildfly

then prepare the config file path

mkdir -p /var/log/wildfly

change the ownership of folders

chown -R wildfly /opt/wildfly
chown -R wildfly /var/log/wildfly

then copy the conf folder

cp /opt/wildfly/bin/init.d/wildfly.conf /etc/default/wildfly

then edit it

nano /etc/default/wildfly

then find the below lines comment out and change

# General configuration for the init.d scripts,
# not necessarily for JBoss AS itself.
# default location: /etc/default/wildfly

## Location of JDK

## Location of WildFly

## The username who should own the process.

## The mode WildFly should start, standalone or domain

## Configuration for standalone mode

## Configuration for domain mode

## The amount of time to wait for startup

## The amount of time to wait for shutdown

## Location to keep the console log

then copy the init script

cp /opt/wildfly/bin/init.d/ /etc/init.d/wildfly

then add the script to chkconfig and launch it

chkconfig --add wildfly
chkconfig wildfly on

then now we need to open the server to public. In its default settings external sources are disallowed to browse through the app server

nano /opt/wildfly/standalone/configuration/standalone.xml

change these lines

<interface name="management">
<inet-address value="${}"/>
<interface name="public">
<inet-address value="${jboss.bind.address:}"/>
<!-- TODO - only show this if the jacorb subsystem is added  -->
<interface name="unsecure">
~  Used for IIOP sockets in the standard configuration.
~                  To secure JacORB you need to setup SSL
<inet-address value="${jboss.bind.address.unsecure:}"/>

to these

<interface name="management">
<inet-address value="${}"/>
<interface name="public">
<inet-address value="${jboss.bind.address:}"/>
<!-- TODO - only show this if the jacorb subsystem is added  -->
<interface name="unsecure">
~  Used for IIOP sockets in the standard configuration.
~                  To secure JacORB you need to setup SSL
<inet-address value="${jboss.bind.address.unsecure:}"/>

then start the server

[root@centos configuration]# /etc/init.d/wildfly start
Starting wildfly:                                          [  OK  ]

then now we will need management users



Installing Jdk 7 on Centos

Reading Time: < 1 minute

download jdk on console

cd /opt
sudo wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" \

then unpack

tar zxvf jdk-7u75-linux-x64.tar.gz

then create folder

mkdir /usr/java

then move

mv jdk1.7.0_75/ /usr/java/

install java

alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_75/bin/java 1

install javac

alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_75/bin/javac 1

install jar

alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_75/bin/jar 1

install javaws

alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_75/bin/javaws 1

test the installation

[root@host-50-244-171-31 opt]# java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

[root@host-50-244-171-31 opt]# javac -version
javac 1.7.0_75

then set java home

sh -c "echo export JAVA_HOME=/usr/java/jdk1.7.0_75 >> /etc/environment"

issue the command

source /etc/environment


[root@host-50-244-171-31 opt]# echo $JAVA_HOME

this package is needed for javaws

yum -y install libX11-devel.x86_64

test javaws

[root@host-50-244-171-31 opt]# javaws -version
Java(TM) Web Start