Installing kubernetes master on Ubuntu 16.04

To install master on Ubuntu 16.04, lets start by installing docker.

Now install kubeadm

You can create kubernetes master by running kubeadmin init command.

htaccess

Redirect domain to SSL (HTTPS)

Or

Redirect a Page to another

You can also use

Letsencrypt

Install letsencrypt

OR

Install SSL certificate on Apache

On Nginx

This will stop web server. Generate SSL, then start web server.

Getting SSL with out web server

Domain should be pointed to the server IP and IP should be public to generate SSL. Run following command.

Auto Renew SSL Certificate

Set following cronjob to auto renew SSL

Add

List All SSL

Change Email Associated with account

Search for LetsEncrypt SSL status

https://crt.sh/

certbot certificates
Enable LetsEncrypt SSL in ISPConfig
Nginx Proxy SSL Verification

sed

sed can be used to replace text in a file.

g = Global, replace everything in a file.
s = substitute text
-i = update the file.

Delete lines matching string

To delete lines having a string and print result.

To update the file, use -i option

VestaCP Free Hosting Control Panel

VestaCP Free Hosting Control Panel

Reset VestaCP admin password

VestaCP Free Hosting Control Panel

You can login to VestaCP at

phpMyAdmin available at

http://YOUR-IP-ADDR/phpmyadmin/

You can see phpMyAdmin Nginx config at /etc/nginx/conf.d/phpmyadmin.inc

Web Site DocumentRoot

Web sites are stored in folder

Log Files

/var/log/nginx/domains/ => stores Nginx Access and error logs for hosted web sites.

Configuration Files

php-fpm configurations for each web sites are stored in /etc/php-fpm.d/DOMAIN.conf, each web sites runs php-fpm in its own pool. Here is sample config

Apache/Nginx configuration in folder : /home/admin/conf/web (admin is user, if you have other users, check folder for the user)

VestaCP Installer Compromised

See Hosting Control Panel

Zend OPcache in phpinfo

Enable Zend OPcache in PHP

To enable Zend OPCache in PHP, edit php.ini add following to end of the file

Now you may need to adjust some settings, in php.ini uncomment following, change values as needed.

Verify it with

Restart web server. If you using php-fpm or fcgi, you need to restart the process.

phpinfo() will show

Zend OPcache in phpinfo

Find MySQL socket

Install PHP 7.1 php-fpm from source

Lets install the requirements.

On CentOS, run

Before you can install, you need to check MySQL socket location. To do this, run following command in MySQL command prompt.

Find MySQL socket

Download and install PHP 7.1 from source

Copy the configuration files

Now you will be able to start php-fpm by running

By default php-fpm will run using tcp port 9000, it is better to change it to use unix socket, for this

Find

Replace with

php-fpm user

You need to configure the user account used to run php-fpm, if you don’t use proper account, you may get permission errors.

The account you use vary depending on OS, Web server. For example, nginx use account nginx. Apache on Ubuntu/Debian use www-data. Apache on CentOS use nobody.

Here is what i have on a server running Nginx web server

Systemd Service

To easily manage php-fpm, lets create a php-fpm.service file.

Before we do this, edit

Find

Add below

Find

Add below

Save and exit.

Now lets create file /usr/lib/systemd/system/php-fpm.service

Add following content

Enable php-fpm with

Now you will be able to use systemctl to start/stop/restart php-fpm

systemctl status php-fpm

phpinfo redis

Install Redis PHP Module from source

To install Redis PHP module from source, run

Once installed, edit your php.ini file, add following below extension_dir line

Verify redis is installed with php -m

Now restart web server

phpinfo() will show following

phpinfo redis

CentOS 7 Cannot find autoconf

When install redis php module, i get error

Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

This is fixed by installing autoconf package with yum.

Once autoconf installed, phpize command worked properly.

Manage XenServer from command line with xe

xe command is used to manage XenServer from command line

To list VM, run