Archive for the ‘Systems’ Category
Встановлення MySQL 5.5 на RHEL / CentOS 6 или 5
Для CentOS / RHEL 5 32-64 бит
#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Для CentOS / RHEL 6 32-64 бит
#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Для CentOS / RHEL 7 32-64 бит
#wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
#rpm -Uvh remi-release-7.rpm
#yum update
#yum –enablerepo=remi install mysql mysql-server
Upgrade php5-5.4 to php56
#portmaster -o lang/php56 php5-5.4.35
#portmaster -y -D -o devel/oniguruma5 oniguruma4
#pkg info | grep php | grep 5.4 | awk ‘{print $1}’ |awk -F ‘-5.4’ ‘{print “whereis “$1}’ |sh |awk -F ‘: /usr/ports/’ ‘{print “portmaster -y -D -o “$2” “$1}’ | sed -e “s@/php5-@/php56-@” -e ‘s@$@-5.4.35@’ | sh
(more…)
Sendmail on lo0
#vim freebsd.submit.mc
FEATURE(`msp’, `[127.0.0.4]’)dnl
#vim freebsd.mc
DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.4, Port=smtp, Modifiers=bh’)
#vim otrs.united.net.ua.mc
MASQUERADE_AS(`domain’)
MASQUERADE_DOMAIN(domain)
FEATURE(masquerade_envelope)
FEATURE(masquerade_entire_domain)
define(`SMART_HOST’, `smtp.domain’)dnl
DAEMON_OPTIONS(`Name=MTA, Addr=127.0.0.4, Port=smtp, Modifiers=bh’)
Finding spam sending PHP scripts on your server
#php.ini
mail.add_x_header = On
mail.log = /var/log/phpmail.log
#find / -name php.ini | xargs perl -pi -e ‘s/\;mail\.log =/mail\.log = \/var\/log\/phpmail.log/i’
Request Tracker RT BlackList
Request Tracker >4.2 RT 4.2 BlackList.
Add RT_SiteConfig.pm
Set($SquelchList, ‘root@example.edu,www-data@example.edu,nobody@example.edu’);
Edit perl5/site_perl/RT/Action/SendEmail.pm
Find # Cycle through the people we’re sending.
And add befor
+ # BEGIN SNL Modification: global squelch list
(more…)
Varnish
Varnish 4.0:
If you are on RHEL 6 or a compatible distribution, use:
rpm –nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
yum install varnish
For RHEL 7 and compatible distributions, use:
rpm –nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el7.rpm
yum install varnish
Find
Шукаємо старі директорії і архівуємо.
find ./ -name . -prune -o -type d -mtime +90 -exec tar czvpf {}.tgz ./{} \; -exec rm -rf {} \;
Как увеличить скорость загрузки сайта, применив Gzip сжатие страниц.
edit .htaccess
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Or, compress certain file types by extension:
(more…)
OpenWRT cli command
uci set network.wan.proto=static
uci set network.wan.ipaddr=192.168.152.5
uci set network.wan.netmask=255.255.255.0
uci set network.wan.gateway=192.168.152.1
uci set network.wan.dns=8.8.8.8
uci add_list network.wan.dns=8.8.4.4 //(второй dns)//
uci commit
uci add firewall rule
uci set firewall.@rule[-1].src=wan
uci set firewall.@rule[-1].target=ACCEPT
uci set firewall.@rule[-1].proto=tcp
uci set firewall.@rule[-1].dest_port=22
uci commit firewall
uci add firewall rule
(more…)
Xen server mangment Vlan
xe network-create name-label=<name>
xe vlan-create network-uuid=<UUID> pif-uuid=<PIF> vlan=160
xe pif-reconfigure-ip uuid=<UUID> IP=<IP> netmask=<Mask> gateway=<GW> mode=static DNS=<NDS>
xe host-management-reconfigure pif-uuid=<PIF>
network_uuid=$(xe network-create name-label=hellnet)
pif_uuid=$(xe pif-list host-name-label=xcp-node device=eth1 –minimal)
xe vlan-create network-uuid=”$network_uuid” pif-uuid=”$pif_uuid” vlan=666
vm_uuid=$(xe vm-list name-label=network-web-tools –minimal)
xe vif-create vm-uuid=”$vm_uuid” network-uuid=”$network_uuid” mac=random device=1