Static IP: SSL Certificates Installation
Static IP: SSL Certificates Installation
Static IP: SSL Certificates Installation
http://maintao.qiniudn.com/book/Learning_Chef.pdf
http://www.tecmint.com/
FTP
https://www.unixmen.com/install-vsftpd-server-on-centos-rhel-scientific-linux-6-4/
(:APACHE:)
very very IMP command (dispatcher not working)
Dispatcher Configuration:)
Dispatcher settings
<IfModule disp_apache2.c>
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel 3
DispatcherNoServerHeader 0
DispatcherDeclineRoot 0
DispatcherUseProcessedURL 0
DispatcherPassError 0
</IfModule>
<Directory />
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
</IfModule>
Options FollowSymLinks
AllowOverride None
</Directory>
----------------------------------------
Virtual host settings
<VirtualHost *:80>
ServerAdmin aravind.yadav@icfi.com
ServerName access.inside7.com.au
UseCanonicalName Off
TraceEnable Off
<Directory />
ServerSignature Off
AllowOverride None
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
</Directory>
</VirtualHost>
----------------------------------------
Rewrite options
<IfModule mod_rewrite.c>
RewriteEngine on
Include /etc/httpd/conf.d/rewrite.conf
RewriteOptions Inherit
</IfModule>
##################################
USA
<VirtualHost *:80>
ServerName dev-register.zebra.com
ServerAlias dev-register.zebra.com
DocumentRoot /vol2/adobe/dispatcher/dev-register.zebra.com
CustomLog logs/dev-register.zebra.com_access_log combined
ErrorLog logs/dev-register.zebra.com_error_log
DispatcherUseProcessedURL 1
<Directory "/vol2/adobe/dispatcher/dev-register.zebra.com">
# <IfModule disp_apache2.c>
# SetHandler dispatcher-handler
# </IfModule>
#Options -MultiViews +FollowSymLinks
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
# Handle request that starts with /content/userreg
RewriteCond %{HTTP_HOST} ^dev-register.zebra.com$ [OR]
RewriteCond %{HTTPS_HOST} ^dev-register.zebra.com$
RewriteCond %{REQUEST_URI} ^/content/userreg*
RewriteCond %{REQUEST_URI} .*.html
RewriteRule ^/content/userreg/(.*)$ /$1 [R,QSA]
# Handle requests that does not contain /content/userreg/
RewriteCond %{HTTP_HOST} ^dev-register.zebra.com$ [OR]
RewriteCond %{HTTPS_HOST} ^dev-register.zebra.com$
RewriteCond %{REQUEST_URI} !^/content/userreg/
RewriteCond %{REQUEST_URI} !^/content/dam
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/content/dam
RewriteCond %{REQUEST_URI} .*.(html|json)
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^/(.*).(html|json)$ /content/userreg/$1.$2 [PT,L,QSA]
# Handle requests to root with a trailing slash
RewriteCond %{HTTP_HOST} ^dev-register.zebra.com$ [OR]
RewriteCond %{HTTPS_HOST} ^dev-register.zebra.com$
RewriteCond %{REQUEST_URI} !^/content/dam
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*)/$ /register.html [R,QSA]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@
Leverage cache and Enable compression
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
#mod_deflate
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
#mod_gzip
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-
Encoding:.*gzip.*
</IfModule>
…………………………………………………………….
/libs/granite/operations/config/maintenance/granite:daily/granite:RevisionGC
LINUX
http://www.techsupportpk.com/2016/10/protect-your-server-against-the-
dirty-cow-linux-vulnerability.html
Crontab
https://crontab.guru/#1_07_2_3_2
# wget http://dev.mysql.com/get/mysql57-community-release-el7-
7.noarch.rpm
DAILY
/var/log/httpd/*log {
rotate 7
daily
missingok
notifempty
sharedscripts
compress
create 644 root root
postrotate
/bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
endscript
}
http://www.visiospark.com/mod-rewrite-rule-generator/
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://domain.com [R=301,L]
Dispatcher Setup
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
DispatcherConfig conf/dispatcher.any
DispatcherLog logs/dispatcher.log
DispatcherLogLevel 3
DispatcherNoServerHeader 0
DispatcherDeclineRoot 0
DispatcherUseProcessedURL 1
DispatcherPassError 0
</IfModule>
<Directory />
<IfModule disp_apache2.c>
SetHandler dispatcher-handler
ModMimeUsePathInfo On
Options +FollowSymLinks
AllowOverride None
</IfModule>
</Directory>
<Directory />
ServerSignature Off
Options +FollowSymLinks
AllowOverride None
UseCanonicalName Off
Options +FollowSymLinks
AllowOverride None
</Directory>
https://www.akadia.com/services/ssh_test_certificate.html
If you run into another incompatibility like this in the future, use yum
search all. For example:
yum search all mod_ssl
Returns:
mod_ssl.x86_64 : SSL/TLS module for the Apache HTTP Server
mod24_ssl.x86_64 : SSL/TLS module for the Apache HTTP Server
Checking .csr file info in linux
#openssl x509 -inform der -in certnew.cer -noout -text
##########
################################################
Yum configuration
vi /etc/yum.repos.d/rhcelab.repo
[rhcerepo]
name=rhcerepo
baseurl=file:///rhcelab/repo
enabled=1
gpgcheck=0
:wq!
########################################################
Cores info
#lscpu (Cores information)
SSL Generation:
https://www.akadia.com/services/ssh_test_certificate.html
Date Changing
1. date —> check the date and time
2. date -s "20 may 2015 17:17:17" —> Set the local time
3. hwclock -r or hwclock —> check
4. hwclock -s or hwclock --hctosys -> to sync h/w to localhwclock --systohc --localtime -> to
sync local to h/w
1. Enable compression
2. Leverage browser caching
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
###################################
Wild card
Flags
Flags are added to the end of a rewrite rule to tell Apache how to interpret and handle
the rule. They can be used to tell apache to treat the rule as case-insensitive, to stop
processing rules if the current one matches, or a variety of other options. They are
comma-separated, and contained in square brackets. Here's a list of the flags, with their
meanings (this information is included on the cheat sheet, so no need to try to learn
them all).
• C (chained with next rule)
• CO=cookie (set specified cookie)
• E=var:value (set environment variable var to value)
• F (forbidden - sends a 403 header to the user)
• G (gone - no longer exists)
• H=handler (set handler)
• L (last - stop processing rules)
• N (next - continue processing rules)
• NC (case insensitive)
• NE (do not escape special URL characters in output)
• NS (ignore this rule if the request is a sub request)
• P (proxy - i.e., apache should grab the remote content specified in the substitution
section and return it)
• PT (pass through - use when processing URLs with additional handlers, e.g.,
mod_alias)
• R (temporary redirect to new URL)
• R=301 (permanent redirect to new URL)
• QSA (append query string from request to substituted URL)
• S=x (skip next x rules)
• T=mime-type (force specified mime type)
IPTABLES FLOW
https://www.quora.com/Do-you-know-of-any-book-videos-and-websites-where-I-could-learn-to-
use-iptables-Linux-program/answer/Djas-Djati-1
#ServerName 172.18.29.51:80
ServerName stage.kotak.com
ServerSignature Off
ServerTokens Prod
TraceEnable Off
#ServerTokens Full
SecServerSignature “ “
#chkconfig httpd on
https://www.suse.com/documentation/sles11/singlehtml/book_sle_ad
min/book_sle_admin.html
#sed -n '/ Beginning date & time / , /Ending date & time/p' log type >>
Output log name
Command
$ lsnrctl stop
$ dbshut
db01:/usr/oracle/app/product/11.2.0/dbhome_1:
Y
[oracle@db01 ~]$
vi ~/.bash_profile
# add follows to the end
export ORACLE_SID=db01
[
2 Create an init Script with the root user.
]
[root@db01 ~]#
vi /etc/rc.d/init.d/oracle
# it's an example, edit it you like.
#!/bin/bash
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/usr/oracle/app/product/11.2.0/dbhome_1
ORACLE_USER=oracle
case "$1" in
'start')
if [ -f $LOCKFILE ]; then
echo $0 already running.
exit 1
fi
echo -n $"Starting Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
touch $LOCKFILE
;;
'stop')
if [ ! -f $LOCKFILE ]; then
echo $0 already stopping.
exit 1
fi
echo -n $"Stopping Oracle Database:"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
rm -f $LOCKFILE
;;
'restart')
$0 stop
$0 start
;;
'status')
if [ -f $LOCKFILE ]; then
echo $0 started.
else
echo $0 stopped.
fi
;;
*)
echo "Usage: $0 [start|stop|status]"
exit 1
esac
exit 0
[root@db01 ~]#
chmod 755 /etc/rc.d/init.d/oracle
[root@db01 ~]#
chkconfig --add oracle
[root@db01 ~]#
chkconfig oracle on
HTTP/2.0
Note : Apache version more than 2.4.20
Step1: First we need to update epel release
step2: yum update && yum install epel-release
step3: yum install http://rpms.remirepo.net/enterprise/remi-release-
7.rpm
Step4: yum update
Step5: yum install httpd
cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.el`rpm -q --
qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo
Step6: yum install httpd -y
cd /etc/httpd/modules
#ls -ltr
#mod_http2.so
Step7 : yum install php71
Step8 : cd /etc/httpd/conf.modules.d/
Step9 : vim 10.h2.conf ( to check module has been loaded or not )
Step10: yum install php71—php-tmp ( to download )
https://www.rpmfind.net/linux/rpm2html/search.php?query=php71-php-
fpm%28x86-64%29
Note : It will work with https only Not with http so that we need to
install ssl certificates on the Machine.
EX:
<VirtualHost 192.168.1.1:443>
SSLEngine on
SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:
+EXP
SSLCertificateFile /etc/ssl/star.example.com.crt
SSLCertificateKeyFile /etc/ssl/star.example.com.key
ServerName "one.example.com"
DocumentRoot "/var/www/html/one"
Protocols h2 http/1.1
CustomLog "/var/log/httpd/one-access.log" combined
ErrorLog "/var/log/httpd/one-error.log"
<Directory /var/www/html>
AllowOverride none
Order Allow,Deny
Allow from all
</Directory>
</VirtualHost>
IPTABLES LINUX
https://www.cyberciti.biz/tips/linux-iptables-examples.html