Category Archives: nginx

Mengatasi Httpd/ Apache Hang Pada Server anda

webserver
Anda yang menggunakan VPS (unmanaged) untuk hosting web anda sendiri tentu harus mengatasi sendiri jika ada masalah. Sebagai contoh adalah ketika web Anda jadi lambat diakses atau RTO.

Hal ini bisa disebabkan karena apache Anda ngehang. Anda bisa cek hal ini dengan login ke whm, lalu di “apache status” akan tertera tulisan warna merah yang artinya apache Anda tidak jalan.

Ikuti langkah berikut :

1. Login ke SSH via putty

2. Ketik :

grep -i maxclient /usr/local/apache/logs/error_log

atau

tail -f /var/log/httpd/error_log

Jika muncul seperti ini :

[Fri Aug 02 06:59:37 2013] [error] server reached MaxClients setting, consider raising the MaxClients setting

itu artinya server anda sudah mencapai setting MaxClients, sehingga Anda harus menaikkan MaxClients dan ServerLimit di global setting apache

3. Di WHM, klik Apache Configuration > Global Configuration. Pada MaxClients dan ServerLimit ubah menjadi : 512

4. Klik tombol “Save“, lalu klik tombol “Rebuild Configuration and Restart Apache

 

Tips : Agar Anda bisa langsung mendapat notifikasi via email jika http request error, sebaiknya Anda daftarkan domain Anda di uptimerobot.com (gratis).

Installing Nginx With PHP5 (And PHP-FPM) And MySQL On CentOS 6

Salam all .

Now my time to post my article for nginx server.
How to Install nginx php5-fm mysql on centos 6 ?
So it is easy and lets do it
*learning by doing

- Step One

Download Repositry
sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

- Step Two

Installing Mysql
sudo yum install mysql mysql-server
 then Run it :
sudo /etc/init.d/mysqld start

Configure Mysql
sudo /usr/bin/mysql_secure_installation

” Press – Enter – and Y  and type your Password ” easy -

Testing
mysql -u root -p
Enter password:


- Step Three

Install Nginx Web Server
sudo yum install nginx

Running nginx Web Server
sudo /etc/init.d/nginx start

Configure -
nano /etc/nginx/nginx.conf

” change line – worker_processes 4 –  
Save and Exit.

Configure Virtual Host
nano /etc/nginx/conf.d/default.conf

” Quote :
       - add index.php On index line
       - Change ” Server Name ” by your Domain or IP
       - Change the ” /usr/share/nginx/html ” to ” /var/www/ ” #your public_html
       - Uncoment ” location ~ \.php$ { ” … … ” } “
       - Change root directory under ” location ~ \.php$ { ” … … ” } “
       - Change ” fastcgi_param ” to “fastcgi_param SCRIPT_FILENAME    $document_root$fastcgi_script_name; “
       - Save and Exit . “

Restarting your Nginx Web Server
sudo /etc/init.d/nginx restart

Testing Nginx Web Server
access your server http://192.168.1.20/

- Step Four

Installing php5-fpm
sudo yum –enablerepo=remi install php-fpm php-mysql

Configure php.ini
nano /etc/php.ini

” Uncoment ” cgi.fix_pathinfo=1 ” and change to ” 0 ” => Save and Exit

Configure php5-fpm
sudo nano /etc/php-fpm.d/www.conf

” Repleace user and grup – Apache – with – Nginx “

” Quote :
    [...]
    user : nginx

    [...]

    grup : nginx
    [...] “

Save and Exit.

Then Restart all Service :
/etc/init.d/mysqld restart
/etc/init.d/nginx restart
/etc/init.d/php5-fpm restart

And Now Testing for all :
cd /var/www/
nano info.php

Put the Script :


And Now open info.php => http://192.168.1.20/info.php
See my Screen :

- Finishing

Put all Service in startup

sudo chkconfig –levels 235 mysqld on
sudo chkconfig –levels 235 nginx on
sudo chkconfig –levels 235 php-fpm on

Enjoy it :*

The post Installing Nginx With PHP5 (And PHP-FPM) And MySQL On CentOS 6 appeared first on ndesocode.