VPS server (Virtual Private Server) je način deljenja fizičkog servera na više zasebnih virtualnih servera, pri čemu svaki VPS server može da pokreće različit operativni sistem i aplikacije, nezavisno od ostalih korisnika. Na ovaj način jedan korisnik ne može da ugrozi rad drugog korisnika šta god da uradi sa svojim delom servera.
Razlika od deljenog (shared) hostinga je u tome što korisnik ima potpun pristup svom VPS serveru i potpunu kontrolu nad instaliranim operativnim sistemom i aplikacijama. Takođe svaki korisnik dobija sopstvenu IP adresu.
Na deljenom hostingu veliki broj korisnika koristi jedan server. Iako to deluje slično opisu VPS servera, ipak postoji razlika. Na deljenom serveru, pored toga što dele jedan server, korisnici dele i jednu IP adresu i resurse servera na kojem se nalaze. Ukoliko jedan korisnik izazove veliko opterećenje resursa ili ugrozi reputaciju servera slanjem SPAM emailova, posledice mogu osetiti i drugi korisnici koji takođe koriste isti server.
Detaljnije o lokalnoj instalaciji:
Ažuriranje sistema Debian Stretch
apt-get update
apt-get upgrade
hostname -f
reboot
apt-get install unzip
Instalacija ISPConfig-a
cd /tmp/
wget –no-check-certificate https://github.com/servisys/ispconfig_setup/archive/master.zip
unzip master.zip
rm master.zip 10 cd ispconfig_setup-master/
./install.sh
nano /var/log/ispconfig_setup.log – moze se videti log instalacije ispconfiga zbog eventualnih errora
Instalacija Letsencrypt-a
Besplatini SSL sertifikati za vaše domene
nano /etc/apt/sources.list
#ubacimo
deb http://ftp.debian.org/debian jessie-backports main
apt update
apt upgrade
apt-get install python-certbot-apache -t stretch-backports
certbot certonly –authenticator webroot –installer apache
reboot
netstat -a | egrep ‘Proto|LISTEN’
#Trazimo liniju tcp6 0 0 [::]:https [::]:* LISTEN
Podešavanje Mariadb
nano /etc/mysql/mariadb.conf.d/50-server.cnf
#za max_connections =xxx
/etc/php5/apache2/php.ini
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 50M
…
; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 50M
Podešavanje PHP 7.0
nano /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
#za upload-
max-filesize=100M
Instalacija PHP 7.2
apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dev libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev
#kreiranje simboličkog linka
ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
cd /usr/include
ln -s x86_64-linux-gnu/curl
mkdir -p /opt/php-7.1
mkdir /usr/local/src/php7.1-build
cd /usr/local/src/php7.1-build
wget http://de2.php.net/get/php-7.1.14.tar.bz2/from/this/mirror -O php-7.1.14.tar.bz2
tar jxf php-7.1.14.tar.bz2
cd php-7.1.14/
./configure –prefix=/opt/php-7.1 –with-pdo-pgsql –with-zlib-dir –with-freetype-dir –enable-mbstring –with-libxml-dir=/usr –enable-soap –enable-calendar –with-curl –with-mcrypt –with-zlib –with-gd –with-pgsql –disable-rpath –enable-inline-optimization –with-bz2 –with-zlib –enable-sockets –enable-sysvsem –enable-sysvshm –enable-pcntl –enable-mbregex –enable-exif –enable-bcmath –with-mhash –enable-zip –with-pcre-regex –with-pdo-mysql –with-mysqli –with-mysql-sock=/var/run/mysqld/mysqld.sock –with-jpeg-dir=/usr –with-png-dir=/usr –enable-gd-native-ttf –with-openssl –with-fpm-user=www-data –with-fpm-group=www-data –with-libdir=/lib/x86_64-linux-gnu –enable-ftp –with-imap –with-imap-ssl –with-kerberos –with-gettext –with-xmlrpc –with-xsl –enable-opcache –enable-fpm
make
make install
cp /usr/local/src/php7.1-build/php-7.1/php.ini-production /opt/php-7.1/lib/php.ini
cp /opt/php-7.1/etc/php-fpm.conf.default /opt/php-7.1/etc/php-fpm.conf
cp /opt/php-7.1/etc/php-fpm.d/www.conf.default /opt/php-7.1/etc/php-fpm.d/www.conf
nano /opt/php-7.1/etc/php-fpm.conf
#ukoniti ; na liniji: pid = run/php-fpm.pid
nano /opt/php-7.1/etc/php-fpm.d/www.conf
#izmeniti “listen” liniju i postaviti na neki neiskorisceni port npr: 8999 jer je moguce da je port 9000 vec iskoriscen
listen = 127.0.0.1:8999
nano /lib/systemd/system/php-7.1-fpm.service
#dodamo linije:
[Unit]
Description=The PHP 7.1 FastCGI Process Manager After=network.target
[Service]
Type=simple PIDFile=/opt/php-7.1/var/run/php-fpm.pid ExecStart=/opt/php-7.1/sbin/php-fpm –nodaemonize –fpm-config /opt/php-7.1/etc/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
systemctl enable php-7.1-fpm.service
43 systemctl daemon-reload
44 nano /opt/php-7.1/lib/php.ini
#dodamo sledecu liniju na kraj fajla:
zend_extension=opcache.so
Instalcija i podešavanje Memcache (opciono)
apt-get install libmemcached-dev
mkdir /usr/local/src/php7.1-build/php-memcache
cd /usr/local/src/php7.1-build/php-memcache
wget https://github.com/php-memcached-dev/php-memcached/archive/php7.zip
unzip php7.zip
cd php-memcached-php7
/opt/php-7.1/bin/phpize
./configure –with-php-config=/opt/php-7.1/bin/php-config
#ako ovo iznad ne prodje onda apt install pkg-config
make
make install
nano /opt/php-7.1/lib/php.ini
#dodamo sledecu liniju na kraj fajla:
extension=memcached.so
Instalacija i podešavanje xDebug
cd /opt/php-7.2/etc
pecl -C ./pear.conf update-channels
pecl -C ./pear.conf install xdebug
nano /opt/php-7.2/lib/php.ini
#dodamo sledecu liniju na kraj fajla:
zend_extension=/opt/php-7.2/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
systemctl start php-7.2-fpm.service
cd /opt/php-7.2/bin
./php –version
Konfiguracija HTTP2 modula
sudo a2enmod http2
#dodavanje unutar Apache Directives
Protocols h2 h2c http/1.1
Instalcija i podešavanje WP CLI alata:
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar –no-check-certificate
chmod +x wp-cli.phar
mv wp-cli.phar /usr/bin/wp
nano /etc/jailkit/jk_init.ini
[wp]
comment = WordPress Command Line
executables = /usr/bin/wp
includesections = php
[php]
comment = The PHP Interpreter and Libraries
executables = /usr/bin/php5, /usr/bin/php
directories = /usr/lib/php5, /usr/share/php, /usr/share/php5, /etc/php5, /usr/share/php-geshi, /usr/share/zoneinfo
includesections = env
[env]
comment = Environment Variables
executables = /usr/bin/env
[mysql]
comment = MySQL Client
executables = /usr/bin/mysql
ISPConfig-> System -> Jailkit tab -> Jailkit chroot app sections -> php mysql wp (dodamo, vizualno slika ispod)
Detaljni o WP CLI alatu: WP-CLI osnove
Pristup vašem panelu 2 načina:
- pomoću vaše ip adrese (primer https://192.168.1.100:8080)
Dodavanje PHP 7.2 verzije unutar ISPConfig-a
Text uputstvo:
System -> Additional PHP Versions
Name tab -> U PHP Name polje ukucamo npr: PHP 7.2
FastCGI Settings tab -> U Path to the PHP FastCGI binary polje ukucamo: /opt/php-7.2/bin/php-cgi
U Path to the php.ini directory polje ukucamo: /opt/php-7.2/lib
PHP-FPM Settings tab -> U Path to the PHP-FPM init script polje ukucamo: php-7.2-fpm
U Path to the php.ini directory polje ukucamo: /opt/php-7.2/lib
U Path to the PHP-FPM pool directory polje ukucamo: /opt/php-7.2/etc/php-fpm.d
Slikovito uputstvo: