Sunday, April 30, 2017

No space left on device: AH00023: Couldn't create the proxy mutex

Apache tiba tiba down dan sering terjadi dengan menampilkan pesan :

[Sat Apr 29 14:48:25.334267 2017] [core:emerg] [pid 93298:tid 140132036216800] (28)No space left on device: AH00023: Couldn't create the proxy mutex
[Sat Apr 29 14:48:25.334281 2017] [proxy:crit] [pid 93298:tid 140132036216800] (28)No space left on device: AH02478: failed to create proxy mutex
AH00016: Configuration Failed


Cara mengatasi :

# ipcs -s

bila menampilkan semaphore artinya apache masih belum bersih dan dapat dibersihakan memberikan perintah berikut:

ipcs | grep nobody | awk '{print $2}' > sem.txt for i in `cat sem.txt`; do { ipcrm -s $i; }; done;
atau

# for i in `ipcs -s | awk '/httpd/ {print $2}'`; do (ipcrm -s $i); done

kemudian tambahkan baris perintah dibawah di /etc/sysctl.conf

kernel.msgmni = 1024 kernel.sem = 250 256000 32 1024

bila apache masih belum bisa aktip ganti dengan :

kernel.sem = 500 64000 64 1024


tarakhir aktipkan dengan perintah:

# sysctl -p



CARA LAIN:

bikin file misalnya ipcs_check

#!/bin/sh
# vi ipcs_check
# ln -s ipcs_check  /etc/cron.hourly/

EMAIL=info@plasahosting.com
MAX_SEMAPHORES=15
USER_APACHE=nobody

IPCS=/usr/bin/ipcs
IPCRM=/usr/bin/ipcrm
MAIL=/bin/mail

COUNT=`${IPCS} | grep $USER_APACHE | wc -l`

if [ "$COUNT" -le $MAX_SEMAPHORES ]; then
       #all is well, there are no semaphore build-ups.
       exit 0;
fi

#we have more than MAX_SEMAPHORES, so clear them out and restart Apache.

LIST=/root/sem.txt

${IPCS} | grep $USER_APACHE | awk '{print $2}' > ${LIST}
for i in `cat ${LIST}`; do
{
       ${IPCRM} -s $i;
};
done;

/etc/init.d/httpd restart

TXT="${COUNT} semaphores cleared for apache for `hostname`"
echo "${TXT}" | ${MAIL} -s "${TXT}" ${EMAIL}

exit 1;


berikan mode 755

chmod 755 ipcs_check

aktipkan ke cron hours


ln -s ipcs_check /etc/cron.hourly/

Monday, April 03, 2017

Install SSL Certificate di cpanel server.

Installing a SSL certificate on your server, using cPanel 11.48


If the Certificate Signing Request was not created yet, please check this article for the instructions on CSR generation.
    After the certificate has been issued, and sent to you by the Certificate Authority, you can proceed with deploying the certificate on the server. Follow the steps below to install the SSL for your site.
  1. Log in to your cPanel account

  2. Locate and click on SSL/TLS Manager in the Security section 

  3. Click on 'Manage SSL Sites' under Install and the Manage SSL for your website (HTTPS) menu 

  4. Copy the certificate code you received from the Certificate Authority including -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- and paste it into the 'Certificate: (CRT)' field on the next page. The certificate files can be opened with the help of text editor on your computer.
    Note: The certificate code can be found in the file *yourdomain*.crt which is usually sent to you in the email from the Certificate Authority. Alternatively, it can be downloaded from your account directly.

  5. Click on the Autofill by Certificate button, which appears next to the certificate entered, and the system will attempt to fetch the domain name and the private key. You may also choose the domain from the drop-down list and manually enter the certificate and private key into the corresponding boxes. If the system fails to fetch the private key, you can locate it in the Private Keys (KEY) section of the SSL/TLS Manager. Please remember to include Begin/End headers and footers for the certificate and the key. 

  6. Copy and paste the chain of intermediate certificates (CA Bundle) into the box under Certificate Authority Bundle (CABUNDLE)If you want to use this certificate for Mail Services (Exim and Dovecot), tick the checkbox ‘Enable SNI for Mail Services’. In this case, you will be able to use your domain, on which SSL certificate has been installed, as a hostname of the mailserver configuring your mail clients to work via secured ports.



     

  7. Click on the 'Install Certificate' button

Congratulations! The certificate is now installed on the server for your site. The site should now be accessible via https://.



Cara upload dengan git tanpa menyertakan folder tertentu

  Untuk mengupload kode menggunakan Git tanpa menyertakan folder tertentu, Anda perlu menggunakan file khusus bernama .gitignore . File ini...