The Truth

Perjalanan hidup ini memberi kita pengalaman yang tersendiri, pencarian kebenaran tentang sesuatu biasanya akan berakhir dgn kehampaan. Lagi banyak kita tau, lagi byk terbuka pintu fitnah.

Biarkan berlalu dgn redha dan mungkin itu bukan rezeki (meminjam ayat seseorang) kita walaupon hakikatnya kita tau secara detail apa yang berlaku sebenarnyaaaa…

Maka, ambe ambik keputusan untuk put a stop to it… biar lah jadi kenangan!

How to Configure Apache and PHP for High Traffic Websites on Linux Server

Almost every tutorial on how to install the LAMP stack (Linux, Apache, MySQL, PHP) will recommend that you use the built-in Apache module for processing PHP scripts. For example, in Ubuntu you would enable this when you use a command such as sudo apt install libapache2-mod-phpto install a package. This would in turn force Apache to use mpm_prefork. Every time a visitor accesses your website, a new process will be launched to handle that connection. This works well when traffic is low.

But, it becomes a huge issue if you get a sudden burst of traffic. For example, a Reddit post may include your website, and if the post gets popular, you may get thousands of visitors in just a few minutes.

In a best case scenario, if Apache is able to handle the traffic burst, some unlucky visitors may have to wait perhaps thirty to sixty seconds until the page is loaded, which is absurd in today’s world. In a worst case scenario, the server will start to lag badly, and some connections will be simply dropped because of lack of resources. In this case visitors will see an error in their browsers.

It’s not a good scenario either way, since you potentially lost the attention of hundreds or thousands of interested readers, customers or fans.

Unfortunately, PHP is a pretty big resource hog either way. But, with mpm_event, Apache can handle sudden bursts of traffic in a much more efficient way. It’s recommended, though, that your server have at least 2GB of RAM and 2 CPU cores, real or virtual, and even more if you expect to have intense traffic spikes, such as more than ten visitors per second. If you’re using a virtual private server, add more virtual CPU cores to your situation and SSD storage. RAM is secondary.

How to Use Apache MPM Event and PHP-FPM on Debian-Based Distributions

On Debian, Ubuntu or other distros from this family simply avoid installing the “libapache2-mod-php” package. When you install Apache it uses MPM event by default. But upon installing the mentioned package, a script disables MPM event and enables MPM prefork. The Apache PHP module can only work (safely) with mpm_prefork. Of course, without “libapache2-mod-php,” you have no processor for PHP files. So you will use PHP-FPM instead of the PHP module included in Apache. Here is how you would install a LAMP stack on a fresh server. You can adapt the steps according to your web application’s requirements.

First, log in as root. Then, install Apache.

At this point you can see that Apache does indeed ship with MPM event enabled by default.

Apache Php Fpm Check Mpm Debian

Install PHP-FPM.

You will see instructions on how to enable the PHP processor in Apache.

Apache Php Fpm Enable Php Instructions

Enable FastCGI protocol.

Enable PHP-FPM default configuration for Apache.

Note: in future versions of Debian/Ubuntu, this command could change to something else, e.g. a2enconf php7.6-fpm, because PHP-FPM would be a different version.

Restart Apache.

Install the rest of your requirements for your PHP application. Here’s an example:

This would install a database server and the PHP MySQL module so that your PHP application can connect to a database.

How to Use Apache MPM Event and PHP-FPM on RedHat-Based Distributions

The other popular server distribution choice is RedHat, or CentOS. In the same way as above, an example of a clean install of Apache with MPM event enabled and PHP-FPM will be offered.

Log in as root and install Apache.

Unlike Debian-based distros, here you will see that Apache uses MPM prefork by default, at least on the latest CentOS 7 available at the time of writing.

Apache Php Fpm Check Mpm Centos

To enable MPM event, you have to edit a configuration file.

This will add a # sign to comment (inactivate) the line LoadModule mpm_prefork_module modules/mod_mpm_prefork.so.

Apache Php Fpm Mpm Conffile On Centos

Now uncomment (activate) the line #LoadModule mpm_event_module modules/mod_mpm_event.so by removing the preceding # sign with the next command.

Start Apache and enable it to autostart at boot.

Check if Apache now uses MPM event.

Apache Php Fpm Mpm Event Enabled Status Centos

Install PHP-FPM and FastCGI module.

Create “/etc/httpd/conf.d/php.conf” to instruct Apache on how to process PHP files. Copy ALL content below, and paste it all at once in the terminal, then press ENTER.

The credit for this great config goes to Debian. Other sources recommend a simple configuration file such as:

<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>

But this is vulnerable to some attacks, and if certain services fail, you may expose PHP files to the public, in turn potentially exposing stored passwords, code and sensitive data.

Restart Apache.

Start PHP-FPM and enable its autostart at boot.

Conclusion

