Mouse over the words to change the cursor.
auto
crosshair
default
e-resize
help
move
n-resize
ne-resize
nw-resize
pointer
progress
s-resize
se-resize
sw-resize
text
w-resize
wait
not-allowed
no-drop
7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]
C:\Users\Sam>7za a -t7z files.7z *.txt 7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19 Scanning Creating archive files.7z Compressing file1.txt Compressing file2.txt Everything is Ok C:\Users\Sam>
7z d archive.zip *.bak -r 7z: use executable d: delete files archive.zip: delete from this archive *.bak: only match bak files -r: traverse all subdirectories
7z e archive.zip 7z: executable e: use extract command archive.zip: source archive you want to expand
C:\Users\Sam>7za l files.7z
7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19
Listing archive: files.7z
Method = LZMA
Solid = +
Blocks = 1
Physical Size = 1202
Headers Size = 172
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2008-10-02 15:48:01 ....A 27216 1030 file1.txt
2008-10-02 15:47:45 ....A 3888 file2.txt
------------------- ----- ------------ ------------ ------------------------
31104 1030 2 files, 0 folders
7z t archive.zip *.doc -r 7z: use this executable t: test the specified archive archive.zip: the archive you want to test *.doc: test all these files in the archive -r: recurse all child directories
7z u archive.zip *.doc 7z: executable name u: update command archive.zip: archive you want to update files in *.doc: only update these files (Word documents)
Compression levels
Switch -mx0: Don't compress at all.
This is called "copy mode."
Switch -mx1: Low compression.
This is called "fastest" mode.
Switch -mx3: Fast compression mode.
Will automatically set various parameters.
Switch -mx5: Same as above, but "normal."
Switch -mx7: This means "maximum" compression.
Switch -mx9: This means "ultra" compression.
You probably want to use this.
7z x archive.zip 7z: executable name x: use the extract command archive.zip: the archive you want to extract all the files from
Type switches Switch: -t7z Format: 7Z Example filename: archive.7z (default option) Switch: -tgzip Format: GZIP Example filename: archive.gzip, archive.gz Switch: -tzip Format: ZIP Example filename: archive.zip (compatible) Switch: -tbzip2 Format: BZIP2 Example filename: archive.bzip2 Switch: -ttar Format: TAR Example filename: tarball.tar (UNIX and Linux) Switch: -tiso Format: ISO Example filename: image.iso (may not be supported) Switch: -tudf Format: UDF Example filename: disk.udf
7z a -tiso archive.iso 7z a -tudf archive.udf 7z: executable name a: add to archive -tiso or -tudf: format of archive to create archive.iso or archive.udf: name of archive to create
7z a -tzip archive.zip *.jpg -mx0
7z: name of executable
a: add to archive command
-tzip: specify a ZIP archive (useful for compatibility)
archive.zip: destination archive
*.jpg: only add jpg files to archive
-mx0: don't compress, just copy
useful for already-compressed files
7z a -t7z archive.7z *.exe *.dll -ms -mmt 7z: name of executable a: archive command specified -t7z: use 7z file type (less compatible and smaller results) archive.7z: destination archive file *.exe: include all *.exe files in directory in new archive *.dll: include all *.dll files in new archive -ms: create solid archive (default) -mmt: multithread the operation (faster)
7z a -t7z archive.7z *.txt -m0=PPMd 7z: executable name/path a: add command specified -t7z: use the 7z format (needed for PPMd) archive.7z: destination archive file *.txt: select all text files -mo=PPMd: compress with this algorithm
7z x archive.zip -oC:\Doc 7z: executable name x: extract archive with paths intact archive.zip: archive to extract files from -oC:\Doc: extract all files to the Doc folder on the C: drive
7za a pw.7z *.txt -pSECRET 7za: name and path of 7-Zip executable a: add to archive pw.7z: name of destination archive *.txt: add all text files to destination archive -pSECRET: specify the password "SECRET"
C:\Users\Sam>7za x pw.7z 7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19 Processing archive: pw.7z Enter password:
7za.exe a archive.7z Z*.* -ssc 7za.exe: 7-Zip command-line executable path and name a: archive command archive.7z: add files to this target archive Z*.*: select only files whose first letter is a capital Z
Example of the switches 7z x test.zip -aoa 7z: use the 7-zip executable x: use the extract command test.zip: extract files from this archive -aoa: overwrite all existing files. risky!
7z a -tzip archive.zip subdir\ 7z: use executable a: add to archive -tzip: use zip compression archive.zip: create this archive subdir\: source directory
7z e archive.zip -oC:\soft *.cpp -r 7z: executable e: use extract command archive.zip: source archive you want to extract from -oC:\soft: the destination folder (-o is the switch and C:\soft is the argument) *.cpp: only extract cpp files (C++) -r: traverse all subdirectories
root@mysql-1# mysql -u root -p -e "INSERT INTO mysql.user (Host,User) values ('10.0.0.100','haproxy_check'); FLUSH PRIVILEGES;"
root@mysql-1# mysql -u root -p -e "GRANT ALL PRIVILEGES ON *.* TO 'haproxy_root'@'10.0.0.100' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES"
root@haproxy# apt-get install mysql-client
root@haproxy# mysql -h 10.0.0.1 -u haproxy_root -p -e "SHOW DATABASES"
root@haproxy# apt-get install haproxy
root@haproxy# sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/haproxy
root@haproxy:~# service haproxy
Usage: /etc/init.d/haproxy {start|stop|reload|restart|status}
mv /etc/haproxy/haproxy.cfg{,.original}
nano /etc/haproxy/haproxy.cfg
global
log 127.0.0.1 local0 notice
user haproxy
group haproxy
defaults
log global
retries 2
timeout connect 3000
timeout server 5000
timeout client 5000
listen mysql-cluster
bind 127.0.0.1:3306
mode tcp
option mysql-check user haproxy_check
balance roundrobin
server mysql-1 10.0.0.1:3306 check
server mysql-2 10.0.0.2:3306 check
listen 0.0.0.0:8080
mode http
stats enable
stats uri /
stats realm Strictly\ Private
stats auth A_Username:YourPassword
stats auth Another_User:passwd
http://<Public IP of Load Balancer>:8080/
service haproxy start
root@haproxy# mysql -h 127.0.0.1 -u haproxy_root -p -e "SHOW DATABASES"
root@haproxy# mysql -h 127.0.0.1 -u haproxy_root -p -e "show variables like 'server_id'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 1 |
+---------------+-------+
root@haproxy# mysql -h 127.0.0.1 -u haproxy_root -p -e "show variables like 'server_id'"
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 2 |
+---------------+-------+
nano /etc/haproxy/haproxy.cfgserver mysql-2 10.0.0.2:3306 check weight 2
service haproxy reload
root@haproxy:~# for i in `seq 1 6`
do
mysql -h 127.0.0.1 -u haproxy_root -ppassword -e "show variables like 'server_id'"
done
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 1 |
+---------------+-------+
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 2 |
+---------------+-------+
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 2 |
+---------------+-------+
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 1 |
+---------------+-------+
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 2 |
+---------------+-------+
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 2 |
+---------------+-------+
root@mysql-1# service mysql stop
root@mysql-1# ifconfig eth1 down
tail /var/log/haproxy/haproxy.logNov 15 00:08:51 localhost haproxy[1671]: Server mysql-cluster/mysql-1 is DOWN, reason: Layer4 timeout, check duration: 2002ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
root@mysql-1:~# ifconfig eth1 down &&
date &&
sleep 20 &&
ifconfig eth1 up &&
date
Fri Nov 15 00:37:09 IST 2013
Fri Nov 15 00:37:29 IST 2013
root@haproxy:~# tail /var/log/haproxy.log
Nov 15 16:49:38 localhost haproxy[1275]: Server mysql-cluster/mysql-1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 15 16:49:56 localhost haproxy[1275]: Server mysql-cluster/mysql-1 is UP, reason: Layer7 check passed, code: 0, info: "5.5.31-0+wheezy1-log", check duration: 1ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
16:49:32 - Port 3306 on mysql-1 was blocked
16:49:34 - Check - Failed - Failure No. 1
16:49:36 - Check - Failed - Failure No. 2
16:49:38 - Check - Failed - Failure No. 3 (server removed and event logged)
16:49:52 - Firewall rule removed port 3306 accessible
16:49:54 - Check - Passed - Success No. 1
16:49:56 - Check - Passed - Success No. 2 (server added to cluster and event logged)
nano /etc/haproxy/haproxy.cfgserver mysql-1 10.0.0.1:3306 check fall 2 inter 1000
server mysql-2 10.0.0.2:3306 check fall 2 inter 1000
nano /etc/haproxy/haproxy.cfgserver mysql-1 10.0.0.1:3306 check fastinter 1000
server mysql-2 10.0.0.2:3306 check fastinter 1000
root@mysql-1:~# iptables -A INPUT -p tcp --dport 3306 -j REJECT &&
date &&
sleep 20 &&
iptables -D INPUT -p tcp --dport 3306 -j REJECT &&
date
Fri Nov 15 17:18:48 IST 2013
Fri Nov 15 17:19:08 IST 2013
root@haproxy:~# tail /var/log/haproxy.log
Nov 15 17:18:52 localhost haproxy[1353]: Server mysql-cluster/mysql-1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Nov 15 17:19:11 localhost haproxy[1353]: Server mysql-cluster/mysql-1 is UP, reason: Layer7 check passed, code: 0, info: "5.5.31-0+wheezy1-log", check duration: 1ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.
17:18:48 - Port 3306 blocked
17:18:50 - Check - Failed - Failure No. 1
17:18:51 - Check - Failed - Failure No. 2
17:18:52 - Check - Failed - Failure No. 3 (server removed and event logged)
17:19:08 - Firewall rule removed
17:19:10 - Check - Passed - Success No. 1
17:19:11 - Check - Passed - Success No. 2 (server added to cluster and event logged)
yum install httpd httpd-devel -y
nano -w /etc/httpd/conf/httpd.conf
Listen 80
Listen 81
NameVirtualHost 127.0.0.1:81
# Define Server document root
DocumentRoot /var/www/html/
# Define the virtual host
<VirtualHost 127.0.0.1:81>
ServerName www.yourwebsite.com
ServerAlias yourwebsite.com
DocumentRoot /var/www/yourwebsite.com
<Directory "/var/www/yourwebsite.com">
Options FollowSymLinks -Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
</VirtualHost>
|
service httpd restart
mkdir /root/temp; cd /root/temp
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -i nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum install nginx -y
nano -w /etc/nginx/nginx.conf
user nobody;
worker_processes 4;
error_log logs/error.log crit;
worker_rlimit_nofile 8192;
events {
worker_connections 1024; # you might need to increase this setting for busy servers
use epoll; # Linux kernels 2.6.x change to epoll
}
http {
server_names_hash_max_size 2048;
server_names_hash_bucket_size 512;
server_tokens off;
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
# Gzip on
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
# Other configurations
ignore_invalid_headers on;
client_max_body_size 8m;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
connection_pool_size 256;
client_header_buffer_size 4k;
large_client_header_buffers 4 32k;
request_pool_size 4k;
output_buffers 4 32k;
postpone_output 1460;
# Cache most accessed static files
open_file_cache max=10000 inactive=10m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
# virtual hosts includes
include "/etc/nginx/conf.d/*.conf";
}
nano -w /etc/nginx/conf.d/yourwebsite.com.conf
server {
listen 80;
server_name yourwebsite.com yourwebsite.com;
access_log off;
error_log logs/yourwebsite.com-error_log crit;
location ~* .(gif|jpg|jpeg|png|ico|wmv|3gp|avi|mpg|mpeg|mp4|flv|mp3|mid|js|css|html|htm|wml)$ {
root /var/www/yourwebsite.com;
expires 365d;
}
location / {
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_connect_timeout 30s;
proxy_redirect http://www.yourwebsite.com:81 http://www.yourwebsite.com;
proxy_redirect http://yourwebsite.com:81 http://yourwebsite.com;
proxy_pass http://127.0.0.1:81/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
mkdir /root/temp; cd /root/temp
wget https://github.com/y-ken/mod_rpaf/archive/master.zip
unzip master.zip
cd mod_rpaf-master/
apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
nano -w /etc/httpd/conf.d/rpaf.conf
LoadModule rpaf_module modules/mod_rpaf-2.0.so
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 YOUR.SERVER.IP
service httpd restart
curl -I http://www.yoursite.com/
HTTP/1.1 200 OK
Server: nginx
service httpd stop
service httpd start
nano -w /var/www/yourwebsite.com/info.php
<? phpinfo( ); ?>
|