shutdown -h nowrestart server now (reload)
shutdown -r now
sudo yum install nano subversion -y
nano /etc/bashrc
export EDITOR="nano"
crontab -edan voilla... crontab sudah menggunakan nano
nano /root/.ssh/authorized_keyslalu copaskan isi dari script public key yang berawalan -> rsa_blablablabalbla ke file ini
nano /etc/ssh/sshd_configrsa key ini bisa lebih dari 1, dipisahkan dengan new line per key seperti berikut
rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx rsa yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyUntuk melihat hasilnya, jangan lupa restart service
/etc/init.d/sshd restart
nano /etc/ssh/sshd_configtekan ctrl+w, lalu cari PermitRootLogin, uncomment dan ubah valuenya jadi
PermitRootLogin without-password
Untuk ubah port default misalnya menjadi 222Port 222
/etc/init.d/sshd restart
yum install gd gd-devel php-gd -ylalu restart nginx
/etc/init.d/nginx restart
sudo yum install epel-release
sudo yum install nginx
sudo /etc/init.d/nginx start
sudo yum install php-fpm php-mysql -y
sudo /etc/init.d/php-fpm start
cd /usr/share/nginx/html svn co http://www.grevia.com/repository .you will be asked for username & password for subversion
nano /etc/nginx/conf.d/default.confisi dengan ini
# server { listen 80 default_server; listen [::]:80 default_server; server_name s1.grevia.com; error_log /var/log/nginx/error_nginx.log; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { root /usr/share/nginx/html; index index.php index.html index.htm; try_files $uri $uri/ /index.php; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ \.php$ { root /usr/share/nginx/html; index index.php index.html index.htm; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; try_files $uri $uri/ /index.php; } #location ~ \.php { # include /etc/nginx/common/php.conf; #} #sementara jangan pake dlu #error_page 404 /404.html; # location = /40x.html { #} error_page 500 502 503 504 /50x.html; location = /50x.html { } }
nano /home/restart_nginx_fpm.shIsi dengan ini lalu save
/etc/init.d/php-fpm restart && /etc/init.d/nginx restartRun command for executable
chmod +x /home/restart_nginx_fpm.sh
mkdir /var/lib/php/session chmod -R 777 /var/lib/php/session
nano /etc/php-fpm.d/www.confJika sudah, ketik ctrl+W, lalu cari "http" atau "apache"
; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginxdan ganti dengan user = nginx dan group = nginx
nano /etc/nginx/nginx.confganti line ini:
worker_processes auto;Ganti Auto dengan 4 untuk blabla Restart Nginx
/home/restart_nginx_fpm.shAnd voila... Server sudah berjalan normal
nano /etc/php.iniThen tekan ctrl+w : cari "timezone" ubah jadi Asia/Jakarta
[Date]; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone = Asia/Jakarta
nano /etc/my.cnfKetikan ini di dalam sintaks [mysqld]
default_time_zone='+07:00'Set Autostart of Nginx, Php FPM and Mysql
sudo chkconfig --levels 235 mysqld on sudo chkconfig --levels 235 nginx on sudo chkconfig --levels 235 php-fpm on
nano /home/update.shFilled update.sh with this for svn update
svn up /usr/share/nginx/html/Run command for executable
chmod +x /home/update.sh
crontab -eSet update script tiap 2 menit sekali via cron
#cron */2 * * * * /home/update.shVoilla, script akan mengupdate otomatis
-- install agar bisa membaca pecl yum install php-pear
-- install untuk membaca error phpize sudo yum --noplugins install php-devel
-- install untuk mengsolve error imagick c dependency yum install ImageMagick-devel yum intall gcc
-- install imagick php 5.3 pecl install imagick-3.1.2
adalah kumpulan tutorial server dan pemograman tentang seputar Linux & PHP
CodeIgniter