You now have an Apache server that scales much better with traffic. However, remember that you’re using the default settings, as in what’s “best” for most people. If you really want to get the most out of your HTTP server, you have to read about various variables you can tune. The right values for these are highly dependent on your server’s resources, expected traffic and PHP application.

 

How to bypass DPI for OpenVPN

If you’ve ever been on a network that blocks OpenVPN, even when running on TCP 443, you might think you’r e out of options.

Well, you’re not, because you can hide OpenVPN traffic behind an SSH tunnel. This makes all traffic appear to be SSH, which has a lower likelihood of being blocked.

DPI

DPI, or Deep Packet Inspection, is a method of filtering packets that can determine the type of packet it is(i.e. HTTPS, OpenVPN,SSH, etc.). This is often used to restrict access to certain services, making it harder to bypass the firewall. However, if one protocol is not blocked, it can sometimes be used to mask another protocol that is blocked, such as SSH encapsulating OpenVPN traffic.

Creating the SSH tunnel

Creating the SSH tunnel is quite simple. All you need to do is make sure you have OpenVPN running on a TCP port(such as TCP 443), and run the following command:

ssh -L 1194:localhost:1194 server

Replace server with what you usually use to log in(i.e. bob@ssh.example.com). This will create a tunnel listening on localhost 1194/tcp and forward it to the remote server on port 1194/tcp.

Setting up OpenVPN

Next, you’ll need to configure OpenVPN to actually use the SSH tunnel instead of connecting directly to the external server. Simply edit your .ovpn file, and replace the remote line(s) with:

proto tcp 
remote localhost 1194

This will tell OpenVPN to send all traffic through the SSH tunnel.

Why not just an SSH tunnel?

Well, one reason is that when using OpenVPN through SSH, all traffic is sent through the VPN, instead of just the applications you’ve configured to go through the SSH tunnel. Another reason is mobile support; there are many SSH apps that support setting up SSH tunnels, but very few(or no) iOS apps support using a SOCKS proxy.

Setting this up on iOS

I needed to set this up on iOS a few days ago, so here’s how I did it:

  1. Install the Termius app, and set up local port forwarding with the following settings:
  • Host: your server
  • Port from: 1194
  • Destination: your server’s IP address/hostname
  • Port to: 1194

2. Edit the .ovpn file and email it to your phone, then import it into the OpenVPN app

3. Click on the port forwarding setting you just created in Termius to enable it

4. Try to connect to your VPN

You should now be able to bypass firewalls on both your iPhone/iPad/iPod touch and any Linux-based operating system. If you’re on Windows, then I guess you can use Putty, but you should really switch to Linux 🙂

Maksud Cinta yang hakiki

Kerap kita dengar perkataan cinta dalam kehidupan seharian kita. Tapi pernah kah kita fikir apakah persamaan serta perbezaan kalimah cinta bagi setiap org?

Apakah maksud cinta bagi keadaan ini:-

  1. Cinta kepada ibu dan ayah
  2. Cinta kepada guru
  3. Cinta kepada murid
  4. Cinta kepada Alam Sekitar
  5. Cinta kepada Masyarakat sekeliling
  6. Cinta kepada masjid
  7. Cinta kepada Ilmu

 

Apabila diperhalusi, cinta itu sebenarnya pada hakikat adalah yang hanya tahu memberi, tidak tahu menerima 

Kenapa?

 

p/s: nanti kita hurai lagi

 

Ibadat yg difahami part 1

Apabila berbicara bab melakukan ibadat seperti solat. .. Zakat. .  Puasa serta yang lain2nya… Kebanyakan dari kita merasa yang kita yg berkuasa melakukan semua ibadat tersebut.. . Pada fahaman kita, makin kuat kita beribadat berserta dengan istiqomah tentu kita akan disayangi oleh Allah swt. Kita akan dimasukkan dalam syurga dek kerana sayangnya Allah kepada kita.

 

Bagi sekalian yang faham,  apabila kita merasa dengan kita beribadat seperti bersolat.. . Berdoa..  Berzakat maka kita akan disayangi oleh Allah. .  Maka pada saat itu kita telah melemahkan akan zat Allah swt yang padaNya tiada urusan yg lepas atau yang akan datang tanpa Dia tahu dalam ilmuNya

 

 

Buatmu Bonda Azizah

Quote TKO:-

Ibu bergenang air mataku
Terbayang wajahmu yang redup sayu
Kudusnya kasih yang engkau hamparkan
Bagaikan laut yang tak bertepian

Biarpun kepahitan telah engkau rasakan
Tak pula kau merasa jemu
Mengasuh dan mendidik kami semua anakmu
Dari kecil hingga dewasa

Hidupmu kau korbankan
Biarpun dirimu yang telah terkorban
Tak dapat kubalasi akan semua ini
Semoga Allah memberkati kehidupanmu ibu

Ibu kau ampunilah dosaku
Andainya pernah menghiris hatimu
Restumu yang amatlah aku harapkan
Kerana disitu letak syurgaku

Tabahnya melayani kenakalan anakmu
Mengajarku erti kesabaran
Kau bagai pelita di kala aku kegelapan
Menyuluh jalan kehidupan

Kasihanilah Allah, ibu yang telah melahirkan diriku
Bagaikan kasih ibu sewaktu kecilku
Moga bahgia ibu di akhirat sana…

Kasih sayangmu sungguh bernilai
Itulah harta yang engkau berikan
Ibu… dengarlah rintih hatiku untukmu ibu

http://www.youtube.com/watch?v=Bwy2AIIRZAY&feature=related
http://www.youtube.com/watch?v=SqzNEApTcOI&feature=related
http://www.youtube.com/watch?v=GGuqK9dWUcE&feature=related

Kuasa “VETO” SUAMI dan IBU

Hanya ada dua orang yang mempunyai kuasa ini. SUAMI dan IBU. Kuasa suami keatas isteri dan kuasa ibu keatas anak2. Kuasa Mutlak ini sungguh besar ertinya disisi agama Islam sehingga seseorang itu akan dimurkai Allah sekiranya dia menyakiti hati dua golongan tadi. Sebagai contoh; seorang isteri yang melukai hati suaminya walau sedikit akan berdosa besar (bukan dalam kes terkecuali) begitu juga anak2 terhadap ibunya

Kalau isteri – bayangkan seorang isteri yang secara tidak sedar menyakiti hati suaminya dan tidak meminta maaf. Isteri tersebut akan terus berdosa dan sekiranya dia hamil, anak tersebut akan dikandung didalam badan yang berdosa. Besar kemungkinan anak tersebut akan mendapat banyak sifat2 yang tidak baik dan seterusnya anak itu lahir dan membesar dan menjadi dewasa dan membawa sifat2 yang tidak elok itu kedalam zuriatnya. Tambahan pula dalam keadaan berdosa bagaimana doa2nya akan diterima Allah? Tanpa doa yang diterima, apalagi daya kita untuk mendapat kebahagiaan?

Kalau anak-anak cukup senang untuk mendapat dosa. Terguris sahaja hati ibunya oleh kata2 atau perbuatan maka anak tersebut akan berdosa. Yang paling ditakuti dosa tersebut tidak disedarinya. Sekiranya anak tidak meminta ampun maka dosa tersebut akan terus dipikul. Kesanya, doa2 anak tersebut tidak diterima Allah, ibadatnya tidak mendapat pahala, hidupnya akan tidak mendapat berkat dll. Akhirnya anak akan mendapat berbagai balasan dari Allah dibumi lagi.

Cerita – Kita sering ditakutkan oleh para ustaz tentang cerita bagaimana dua orang pemuda yang solleh mendapat seksaan Allah dizaman Nabi saw. Yang seorang sebab dia TAK SEDAR menyakiti ibunya apabila habuk yang disapu terkena ibunya TANPA DISEDARI. Dan yang seorang lagi kerana TANPA DISEDARI dia menyakiti hati ibunya kerana mengutamakan isterinya. Ke dua2 diseksa oleh Allah sehingga nabi memerintahkan kedua ibu tadi mengampunkan anak2nya.

Ustaz kata cerita tersebut menyuruh kita sentiasa taat kepada ibu. Sebenarnya itu hanyalah setengah dari pengajaranya. Ada lagi setengah – IBU mesti tahu kuasa yang diberi kepada mereka. Oleh itu IBU MESTI MENGAMPUNKAN ANAKNYA SETIAP MALAM samada anaknya meminta atau tidak dan begitu juga dengan SUAMI MESTI MENGAMPUNKAN ISTERINYA SETIAP MALAM samada isteri meminta atau tidak. Cerita tersebut mengajar kita bahawa sebagai IBU kita mempunyai satu kelebihan yang besar keatas anak2 kerana berdasarkan cerita itu tidak mungkin pemuda2 tersebut sedar akan kesalahan mereka. Kalau dah tak sedar, bagaimana pula ingin meminta ampun.

Seorang suami dan ibu MESTI tahu akan KUASA MUTLAK ini dan kuasa ini hendaklah dijaga dengan baik. InsyAllah bermula dari satu keluarga yang mana suami memaafkan isteri dan ibu memaafkan anak, maka lahirlah satu masyarakat yang mendapat berkat dari Allah, sentiasa dibawah lindunganNya dan menjadi umat Islam yang menghayati Islam.

Ingatlah seorang ISTERI (wanita) mesti taat kepada SUAMInya (lelaki). Si SUAMI (lelaki) mesti taat kepada IBUnya (wanita). Isteri akan menjadi ibu yang akan melahirkan anak yang akan menjadi suami (anak lelaki) dan juga isteri (anak perempuan) dan seterusnya mereka akan melahirkan pula bakal2 suami dan isteri. Jadi tidak ada yang ketinggalan. Semuanya akan merasa mempunyai KUASA MUTLAK. Tetapi yang penting bukanlah ‘mempunyai’ tetapi MESTI menggunakan dengan bijak.