July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

July 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Output from rpm -qa, how to extract only the name of the package?

Output from rpm -qa, how to extract only the name of the package?

If you need to migrate to a new computer and want to install the same packages that were on your old computer on the new one, the following pipes all the packages into a list that you can then use to install on the new computer.

rpm -qa –qf “%{NAME}\n” > filelist.txt

Then to install the packages

yum -y install `cat filelist.txt`
or
yum -y install $(cat filelist.txt)

Using the Apache HTTP Server (mod_proxy) as a reverse proxy to a WebLogic Server

get WebLogic working with Apache as reverse proxy (mod_proxy)

There is Oracle Reports running on a WebLogic Server. I want it to run on https but for some reason I don’t know it wasn’t working for the Internet Explorer 11 (and maybe other versions too). IE11 just timed out and never displayed any html nor could be establish a connection. It worked with Chrome and Firefox.
As a fast workaround I thought, lets install a Apache and make the ssl stuff there and proxy it to the WebLogic http listening address. Both WebLogic and Apache are on the same machine, so no problem with using the http port.

With the usual Apache config for mod_proxy:


ProxyPass /reports http://somedomain.tld:7002/reports
ProxyPassReverse /reports http://somedomain.tld:7002/reports

Those lines weren’t enough because I could still see links to http://somedomain.tld:7002/reports* embedded within the html code.
With enabling additional options and rewriting html I thought it could be managed:

SetOutputFilter proxy-html
ProxyHTMLEnable On
ProxyHTMLExtended On
ProxyHTMLURLMap http://somedomain.tld:7002/reports https://somedomain.tld/reports
Most of the links worked now but there were still pages not displaying correctly. Those pages just had

<html>
<head>
<base href=”https://somedomain.tld/reports/rwservlet/getfile/HW-NW8428FX-mIL4832KDA-==/0jsdfUjid.htm”>
</head></html>

in it.
Without the Apache proxy it was something like:

<html>
<head>
<base href=”http://somedomain.tld:7002/reports/rwservlet/getfile/HW-NW8428FX-mIL4832KDA-==/0jsdfUjid.htm”>
</head></html>

<html>

whole page content

</html>
After googling I finally found a solution… Simple tell WebLogic that there is a proxy in front of it ????
In short:

enable „WebLogic Plug-In Enabled“ in Domain Structure > Environment > Servers > managed01 > Configuration General > Advanced
write in your hostname in „Frontend Host:“ and set your https port in „Frontend HTTPS Port:“ Domain Structure > Environment > Servers > managed01 > Protocols > HTTP
save changes and restart WebLogic
set an additional header within your Apache config:

RequestHeader set WL-Proxy-SSL true
restart Apache
it should work now ????

If you are using a WebLogic Cluster you need a proxy in front of the cluster to provide load balancing. You need either a hardware load balancer or a Web Server with the Oracle Web server plug-in.

Even if you are not using a Cluster it makes sense to place a proxy in front of your WebLogic server to provide an extra layer of security. You can use the Apache HTTP Server with the mod_proxy module to configure a reverse proxy.

You can of cause also use the Oracle Web server plug-in but it is a proprietary module that you have to manually download and install. mod_proxy is open source and since I mostly work with Red Hat servers it is available in the standard Red Hat channel. Red Hat provide security updates so “all” you have to do is run yum update once in a while to get the latest updates. If you use the Oracle Web server plug-in you have to manually check for updates.

I often you use a solution where an Apache HTTP Server is placed in a DMZ network segment. SSL is terminated at the Apache server and mod_proxy is used to proxy requests to an WebLogic Server in the production network segment.
mod_proxy01

In this example we have an Internet domain called theheat.dk. The public IP 217.116.232.220 is NATed to 10.10.10.1 on winterfell.

Apache has already been installed on winterfell, the mod_proxy module loaded, SSL configured and WebLogic is running on wintermute.

In your VirtualHost in the ssl.conf (httpd-ssl.conf on Windows) file you can add something like this:

ProxyPass / http://10.10.10.10:8001/
ProxyPassReverse / http://10.10.10.10:8001/
The ProxyPass and ProxyPassReverse directives are used to forward all requests to the WebLogic Server running on 10.10.10.10.

