adduser –system –no-create-home new_user
Monthly Archives: February 2015
linux add user to admin group
usermod -G wheel admin
linux user with root privileges
useradd -ou 0 -g 0 new_root
cagefs install php selector
yum groupinstall alt-php
yum update cagefs lvemanager
gzip leave original
gzip < file > file.gz
dovecot[]: pop3-login: Internal login failure (pid= id=1) (internal failure, 1 successful auths):
cd /usr/local/directadmin/custombuild
./build update
./build clean
./build dovecot d
wget -O /etc/dovecot/dovecot.conf “http://files.directadmin.com/services/custombuild/dovecot.conf.2.0”
vzmigrate safe migration
vzmigrate --online --keep-dst --remove-area no -v x.x.x.x 100
openvz migrate all vps
for CT in $(vzlist -H -o veid); do vzmigrate –remove-area no –keep-dst $1 $CT; done
nginx: [emerg] unknown “binary_remote_address” variable
vi /etc/nginx/nginx.conf
Change limit_conn_zone $binary_remote_address zone=addr:10m; to
limit_conn_zone $http_x_forwarded_for zone=addr:10m;
fedora install language pack
yum langinstall lt
Error: rpmdb open failed: Fedora
Error:
[root@localhost ~]# yum clean all
error: db5 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db5 – Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
Fix:
cp -a /var/lib/rpm/ /var/lib/rpm___
rm -rf /var/lib/rpm/__db*
rpm –rebuilddb
yum update
test if remote http file exists
2>&1 wget -v –spider http://centos.lt/centos/7/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso | grep exist
munin running on nginx (ubuntu)
apt-get install nginx libfcgi-perl wget
mv -v /etc/nginx/sites-available/default /etc/nginx/sites-available/default.old
vi /etc/nginx/sites-available/default
server {
listen 80;
server_name linux4you.tk www.linux4you.tk;
root /var/www/linux4you.tk;
access_log /var/www/logs/example.com.access.log;
location / {
index index.html index.htm index.pl;
}
location ~ \.pl|cgi$ {
try_files $uri =404;
gzip off;
fastcgi_pass 127.0.0.1:8999;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
mkdir /var/www/linux4you.tk
chown -R www-data:www-data /var/www/linux4you.tk
If you want enlarge your munin grahics, you need install fastcgi:
wget –spider -v http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper | grep exists
If exists run:
wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl
wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi
chmod +x /usr/bin/fastcgi-wrapper.pl
chmod +x /etc/init.d/perl-fcgi
update-rc.d perl-fcgi defaults
insserv perl-fcgi
service nginx start
service perl-fcgi start
vi /var/www/linux4you.tk/index.pl
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print <
Perl Environment Variables
EndOfHTML
foreach $key (sort(keys %ENV)) {
print "$key = $ENV{$key}
\n";
}
print "