November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Enable PHP on Apache

After Yum install on php on centos or fedora

AddModule mod_php.c LoadModule php_module modules/mod_php.so LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php

And from PHP pages won’t load:

AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps

Apache mod_rewrite security rules for Web server harding

# Hardened Apache Mod_Rewrite Security Rule # Ref: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond # NC = ‘nocase|NC’ (no case-sensitive) # OR = ‘ornext|OR’ (or next condition) # L = last rule RewriteEngine on

# Allow only GET and POST verbs # ‘Coz most vul scanners use HEAD for hunting buggy files existence RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] # Ban Non-GUI […]

Apache logs

irst locate the log file for your site. The generic log is generally at /var/log/httpd/access_log or/var/log/apache2/access_log (depending on your distro). For virtualhost-specific logs, check the conf files or (if you have one active site and others in the background) run ls -alt /var/log/httpd to see which file is most recently updated.

cat access.log| awk ‘{print […]

Install the (ModSecurity) centos fedora redhat

Install the (ModSecurity)

cd /usr/local/src/

wget http://www.modsecurity.org/tarball/2.7.2/modsecurity-apache_2.7.2.tar.gz

tar -zxvf modsecurity-apache_2.7.2.tar.gz

cd modsecurity-apache_2.7.2

./configure

configure: *** pcre library not found.configure: error: pcre library is required

 

yum -y update pcre

additional package dependencies.yum -y install pcre-develyum -y install libxml2yum -y install libxml2-devel

mod_unique_id need to use mod_security

cd /software/httpd-2.24/modules/metadata

/Usr/local/apache2/bin/apxs -cia Mod_unique_id.C

cd /software/httpd-2.24/Srclib/apr./configuremakemake install

cd […]

Install phpMyAdmin on CentOs 6

Install phpMyAdmin on CentOs 6 and had interesting walkthrough of the installation

1. Get the latest copy of phpMyAdmin from sourceforge

wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.7/phpMyAdmin-3.5.7-english.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fphpmyadmin%2Ffiles%2FphpMyAdmin%2F3.5.7%2F&ts=1361966494&use_mirror=jaist

2. Extract the files

tar -zxvf phpMyAdmin-3.5.7-english.tar.gz

3. move the extracted files to proper location

mv phpMyAdmin-3.5.7-english.tar.gz /var/www/html/phpmyadmin

4. cd /var/www/html/phpmyadmin

5. Make a copy of configuration files

cp config.sample.inc.php config.inc.php

6. […]

Traffic Calcuation for Tomcat and Apache

How many users can we handle? How many requests/second can we handle? How much bandwidth is needed to handle so many users or requests/second? How do i calculate these figures? How many (an application) servers do i need to handle this traffic?

Lets begin with a small example to understand how we arrive at […]

Openssl Howto for Apache

 

Display Certificate Subject name in readable format

openssl x509 -in CERTIFICATE_FILE -noout -subject -nameopt multiline,-lname,-align

Top

To verify a certificate chain

openssl verify CERTIFICATE_FILE

 

The file CERTIFICATE_FILE contain the intermediate certificate first and the servers certificate.

Check your Certificate using the Certificate Check tool at the bottom of the page

Top

[…]

OpenSSL Commands to Convert SSL Certificates on Your Machine

Convert PEM to DER

openssl x509 -outform der -in certificate.pem -out certificate.der

Convert PEM to P7B

openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer

Convert PEM to PFX

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt

OpenSSL Convert DER

Convert DER to PEM

openssl x509 -inform der -in certificate.cer […]

Convert the PFX file for Apache

Run the following command using OPENSSL:

1. To export the Private key file from the .pfx fileopenssl pkcs12 -in filename.p12 -nocerts -out privatekey.key2. To export the Certificate file from the .pfx file openssl pkcs12 -in filename.p12 -clcerts -nokeys -out sslcert.crt

filename.p12 (is your existing IIS PFX file)privatekey.key (is your new exported private key file)ssl.crt

3. […]

How do I convert a .pfx to be used with an Apache server?

How do I convert my .pfx file to be used with an Apache server?

Answer:

The Apache server will require the following two files:

1 – Server.ker : the private key associated with the certificate2 – Server.crt : the public SSL certificate issued by Entrust

Using Open SSL, you can extract the certificate and private […]