Another example:

ProxyPass /service/ws1 http://10.10.10.10:8001/ws1_v101
ProxyPassReverse /service/ws1 http://10.10.10.10:8001/ws1_v101

ProxyPass /service/ws2 http://10.10.10.10:8001/ws2_v300
ProxyPassReverse /service/ws2 http://10.10.10.10:8001/ws2_v300
Here only requests matching two specific paths are forwarded to two Web Services.

If you need more control over what is proxied you can use the ProxyPassMatch directive.

If you want to prevent a path from being proxied you can use the ! directive.

Configure the WebLogic Server to use a proxy

The above will proxy the requests to the WebLogic Server.

In some situations it will not work though. The WebLogic Server does not know that there is a proxy in front of it and sometimes it will return URLs to the end-user that contains the server name. In this example it will return URLs that contain wintermute. Since wintermute is not known on the Internet it will fail.

I have experienced this when an ADF application session timeout and asks the user to log in again. The URL returned to the user is wrong.

Another example is the WSDL for a Web Service. The location of the end-point and references to XML schemas will use the host name.

To remedy this you can configure WebLogic so I knows that there is a proxy in front of it. WebLogic will use this information and dynamically change the references, so they uses the proxy information.

First you must enable the WebLogic Plug-In. We are not using the WebLogic Plug-In but we still need to enable it here.

Domain Structure > Environment > Servers > managed01 > Configuration General > Advanced:
Next you must insert the proxy and port.

Domain Structure > Environment > Servers > managed01 > Protocols > HTTP:

mod_proxy02

mod_proxy03

The little yellow triangles with the exclamation mark tell us that we need to restart the WebLogic server for the changes to take effect.

But it will still not work. We have told WebLogic what the frontend HTTPS host and port is, but we have terminated SSL at the Apache proxy and uses HTTP between Apache and WebLogic.
We need to tell WebLogic that the proxy was originally called with HTTPS.

We do this by inserting an tag in the HTTP header in the Apache configuration:

RequestHeader set WL-Proxy-SSL true
ProxyPass / http://10.10.10.10:8001/
ProxyPassReverse / http://10.10.10.10:8001/
Now everything should be working.

If you are using a cluster you should set Frontend Host and Frontend HTTPS Port for the cluster not the individual Managed Server. For more information:
http://goo.gl/k0jUe

ProxyPreserveHost

In some situations you need to access your application from both the Internet and from an internal network segment using the internal server names.

To accomplish this you need to change the Apache configuration:

ProxyPreserveHost On
RequestHeader set WL-Proxy-SSL true
ProxyPass / http://10.10.10.10:8001/
ProxyPassReverse / http://10.10.10.10:8001/
Setting “ProxyPreserveHost On” will tell Apache to pass the host used in the request to the WebLogic Server.

You also need to remove the Frontend HTTPS Host from you WebLogic Server or Cluster.

Now I can access a Web Service via both:
https://theheat.dk/service/ws1?WSDL
And:
https://winterfell/service/ws1?WSDL

The WSDL will either contain reference to theheat.dk or winterfell depending of which URL I use to access the WSDL with.

Apache HTTP Server Plugin configuration to Weblogic 11g (10.3.5)

Apache HTTP Server Plugin configuration to Weblogic 11g (10.3.5)

1. Install Apache HTTP server (Version 2.2.29).

Note – Installation might need ‘root’

