Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

31 May 2015

How to Install | Compile | Configure Apache-http Server

Download the binnary from
at the time of writing this post 2.2.29 is most stable version of apache thus used in the example.

If you are using Linux you should download one which is in format of tar.gz like : httpd-2.2.29.tar.gz

extract it
$ tar -xzf httpd-2.2.29.tar.gz

$ rpm -qa | grep gcc
usually it will show this two packages

$ sudo yum install gcc

the above command will install which is much needed for apache to run on any linux machine


switch to your binnary directory and run following commands

$ ./configure -prefix=/setups/apache/http-2.2.29 (defining the installaition Location)
$ make (this command will compile the Apache)
$ make install (this command will configure the Apache)
$ cd /bin
$ ./apachectl -k start

access the url 


if everything goes well it will display

It works!

25 November 2014

Apache SSL Installation Instructions

Save the primary and intermediate certificates to a folder on the server with the private key.
Open the Apache configuration file in a text editor httpd.conf In most cases the <VirtualHost> blocks will be at the bottom of this httpd.conf file. Sometimes you will find the <VirtualHost> blocks in a separate file in a directory like /etc/httpd/vhosts.d/ or /etc/httpd/sites/ or in a file called ssl.conf

If you need your site to be accessible through both secure (https) and non-secure (http) connections, you will need a virtual host for each type of connection. Make a copy of the existing non-secure virtual host and change the port from port 80 to 443.

& add below lines as:

DocumentRoot "/var/www/htdocs"
SSLEngine on
SSLCertificateFile "/etc/ssl/crt/primary.crt"
SSLCertificateKeyFile "/etc/ssl/crt/private.key"
SSLCACertificateFile "/etc/ssl/crt/intermediate.crt"

2.      Change the names of the files and paths to match with your certificate files:
SSLCertificateFile should be your primary certificate file for your domain name.
SSLCertificateKeyFile should be the key file generated when you created the CSR.
SSLCertificateChainFile should be the intermediate certificate file (if any) that was supplied by your certificate authority
(The first directive tells Apache how to find the server certificate file, the second one where the private key is located, and the third line the location of the Trust CA Bundle.)

Save the changes and exit the text editor.
After making changes to your config file it is good practice to check the file for syntax errors using apachectl configtest. The command will return Syntax OK if there are no errors.
Restart your Apache web server using one of the following commands:

/bin/apachectl startssl
or /bin/apachectl restart
Note: make sure to un comment from httpd.conf

Additionally you can generate your apache self signed certificate

Once you have OpenSSL installed, just run this one command to create an Apache self signed certificate:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mysitename.key -out mysitename.crt

You will be prompted to enter your organizational information and a common name. The common name should be the fully qualified domain name for the site you are securing ( You can leave the email address, challenge password, and optional company name blank. 
When the command is finished running, it will create two files: 
mysitename.crt self signed certificate file which is valid for 365 days.


08 June 2014

NO_RESOURCES Errors in APACHE when WLS at Backend

At times you will see, apache throws no resources error when you have weblogic in backend.

a snippet of error as below:   

weblogic: *******Exception type [NO_RESOURCES] (apr_socket_connect call failed with error=70007, host=xx.xx.xx.xx, port=xxxx) raised at line xxxx of URL.cpp

[DATE TIME] [error] [client X.X.X.X] ap_proxy: trying POST /xxx/xxxx/xx at backend host 'X.X.X.X/xxxx; got exception 'NO_RESOURCES: [os error=115, line 1602 of URL.cpp]: apr_socket_connect call failed with error=70007, host=X.X.X.X, port=xxxx ', referer:

This usually occurs when WLS server is too busy to respond to the connect request from the WebLogic Proxy Plug-In.
This can be resolved by setting WLSocketTimeoutSecs to a higher value where the default value is 2. This allows the WebLogic Proxy Plug-In to wait longer for the connect request to be responded by the WLS server.

try adding below configuration in http.conf under the location tab of Virtual host:

ConnectTimeoutSecs 50 (default is 10)
ConnectRetrySecs 5 (default is 2)
WLSocketTimeoutSecs 10 (default is 2)
WLIOTimeoutSecs 1800 (default is 300)
Idempotent OFF (default is ON)

In weblogic nodes

domain --> environment --> servers --> click on the required server --> tuning--> Accept Backlog:  --> default value is 300. Made it 375.
restart weblogic nodes and apache , this should fix your no resource issue.