You are on page 1of 11

Php.

Password kak arik : 55779D39

nano /etc/apt/sources.list

# deb cdrom:[Ubuntu-Server 15.10 _Wily Werewolf_ - Release amd64


(20151021)]/ wily main restricted

#deb cdrom:[Ubuntu-Server 15.10 _Wily Werewolf_ - Release amd64 (20151021)]/


wily main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to


# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ wily main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ wily main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ wily-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ wily-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu


## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ wily universe
deb-src http://de.archive.ubuntu.com/ubuntu/ wily universe
deb http://de.archive.ubuntu.com/ubuntu/ wily-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ wily-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu


## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ wily multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ wily multiverse
deb http://de.archive.ubuntu.com/ubuntu/ wily-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ wily-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ wily-backports main restricted
universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ wily-backports main restricted
universe multiverse

deb http://security.ubuntu.com/ubuntu wily-security main restricted


deb-src http://security.ubuntu.com/ubuntu wily-security main restricted
deb http://security.ubuntu.com/ubuntu wily-security universe
deb-src http://security.ubuntu.com/ubuntu wily-security universe
deb http://security.ubuntu.com/ubuntu wily-security multiverse
deb-src http://security.ubuntu.com/ubuntu wily-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu wily partner
# deb-src http://archive.canonical.com/ubuntu wily partner

Atur network di nano /etc/network/interfaces


Cek nameservers yang terdaftar di /etc/resolv.conf

Tambahkan hosts
1. Di server sendiri sesuaikan hosts dengan nama server, tambah
panel dan nameserver
2. Di panel tambah nama server sendiri

apt-get update
apt-get upgrade
reboot
dpkg-reconfigure dash <== no

service apparmor stop


update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils

apt-get install nap ntpdate

apt-get install postfix postfix-mysql postfix-doc mysql-client


mysql-server openssl getmail4 rkhunter binutils dovecot-imapd
dovecot-pop3d dovecot-mysql dovecot-sieve sudo

servicespamassassinstop
updaterc.dfspamassassinremove

nano /etc/postfix/master.cf

[...]
submission inet n - - - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
smtps inet n - - - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
[...]

nano /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]

sql-mode=NO_ENGINE_SUBSTITUTION

#bind=127.0.0.1

servicemysqlrestart

netstat -tap | grep mysql

aptgetinstallamavisdnewspamassassinclamavclamavdaemonzoounzipbzip2arjnomarch
lzopcabextractaptlistchangeslibnetldapperllibauthensaslperlclamavdocsdaemonlibio
stringperllibiosocketsslperllibnetidentperlziplibnetdnsperl

Errorswereencounteredwhileprocessing:
amavisdnew
E:Subprocess/usr/bin/dpkgreturnedanerrorcode(1)

Ifthiserroroccurs,makesurethatyourhostnamehasregisteredon/etc/hosts

apt-get install nginx

if this error occurs : [emerg]: bind() to 0.0.0.0:80 failed (98: Address


already in use), please use sudo fuser -k 80/tcp

service apache2 stop

update-rc.d -f apache2 remove

service nginx start


apt-get install php-mysql php-curl php-gd php-intl php-pear php-imagick php-imap
php-mcrypt php-memcache php-pspell php-recode php-snmp php-tidy php-xmlrpc
php7.0-xml snap

apt-get -y install php7.0-fpm

sudonano/etc/php/7.0/fpm/php.ini

Perhatikanukuranmemory_limit=128Mdanpost_max_size = 8M
harus lebih besar dariupload_max_filesize = 2M (pada panel2-vm)

[...]
cgi.fix_pathinfo=0
[...]
date.timezone="Europe/Berlin"
[...]
apt-get install php7.0-sqlite

apt-get install php7.0-ps

apt-get -y install php-apcu

phpenmod crypt

sudo apt-get install gcc make autoconf libc6-dev

pecl7.X-sp install apcu

sudo apt-get install php7.0-mbstring

apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool

nano/etc/default/pureftpdcommon

[...]
STANDALONE_OR_INETD=standalone
[...]
VIRTUALCHROOT=true
[...]

service pure-ftpd-mysql restart

nano /etc/fstab

ubahpartisi/menjadi:
/ ext4 errors=remount-
ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0
1

mount -o remount /
quotacheckavugmquotaonavug
apt-get install vlogger webalizer awstats geoip-database
libclass-dbi-mysql-perl

nano/etc/cron.d/awstats

...andcommentouteverythinginthatfile:

#MAILTO=root

#*/10****wwwdata[x/usr/share/awstats/tools/update.sh]&&
/usr/share/awstats/tools/update.sh

#Generatestaticreports:
#1003***wwwdata[x/usr/share/awstats/tools/buildstatic.sh]&&
/usr/share/awstats/tools/buildstatic.sh

jailkitinstall

aptgetinstallbuildessentialautoconfautomakelibtoolflexbisondebhelperbinutilsgold

cd/tmp
wgethttp://olivier.sessink.nl/jailkit/jailkit2.15.tar.gz
tarxvfzjailkit2.15.tar.gz
cdjailkit2.15
./debian/rulesbinary

