Archive

Posts Tagged ‘yajuvendra’

Connect Mysql from git on windows

December 16, 2016 Leave a comment

We can connect to mysql from git on window through this command.

winpty mysql -uROOT -pPASSWORD

Advertisements
Categories: Mysql Tags: , , , ,

Speed up site with .htaccess

January 20, 2015 1 comment

Append these line in your .htaccess file.

#Trun on compression

mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php)$
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.*

#Turn on content caching

ExpiresActive On
ExpiresByType image/jpg “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType text/javascript “access plus 1 month”
ExpiresByType application/javascript “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 month”

ExpiresByType application/font-woff “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”
ExpiresByType application/x-font-ttf “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”

ExpiresDefault “access 2 days”
Header set Cache-Control “public”
Header unset Cache-control

Header append Vary: Accept-Encoding
Header unset Pragma

#Mod_deflate is an apache module that can be used to compress data using gzip compression before sending it to the browser

AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/x-font-ttf

Joomla 3.x component creator

August 16, 2013 Leave a comment

Create Component Joomla 3.x

How to install xampp/lampp on centos (linux)

June 27, 2013 Leave a comment

How to install xampp/lampp on centos (linux)

The installation procedure here is based on CentOS 6.x workstation default installation. Follow these steps
1. Log in linux terminal

2. Change user to root. Write below command and press enter and enter root user password.

#su

3. The default installation of CentOS lacks some of the libraries that XAMPP needs to run, including 32 bit compatibility libraries.
To get them you su to root then use this yum command.

#yum -y install glibc* libstd* ld-linux.so.2

4. Download and install the latest verions from the XAMPP, from the XAMPP download page. Upload this file to server /opt/ directory.

5. Unpack tar file

#tar zxvf xampp-linux-1.8.1.tar.gz /opt/

6. Change the ownership of all the xampp files to be nobody:root.

#chown nobody:root /opt/lampp/ -R

7. XAMPP was designed to run on 32 bit operating systems. The start up script will prevent xampp from starting up if you are running on a 64 bit system which isn’t necessary since you installed 32 bit compatibility libraries in step 1. To get around this restriction, open /opt/lampp/lampp in an editor and comment out the following lines.

# XAMPP is currently 32 bit only
#case `uname -m` in
# *_64)
# if /opt/lampp/bin/php -v > /dev/null 2>&1
# then
# :
# else
# $de && echo “XAMPP gibt es zur Zeit nur als 32-Bit Applikation.
# Bitte verwende eine 32-Bit Kompatibilitaetsbibliothek fuer Dein
# System.”
#
# $de || echo “XAMPP is currently only availably as 32 bit
# application. Please use a 32 bit compatibility library for
# your system.”
#
# exit
# fi
# ;;
#esac

8. Open /opt/lampp/etc/etc/extra/httpd-xampp.conf in an editor. Replace the “Deny from all” statement with “Require all grant” in the stanza. You can also comment out the “Allow from…” line if you don’t want to accept connections from any external system.

Order deny, allow
# Deny from all
Require all granted
# Allow from ::1 127.0.0.0/8 \
# fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
# fe80::/10 169.254.0.0/16
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

9. Start up xampp
#/opt/lampp/lampp start

10. To fix most of the security weaknesses in xampp simply call the following command

#/opt/lampp/lampp security

It will ask you to change password. Set all pasword.

11. Open http://localhost in a browser. You should a get a browser window with the XAMPP for Linux startup screen.

12. Open /opt/lampp/lampp/phpmyadmin/config.inc.php in your editor of choice

13. Change the authentication type as follows:

$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’

14. Add the following lines in the config.inc.php file.

$cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma_table_uiprefs’;
$cfg[‘Servers’][$i][‘recent’] = ‘pma_recent’;

15. Close your browser then restart Apache and MySQL in the XAMPP Control Panel.

#/opt/lampp/lampp restart

17. At this point most of the setup work for XAMPP is done. However, if you plan to use phpyMyAdmin you’ll have to do a little further configuration to get it to work properly. XAMPP does not create all the tables that phpmyadmin needs so you have to do this with an SQL script that is enclosed with the package. To do this click on the Import tab in phpmyadmin. Choose the create_tables.sql script in /opt/lampp/lampp/phpmyadmin/examples directory and press go button.

18. If website is not open. Then check port 80 on centOs. dport port 80 by following command.

# sudo iptables -I INPUT -p tcp –dport 80 -j ACCEPT
# sudo service iptables save

19. For ftp dport 21 port

# sudo iptables -I INPUT -p tcp –dport 80 -j ACCEPT
# sudo service iptables save

20. [optional] Block brute force attack. Please read this http://kvz.io/blog/2007/07/28/block-brute-force-attacks-with-iptables/

Follow me on facebook

%d bloggers like this: