Wednesday, July 15, 2015

PHP FPM – HOW TO SEPARATE VHOST(WEB SITE) AND EXTEND LIMITS PER VHOST ON NGINX.

php fpm – How to separate vhost(web site) and extend limits per vhost on nginx.
I’m done it for phpmyadmin to allow import large files (this can be used to separate vhosts with limitations or extend as well)
# cp /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/phpmyadmin.conf
# nano /etc/php5/fpm/pool.d/phpmyadmin.conf
change
; pool name (‘www’ here)
[www]
to
[phpmyadmin]
change
; Note: This value is mandatory.
listen = /var/run/php5-fpm.sock
to
; Note: This value is mandatory.
listen = /var/run/php5-fpm-phpmyadmin.sock
# nano /etc/nginx/sites-enabled/phpmyadmin
chnge
fastcgi_pass unix:/var/run/php5-fpm.sock;
to
fastcgi_pass unix:/var/run/php5-fpm-phpmyadmin.sock;
# nano /home/phpmyadmin/.user.ini
add
upload_max_filesize = 20M
memory_limit = 256M
max_execution_time = 300
max_input_time = 240
# sudo service php5-fpm restart
# sudo service nginx reload

LINUX SENDMAIL WORK SLOW (FQDN)

Sendmail work slow , up to 60 sec when send mail.
This is because sendmail can’t resolve the right FQDN.
How to resolve:
1) We check what is our hostname
# hostname -f
# newdev

2) The fix is:
# nano /etc/hosts
and make the first line loock like”
# 127.0.0.1 localhost localhost.newdev newdev
Now , the sendmail send mails without delay.

CLAMD HAS FAILED. CONTACT YOUR SYSTEM ADMINISTRATOR IF THE SERVICE DOES NOT AUTOMAGICALLY RECOVER

clamd has failed. Contact your system administrator if the service does not automagically recover.
Home »cPanel »Manage Plugins
Uninstall clamavconnector
Install and keep updated
cpanel_clam

Thursday, December 25, 2014

How to add launchpad ubuntu repository and install php5-memcached 2.2.0

Add repository
# add-apt-repository ppa:ondrej/php5
Check available versions
# apt-get update
# apt-cache policy php5-memcached
Install memcashed
# apt-get install php5-memcached

Monday, December 1, 2014

VARNISH WEB INTERFACE FOR ADMIN AND CACHE INVALIDATION

1) Download and extract
wget https://github.com/varnish/vagent2/archive/master.zip
unzip master.zip

2)Install
cd vagent2-master/
./configure
make
make install

3)Protect the interface
nano /etc/varnish/agent_secret
Insert formatted
user:password
4)Start the agent

/usr/local/bin/varnish-agent

5)Varnish Web Interfase access (when promted for login , enter the user:password from /etc/varnish/agent_secret)
http://THE-SERVER-IP:6085/html/
6) The Varnish Web Interfase allow:
stop/start varnish
Cache invalidation
Set Parameters
View varnish performance
2014-12-01 23_16_57-Varnish Agent

Wednesday, November 5, 2014

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- redis (LoadError)

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- redis (LoadError)
solution:
gem 'redis', '~> 3.1.0'