Here is the Apache reference doc for Installation (http://httpd.apache.org/docs/2.2/install.html)

Download required version of Apache software distribution from nearest mirror site (Mirror I used)

http://mirrors.sonic.net/apache/httpd/httpd-2.2.29.tar.gz

2. Configure

./configure –prefix=/opt/apache2.x –with-ldap –enable-mods-shared=”all ssl ldap cache proxy authn_alias mem_cache file_cache authnz_ldap charset_lite dav_lock disk_cache isapi suexec” –enable-rewrite=shared –enable-mime-magic –enable-info –enable-speling –enable-usertrack –enable-example –enable-maintainer-mode

3. make

4. make install

Note – When we re-run the Apache installation with updated modules, sometimes you may run into libtool error

Error :

libtool: install: error: cannot install `libaprutil-1.la’ to a directory not
ending in /usr/local/apache2/lib
Solution : run below command before ‘make install’

make clean

Issue#2 : you may run into below error while starting Apache instance after loaded weblogic shared Object files:

[root@NA9F2RFV1 bin]# ./apachectl -k start

httpd: Syntax error on line 126 of /opt/thirdparty/Middleware/apache2.x/conf/httpd.conf: Cannot load /opt/thirdparty/Middleware/apache2.x/modules/mod_wl_22.so into server: libstdc++.so.5: cannot open shared object file: No such file or directory
[root@NA9F2RFV1 bin]# yum install libstdc++.sh.5

Solution :

Run below Command to install dependent libraries.

sudo yum install compat-libstdc++-33.x86_64

>Installing : compat-libstdc++-33-3.2.3-69.el6.x86_64 1/1
>Verifying : compat-libstdc++-33-3.2.3-69.el6.x86_64 1/1

>Installed:
>compat-libstdc++-33.x86_64 0:3.2.3-69.el6

Issue 3:

you may see below error while restart Apache.

[root@NA9F2RFV1 bin]# ./apachectl -k stop
httpd: Could not reliably determine the server’s fully qualified domain name, using NA9F2RFV1.localdomain for ServerName

Solution :

you need to add ‘hostname’ to /etc/hosts file

127.0.0.1 NA9F2RFV1.localdomain localhost localhost4 localhost4.localdomain4
::1 NA9F2RFV1.localdomain localhost localhost6 localhost6.localdomain6

5. vi $APACHE_HOME/conf/httpd.conf

a) Load weblogic module

copy shared object file into $Apache_Home/modules directory. choose the correct .so file based on the Apache version and OS (32 bit/64 bit)

you can copy these .so files from weblogic distribution ($WLS_HOME/wlserver_10.3/server/plugin/)

LoadModule weblogic_module modules/mod_wl_22.so

6. Define IF module for Weblogic

WebLogicHost 192.168.56.101
WebLogicPort 7001
MatchExpression /console
MatchExpression *.jsp
MatchExpression *.html
ConnectTimeoutSecs 10
ConnectRetrySecs 2
WLIOTimeoutSecs 300
Idempotent ON
KeepAliveEnabled ON
#WLProxySSL ON/OFF ( ON for opening apache to access SSL – via Https)
Debug ALL
WLLogFile /opt/apache2.x/logs/wl-proxy.log

Configure SSL for Apache

How To Install Apache 2 with SSL on Linux (with mod_ssl, openssl)

How To Generate SSL Key, CSR and Self Signed Certificate For Apache

Note – After you generate certs and configure Apache to access over https, you may see below issue in browser.

*******************************
Bad Request

Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
*******************************

To have HTTP (non-ssl working) between apache plugin and weblogic, you need to enable this option

“WebLogic Plug-In Enabled” using weblogic console under Servers > AdminServer > General > Advanced.

Configure SSL between Apache and Weblogic11g (Using Trusted CA)

Web Logic Server Configuration

1. Generate a private key

jdk_home\bin\keytool -genkey -alias -keyalg RSA -keystore

Example:

/opt/thirdparty/Middleware/Oracle/jdk1.6.0_24/bin/keytool -genkey -alias sslcert -keyalg RSA -keysize 2048 -keystore mykeystore.jks
Note – use key size 2048, Sometimes it may complain based on new cryptography rules.

2. Generate a certificate request (CSR file).

jdk_home\bin\keytool -certreq -keyalg RSA -alias -file certreq.csr -keystore

Example:

/opt/thirdparty/Middleware/Oracle/jdk1.6.0_24/bin/keytool -certreq -keyalg RSA -alias sslcert -file certreq.csr -keystore mykeystore.jks
3. Get CSR signed by trusted Authority (Verisign in this case)

Paste the csr file and get the trail certificate(save as public.pem) and intermediate CA (save as intermediate.pem) and Root CA (save as rootCA.pem) from the email sent from Verisign website( http://www.symantec.com/ssl-certificates/?inid=vrsn_symc_ssl_index&searchdomain=google.com&searchterms=

4. Import Certificates into keystores:

1. Import CA into keystore:

keytool -import -alias verisignCA -file CA.pem -keystore -trustcacerts

Example:

/opt/thirdparty/Middleware/Oracle/jdk1.6.0_24/bin/keytool -import -alias rootCA -file rootCA.pem -keystore mykeystore.jks –trustcacerts

2. Import intermediate CA into keystore:

keytool -import -alias verisignIntermediateCA -file Intermediate.pem -keystore -trustcacerts

Example:

/opt/thirdparty/Middleware/Oracle/jdk1.6.0_24/bin/keytool -import -alias intermediateCA -file intermediateCA.pem -keystore mykeystore.jks –trustcacerts

3. Import the public key into your keystore. It will go on the same alias as the private key:

keytool -import -alias -file public.pem -keystore -trustcacerts

Example:

/opt/thirdparty/Middleware/Oracle/jdk1.6.0_24/bin/keytool -import -alias localhost -file public.pem -keystore mykeystore.jks –trustcacerts

4. To view the keystore:

keytool -list -keystore mykeystore.jks -v

5. keystore configuration in weblogic console.

From the Admin console, go to your server page, and in the Keystore & SSL tab choose:

Custom Identity and Custom Trust

Custom Identity
Custom Identity Key Store File Name: ( Ex –/opt/thirdparty/Middleware/Oracle/certs/myKeystore.jks)

Custom Identity Key Store Type: jks
Custom Identity Key Store Pass Phrase:
Confirm Custom Identity Key Store Pass Phrase:

Custom Trust
Custom Trust Key Store File Name: ( Ex –/opt/thirdparty/Middleware/Oracle/certs/myKeystore.jks)

Custom Trust Key Store Type: jks

Custom Trust Key Store Pass Phrase:
Confirm Custom Trust Key Store Pass Phrase:

Go to SSL TAB :

Private Key Alias:
Passphrase: password
Confirm Passphrase: password

Restart your server and now try https://localhost:7002/console
You should see the following while server starts up:


WebLogicHost 192.168.56.101
WebLogicPort 7002 (SSL Port)
MatchExpression /console
MatchExpression *.jsp
MatchExpression *.html
ConnectTimeoutSecs 10
ConnectRetrySecs 2
WLIOTimeoutSecs 300
Idempotent OFF
KeepAliveEnabled ON
#WLProxySSL ON/OFF ( ON for opening apache to access SSL – via Https)
SecureProxy ON
TrustedCAFile /opt/thirdparty/Middleware/Oracle/certs/MyWeblogicCAToTrust.pem
RequireSSLHostMatch false
EnforceBasicConstraints OFF
WLProxySSL ON
Debug ALL
WLLogFile logs/wlproxy.log

Error

You might notice below error in Apache error log while accessing https: apache url

[Wed Dec 10 13:55:26 2014] [error] [client 192.168.56.1] ap_proxy: trying GET /console at backend host ‘192.168.56.101/7002; got exception ‘WRITE_ERROR_TO_SERVER [os error=0, line 806 of ../nsapi/URL.cpp]: ‘

Solution :

Convert this .crt into .pem

openssl x509 -inform der -in MyWeblogicCAToTrust.cer -out MyWeblogicCAToTrust.pem
Note : Import the CA.pem for apache and weblogic in the browser using content-> certificate-> Import-> Autoselect store based on type of cert- option.

Configuration Complete!!

Apache-Weblogic SSL

Weblogic cannot open shared object file: No such file or directory

Cannot load /u01/wls_plugin/lib/mod_wl_24.so into server: libopmnsecure.so: cannot open shared object file: No such file or directory

I’ve configured weblogic proxy plugin 12c for linux according to documentation but I run into “Cannot load /u01/wls_plugin/lib/mod_wl_24.so into server: libopmnsecure.so: cannot open shared object file: No such file or directory”

The error:

[root@localhost ~]# apachectl restart
Job for httpd.service failed. See ‘systemctl status httpd.service’ and ‘journalctl -xn’ for details.

My settings:

[root@localhost ~]# vi /etc/httpd/conf.d/whatever.conf
LoadModule weblogic_module /u01/wls_plugin/lib/mod_wl_24.so

WLSRequest On
SetHandler weblogic-handler
PathTrim /whatever
PathPrepend /whatever
WebLogicHost 192.168.1.10
WebLogicPort 7001

LD_LIBRARY_PATH=/u01/wls_plugin/lib

This solution worked for me:

[root@localhost ~]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/u01/wls_plugin/lib

[root@localhost ~]# ldconfig

[root@localhost ~]# apachectl restart

Configure Apache with multiple weblogic server instances

Configure Apache with multiple weblogic server instances
I came across a unique situation at work where I needed to configure Apache web server to forward requests to multiple weblogic server instances running on same box but different port numbers. Here is the scenario:

Instance A – http://test_server:7001/App1(Domain I)
Instance B – http://test_server:7003/App2 (Domain II)
Instance C – http://test_server:7005/App3 (Domain III)

I have App1 deployed on instance1 which is running in domain I. Similarly App2 deployed on instance 2, app3 deployed on instance 3. Needless to say all domains running in different ports(non-clustered environment).

Now I would like to configure my Apache to forward request to respective URLs based on what do they type in the URL.

If they type http://test_server/App1 should go to instance A.
If they type http://test_server/App2 should go to instance B.
If they type http://test_server/App3 should go to instance C.

When I use tag with location combination it did not work for me. But when I use tag for each app/instance in httpd.conf, it worked. Hope this information helps.

#### for Instance 1/App1

SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7001
WLCookieName cookie1
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log

#### for Instance2/App2


SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7003
WLCookieName cookie2
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log

#### for Instance3/App3

SetHandler weblogic-handler
WebLogicHost test_server
WebLogicPort 7005
WLCookieName cookie3
DynamicServerList OFF
MaxPostSize 2048
Debug ALL
WLLogFile logs/httpd_proxy1.log

CENTOS 7.2 TEXT TO GUI

[root@clusterserver1 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.usonyx.net
* epel: mirror.wanxp.id
* extras: centos.usonyx.net
* updates: centos.usonyx.net
repo id repo name status
!base/7/x86_64 CentOS-7 – Base 9,007
!epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 10,304
!extras/7/x86_64 CentOS-7 – Extras 356
!updates/7/x86_64 CentOS-7 – Updates 2,002
repolist: 21,669
[root@clusterserver1 ~]#

[root@clusterserver1 ~]# yum group list
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
* base: centos.usonyx.net
* epel: mirror.wanxp.id
* extras: centos.usonyx.net
* updates: centos.usonyx.net
Available Environment Groups:
Minimal Install
Compute Node
Infrastructure Server
File and Print Server
MATE Desktop
Basic Web Server
Virtualization Host
Server with GUI
GNOME Desktop
KDE Plasma Workspaces
Development and Creative Workstation
Available Groups:
CIFS file server
Compatibility libraries
Console internet tools
Desktop
Desktop Platform
Desktop Platform Development
Development Tools
Eclipse
Educational Software
Electronic Lab
FCoE Storage Client
Fedora Packager
General Purpose Desktop
Graphical Administration Tools
Haskell
Legacy UNIX compatibility
Messaging Client Support
Messaging Server Support
Milkymist
MySQL Database client
MySQL Database server
NFS file server
Network Storage Server
SNMP Support
Scientific support
Security Tools
Server Platform
Server Platform Development
Smart card support
Storage Availability Tools
System Management
System administration tools
TeX support
TurboGears application framework
Virtualisation
Web-Based Enterprise Management
Xfce
iSCSI Storage Client
Done
[root@clusterserver1 ~]#yum group install “Server with GUI”

vim-filesystem x86_64 2:7.4.160-1.el7 base 9.6 k
vte-profile x86_64 0.38.3-2.el7 base 5.9 k
vte291 x86_64 0.38.3-2.el7 base 311 k
wavpack x86_64 4.60.1-9.el7 base 131 k
webkitgtk3 x86_64 2.4.9-5.el7 base 11 M
webrtc-audio-processing x86_64 0.1-5.el7 base 108 k
xcb-util x86_64 0.4.0-2.el7 base 16 k
xdg-user-dirs x86_64 0.15-4.el7 base 59 k
xdg-utils noarch 1.1.0-0.16.20120809git.el7 base 70 k
xkeyboard-config noarch 2.14-1.el7 base 758 k
xml-common noarch 0.6.3-39.el7 base 26 k
xmlrpc-c x86_64 1.32.5-1905.svn2451.el7 base 130 k
xmlrpc-c-client x86_64 1.32.5-1905.svn2451.el7 base 32 k
xorg-x11-drv-ati x86_64 7.5.0-3.el7 base 134 k
xorg-x11-drv-dummy x86_64 0.3.6-21.el7 base 16 k
xorg-x11-drv-evdev x86_64 2.9.2-2.el7 base 46 k
xorg-x11-drv-fbdev x86_64 0.4.3-20.el7 base 20 k
xorg-x11-drv-intel x86_64 2.99.917-8.20150615.el7 base 650 k
xorg-x11-drv-nouveau x86_64 1:1.0.11-2.el7 base 101 k
xorg-x11-drv-qxl x86_64 0.1.1-18.el7 base 91 k
xorg-x11-drv-synaptics x86_64 1.8.2-1.el7 base 82 k
xorg-x11-drv-v4l x86_64 0.2.0-42.el7 base 20 k
xorg-x11-drv-vesa x86_64 2.3.2-20.el7 base 24 k
xorg-x11-drv-vmmouse x86_64 13.0.0-11.el7 base 22 k
xorg-x11-drv-vmware x86_64 13.0.2-7.20150211git8f0cf7c.el7 base 78 k
xorg-x11-drv-void x86_64 1.4.1-1.el7 base 14 k
xorg-x11-drv-wacom x86_64 0.29.0-1.el7 base 293 k
xorg-x11-font-utils x86_64 1:7.5-20.el7 base 87 k
xorg-x11-fonts-Type1 noarch 7.5-9.el7 base 521 k
xorg-x11-server-common x86_64 1.17.2-10.el7 base 50 k
xorg-x11-server-utils x86_64 7.7-14.el7 base 176 k
xorg-x11-xkb-utils x86_64 7.7-12.el7 base 103 k
yajl x86_64 2.0.4-4.el7 base 39 k
yelp-libs x86_64 1:3.14.2-1.el7 base 89 k
yelp-xsl noarch 3.14.0-1.el7 base 270 k
zenity x86_64 3.8.0-5.el7 base 3.4 M

Transaction Summary
=================================================================================================================================================================================================
Install 265 Packages (+671 Dependent packages)

Total download size: 692 M
Installed size: 2.0 G
Is this ok [y/d/N]: Y

Next step is to change boot mode to graphical using graphical.target

# systemctl set-default graphical.target

CentOS 6.8 to compile and install LNMP

CentOS 6.8?nginx 1.9.14?mysql 5.6.23?php 5.6.17

service iptables stop
chkconfig iptables off
setenforce 0

vi /etc/sysconfig/selinux
SELINUX=disabled

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel openldap-clients openldap-servers make libtool* git tree bison pcre-devel perl gd gd-devel

mkdir software
cd software

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar xf libiconv-1.14.tar.gz
cd libiconv-1.14/
./configure –prefix=/usr/local
make && make install

wget http://heanet.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
tar -zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make && make install

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1468310750&use_mirror=freefr

tar xf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make && make install
cd libltdl/
./configure –enable-ltdl-install
make && make install

wget http://pkgs.fedoraproject.org/repo/pkgs/mcrypt/mcrypt-2.6.8.tar.gz/md5/97639f8821b10f80943fa17da302607e/mcrypt-2.6.8.tar.gz
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
./configure
make && make install

ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config

wget https://cmake.org/files/v3.6/cmake-3.6.0.tar.gz
tar xf cmake-3.6.0.tar.gz
cd cmake-3.6.0
./bootstrap
make && make install

wget http://pkgs.fedoraproject.org/repo/pkgs/community-mysql/mysql-5.6.30.tar.gz/md5/ac8ba1db4454d2c144c7d892185a9328/mysql-5.6.30.tar.gz

tar -xf mysql-5.6.30.tar.gz
groupadd -r mysql
useradd -r -g mysql mysql

mkdir -p /usr/local/mysql
mkdir -p /data/mysqldb

cd mysql-5.6.30
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1-DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1-DSYSCONFDIR=/etc -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0
make&& make install

cd /usr/local/mysql
chown -R mysql:mysql .
cd /data/mysqldb
chown -R mysql:mysql .

vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

# CLIENT #
port =3306
socket =/data/mysqldb/mysql.sock

[mysqld]

# GENERAL #
user =mysql
default-storage-engine =InnoDB
socket =/data/mysqldb/mysql.sock
pid-file =/data/mysqldb/mysql.pid

# MyISAM #
key-buffer-size =32M
myisam-recover =FORCE,BACKUP

# SAFETY #
max-allowed-packet =16M
max-connect-errors =1000000

# DATA STORAGE #
datadir =/data/mysqldb/

# BINARY LOGGING #
log-bin =/data/mysqldb/mysql-bin
expire-logs-days =14
sync-binlog =1

# REPLICATION #
skip-slave-start =1
relay-log =/data/mysqldb/relay-bin
slave-net-timeout =60

# CACHES AND LIMITS #
tmp-table-size =32M
max-heap-table-size =32M
query-cache-type =0
query-cache-size =0
max-connections =500
thread-cache-size =50
open-files-limit =65535
table-definition-cache =4096
table-open-cache =4096

# INNODB #
innodb-flush-method =O_DIRECT
innodb-log-files-in-group =2
innodb-log-file-size =64M
innodb-flush-log-at-trx-commit =1
innodb-file-per-table =1
innodb-buffer-pool-size =592M

# LOGGING #
log-error =/data/mysqldb/mysql-error.log
log-queries-not-using-indexes =1
slow-query-log =1
slow-query-log-file =/data/mysqldb/mysql-slow.log

cp support-files/mysql.server /etc/init.d/mysqld
service mysqld start
chkconfig mysqld on

drop user ”@localhost;
drop user ”@hostname;
update mysql.user set password=password(‘*******’);
flush privileges;

wget http://nginx.org/download/nginx-1.9.14.tar.gz

groupadd -r nginx
useradd -g nginx -r nginx

mkdir -pv /var/tmp/nginx/client

nginx
tar xf nginx-1.9.14.tar.gz
cd nginx-1.9.14
./configure –prefix=/usr/local/nginx –sbin-path=/usr/local/nginx/sbin/nginx –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-log-path=/var/log/nginx/access.log –pid-path=/var/run/nginx/nginx.pid –lock-path=/var/lock/nginx.lock –user=nginx –group=nginx –with-http_ssl_module –with-http_flv_module –with-http_stub_status_module –with-http_gzip_static_module –http-client-body-temp-path=/var/tmp/nginx/client/ –http-proxy-temp-path=/var/tmp/nginx/proxy/ –http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ –http-uwsgi-temp-path=/var/tmp/nginx/uwsgi –http-scgi-temp-path=/var/tmp/nginx/scgi –with-pcre
make && make install

vim /etc/rc.d/init.d/nginx

#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: – 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ “$NETWORKING” = “no” ] && exit 0

nginx=”/usr/local/nginx/sbin/nginx”
prog=$(basename $nginx)

NGINX_CONF_FILE=”/etc/nginx/nginx.conf”

[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx

lockfile=/var/lock/subsys/nginx

make_dirs() {
# make required directories
user=`nginx -V 2>&1 | grep “configure arguments:” | sed ‘s/[^*]*–user=\([^ ]*\).*/\1/g’ -`
options=`$nginx -V 2>&1 | grep ‘configure arguments:’`
for opt in $options; do
if [ `echo $opt | grep ‘.*-temp-path’` ]; then
value=`echo $opt | cut -d “=” -f 2`
if [ ! -d “$value” ]; then
# echo “creating” $value
mkdir -p $value && chown -R $user $value
fi
fi
done
}

start() {
[ -x $nginx ] || exit 5
[ -f $NGINX_CONF_FILE ] || exit 6
make_dirs
echo -n $”Starting $prog: ”
daemon $nginx -c $NGINX_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}

stop() {
echo -n $”Stopping $prog: ”
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}

restart() {
configtest || return $?
stop
sleep 1
start
}

reload() {
configtest || return $?
echo -n $”Reloading $prog: ”
killproc $nginx -HUP
RETVAL=$?
echo
}

force_reload() {
restart
}

configtest() {
$nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
status $prog
}

rh_status_q() {
rh_status >/dev/null 2>&1
}

case “$1″ in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $”Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}”
exit 2
esac

chmod +x /etc/rc.d/init.d/nginx
chkconfig –add nginx
chkconfig nginx on
service nginx start

?PHP
p

cp -frp /usr/lib64/libldap* /usr/lib/
echo /usr/local/mysql/lib >> /etc/ld.so.conf.d/mysql-x86_64.conf
ldconfig -v

php
tar xf php-5.6.17.tar.gz
cd php-5.6.17
./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-iconv-dir=/usr/local –with-openssl –enable-mbstring –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –enable-mbregex –enable-mbstring –with-gd –enable-gd-native-ttf –with-mhash –enable-pcntl –enable-sockets –with-mcrypt –with-ldap –with-ldap-sasl–with-xmlrpc –enable-zip –enable-soap –with-bz2 –with-config-file-path=/etc –enable-fpm –with-config-file-scan-dir=/etc/php.d –enable-maintainer-zts
make ZEND_EXTRA_LIBS=’-liconv’
make install

PHP
cp php.ini-production /etc/php.ini

php-fpm
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

php-fpm
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
chmod +x /etc/rc.d/init.d/php-fpm
chkconfig –add php-fpm
chkconfig php-fpm on
service php-fpm start

web
nginx,php
vim /etc/nginx/nginx.conf
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
#???
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

LNMP

vim /usr/local/nginx/html/test.php

nginx
service nginx reload

http://ip/test.php,LNMP

Redis test

$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test]

rpm -qa | grep tcl

yum install tcl

How to enable SSH Root Login In Solaris 11

Permit SSH Login for Root in Oracle Solaris 11

Open Terminal window and switch to root user.

1. Change the file /etc/ssh/sshd_config PermitRootLogin yes with PermitRootLogin no and save file.

vi /etc/ssh/sshd_config

PermitRootLogin yes

2. Comment out the “CONSOLE=/dev/console” line in /etc/default/login.

vi /etc/default/login

#CONSOLE=/dev/console

3.Remove “;type=role” from the root entry in /etc/user_attr or use the below command.

rolemod -K type=normal root

4. Restart the Services.

#svcadm restart svc:/network/ssh:default

5.Try SSH connection using root user You should be able to connect.

So you’ve got a fresh installed Solaris 11 box – and you can’t login directly as root because it is a role…

db04 console login: root
Password:
Roles can not login directly

To change this, then you need to make root a user instead of being a role

Login as an administrator account and su to root
melam@sscadb04:~$ su – root
Password:
Jan 25 13:27:29 sscadb04 su: ‘su root’ succeeded for melam on /dev/console
Oracle Corporation SunOS 5.11 11.0 September 2012

As you can see in the configuration file root is a role
root@db04:~# cat /etc/user_attr
#
# The system provided entries are stored in different files
# under “/etc/user_attr.d”. They should not be copied to this file.
#
# Only local changes should be stored in this file.
# This line should be kept in this file or it will be overwritten.
#
root::::type=role
melam::::type=normal;lock_after_retries=no;profiles=System Administrator;roles=root

To change it

root@db04:~# rolemod -K type=normal root

swapon: swapfile: swapon failed: Invalid argument

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile

swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument

echo “/swapfile swap swap sw 0 0” >> /etc/fstab
echo “vm.swappiness = 10” >>/etc/sysctl.conf
echo “vm.vfs_cache_pressure = 50” >> /etc/sysctl.conf

The problem with fallocate(1) is that it uses filesystem ioctls to make the allocation fast and effective, the disadvantage is that it does not physically allocate the space but swapon(2) syscall requires a real space. Reference : https://bugzilla.redhat.com/show_bug.cgi?id=1129205

I had faced this issue earlier with my box too. So instead of using fallocate, I had used dd as per the link suggests
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB