Categories
General

Verifica domenii pe servere cPanel care nu mai sunt local


for user in $(whmapi1 listaccts | awk '/user:/ {print $2}'); do domain=$(whmapi1 accountsummary user=$user | awk '/domain:/ {print $2}'); assignedip=$(whmapi1 accountsummary user=$user | awk '/ip:/ {print$2}') ; dnsip=$(dig +short $domain); dnsmx=$(dig MX +short $domain @8.8.8.8 | awk '{print $2}' | xargs dig +short); if [[ $dnsip != $assignedip ]]; then echo -n "$user:$domain - A - FAILS"; if [[ "$dnsmx" == "$assignedip" ]]; then echo -e " but MX for $user:$domain does point locally"; else echo ""; fi; fi ; done

Categories
Cum sa

Verificare LdapSrvPriority si LdapSrvWeight

Pornim nslookup si din consola nslookup:

set q=SRV
_ldap._tcp.dc._msdcs.

Categories
Cum sa

Activare php-fpm status page pe servere cu plesk

Conditii pentru aceasta varianta:
– server plesk
– nginx ca si proxy pentru apache
– php-fpm binenteles

Cream fisierul /var/www/vhosts/system/numedomeniu/conf/php.ini cu continutul

[php-fpm-pool-settings]
pm.status_path = /status
ping.path = /ping

In plesk la Domains > numedomeniu > Apache & nginx Settings introducem:

location ~ ^/(status|ping)$ {
fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass "unix:///var/www/vhosts/system/numedomeniu/php-fpm.sock";
include /etc/nginx/fastcgi.conf;
}

Actualizam setarile php:

/usr/local/psa/bin/php_settings -u

Putem apela acum in browser:

http://numedomeniu/status

respectiv

http://numedomeniu/status?full

Categories
Cum sa

Configurare SPF relay extern

Exemplu – pentru implementare mailchannels trebuie actualizata inregistrarea txt in dns-uri sa includa si „include:relay.mailchannels.net”.
for i in `ls /var/cpanel/users` ;
do /usr/local/cpanel/bin/spf_installer $i "include:relay.mailchannels.net" 0 0 1;
done

Categories
Cum sa

error while loading shared libraries: libxml2.so.2: wrong ELF class: ELFCLASS32

La rulare yum avem eroarea:
error while loading shared libraries: libxml2.so.2: wrong ELF class: ELFCLASS32
Apare atunci cand sunt instalate ambele versiune libxml2 – 32/64bit.
Verificam pachetele instalate:
rpm -qa --queryformat '%{n}-%{v}-%{r}.%{arch}\n' libxml2
Stergem versiune 32bit
rpm -e libxml2-2.6.26-2.1.25.el5_11.i386

Categories
Cum sa

Lipsa SQLServerWriter la VSSadmin list writers

La services – modificam utilizatorul sub care ruleaza serviciul SQL Server Writer Service de la Local Service la un utilizator cu drepturi de administrare.
Testat cu Windows 2012.

Categories
Cum sa

Stergere sym links

Stergere sym links din directorul curent.
find -type l -delete

Categories
Cum sa

Extragere adrese de email

Le extragem, le sortam, si le afisam doar pe cele unice:

awk -v RS='[[:alnum:]_.]+@[[:alnum:]_]+[.][[:alnum:]]+' 'RT{print RT}' |sort|uniq
Categories
Cum sa

451 4.4.0 DNS temporary failure

Eroarea apare pe servere de email QMail

# yum install pdns-recursor
# service pdns-recursor start
# chkconfig pdns-recursor on

Apoi in /etc/resolv.conf

nameserver 127.0.0.1

Pachetul pdns-recursor e disponobil in EPEL

Categories
Cum sa

Upgrade windows 2012 server

Upgrade de la windows 2012 standard trial la windows 2012 standard sau datacenter.
Din powershell aflam editia curenta:
dism.exe /online /Get-CurrentEdition
Editii la care putem face upgrade:
dism.exe /online /Get-TargetEditions
Facem upgrade:
dism.exe /online /Set-Edition:ServerDatacenter /AcceptEula /ProductKey:KEY-KEY-KEY-KEY