cd..
dpkgijailkit_2.151_*.deb
rm -rf jailkit-2.15*

installfail2ban

apt-get install fail2ban

create
nano/etc/fail2ban/jail.local

[pureftpd]
enabled=true
port=ftp
filter=pureftpd
logpath=/var/log/syslog
maxretry=3

[dovecotpop3imap]
enabled=true
filter=dovecotpop3imap
action=iptablesmultiport[name=dovecotpop3imap,port="pop3,pop3s,imap,imap
logpath=/var/log/mail.log
maxretry=5

[postfixsasl]
enabled=true
port=smtp
filter=postfixsasl
logpath=/var/log/mail.log
maxretry=3

nano /etc/fail2ban/filter.d/pureftpd.conf

[Definition]
failregex=.*pureftpd:\(.*@<HOST>\)\[WARNING\]Authenticationfailedfor
ignoreregex=

nano /etc/fail2ban/filter.d/dovecot-pop3imap.conf

[Definition]
failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|
Aborted login \(auth failed|Aborted login \(tried to use disabled|
Disconnected \(auth failed|Aborted login \(\d+ authentication
attempts).*rip=(?P<host>\S*),.*
ignoreregex =
echo "ignoreregex =" >> /etc/fail2ban/filter.d/postfix-sasl.conf

service fail2ban restart


pada mysql panel buat user untuk setup server baru

mysql u root -p

create user 'root'@103.29.196.176' identified by 'unud1234;

grant all privileges on *.* to 'root'@'103.29.196.176' identified by 'unud1234' with


grant option max_queries_per_hour 0 max_connections_per_hour 0
max_updates_per_hour 0 max_user_connections 0;

create user 'root'@unit-web6-vm.unud.ac.id' identified by 'unud1234;

grant all privileges on *.* to 'root@unit-web6-vm.unud.ac.id' identified by


'unud1234' with grant option max_queries_per_hour 0 max_connections_per_hour 0
max_updates_per_hour 0 max_user_connections 0;

Install ISPCOnfig

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3.1.1p1.tar.gz
cd ispconfig3_install/install/

php -q install.php

/etc/nginx/nginx.conf

Edit/etc/nginx/sitesavailable/default

u can do nothing becouse there is already in vhost file


fastcgi_intercept_errors on;
and this need to be deleted
u can find and delete fastcgi_intercept_errors on; in file
/usr/local/ispconfig/server/conf/nginx_vhost.conf.master
after that every new site u will create in panel will work with wordpress

http://www.kangerik.com/cara-mengatasi-masalah-error-nginx-413-request-
entity-too-large/

dump database
database lama
mysqldump u root p {nama database} > {database.sql}

scp ke tempat baru

ini di database server baru


mysql u root p

show databases

use {nama database}

{nama file database.sql}

SIMAK:
1. Mysql gunakan mysqli di function.php karena ini php7.0 pakai mysqli
2. Kalau tidak pakai 2 php (catatan ada di telegram pak putra)
3. Jika menggunakan dua domain dalam 1 directory, gunakan
aliasdomain
4. Tambahkan directive di nano /etc/nginx/sites-
available/simak.unud.ac.id.vhost

if ($scheme != "https") {
rewrite ^ https://$http_host$request_uri? permanent;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}

# Remove trailing slash to please routing system.


if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
if ($scheme != "https") {
rewrite ^ https://$http_host$request_uri? permanent;
}

if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}

Liat eror
/var/log/ispconfig/httpd/{nama website}/error.log
Cek database

mysql -u {c10research-nama user database} -p -h {172.16.121.63-database


server}

show databases;

: PHP Warning: mysqli_select_db() expects exactly 2 parameters, 1 given


in /var/
www/clients/client1/web40/web/config/koneksi.php on line 13" while reading
respon se header from
upstream, client: 167.205.160.3, server: conference.unud.ac.id, re
quest: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-
fpm/web40.sock:", host: "103.29.196.230"

include_path='.:/usr/share/php'
Reset password ISPConfig
mysql -u root -p
use dbispconfig;
UPDATE sys_user SET passwort = md5('admin') WHERE username = 'admin';
quit;

Kalau storage inaccessible

1. Tekan F8 saat booting


2. Tekan ctrl+s
3. Pilih esc
4. Tekan F8
5. Tunggu storage yang mengalami masalah terbaca , biasanya akan terlihat
bahwa storage dalam kondisi disabled
6. Pilih F1 untuk melanjutkan tanpa enable storage yang bermasalah
7. Pilih F2 untuk melanjutkan dengan enable
- Catatan dengan melakukan enable akan menyebabkan dataloss beberapa.

http://relativitynetworks.com/index.php?topic=64.0

https://webepidemic.com/backup-mysql-database-with-cron-job/

https://www.howtoforge.com/community/threads/information-regarding-the-backup-
tab-in-ispconfig-3-0-3.49677/

http://beadmin.2tl.eu/post/script-to-backup-your-websites-and-
databases#.WKVkCfJj3T8

You might also like