Saturday, October 1, 2016

Installing, Configuring, Starting, & Stopping Supervisord on Amazon EC2 Server(centOS) For Laravel - Part 2

So in previous part, we have successfully created the laravel-worker-supervisor.conf. Now in this file we are going to add a new config as mention on laravel official website like this :
So let's add those lines... First open laravel-worker-supervisor.conf, "sudo nano laravel-worker-supervisor.conf" aaaaaand... add the code closer to it's doc like this :D



okaaay... That's all of that... then let's run our supervisord by executing this command :
"supervisord -c /etc/laravel-worker-supervisord.conf".... In order to prove that it's already run, let's execute it again...
So it gives a warning that it's already running.... so that's good... :D


and for the last piece, to stop supervisord on centOS, we can use
"sudo unlink /tmp/supervisor.sock"....


Weeell... That's all of the tutorial... I hope this usefull for someone who are still learning about supervisor like me...ehehe... :D

oooh yaah.. for uninstalling supervisor on centOS, we can use "sudo pip uninstall supervisor"

And I'm sorry because I can't make a video about this one because there are a lot of things to hide like the username, ip, and other credentials ahahaa... :-)


Installing, Configuring, Starting, & Stopping Supervisord on Amazon EC2 Server For Laravel

First of all, login into your amazon account by opening "https://aws.amazon.com/console" as shown below :

Then put your username and password... :D.... After logging, open service, choose EC2 :

Hit on "Instances" link :

On this page, you see all of your available EC2 service, then choose one of them to install supersord and then copy it's public DNS to be used for loggin in putty... :D

Next... Open putty.exe

Then open "Auth" as pointen green arrow above, then put your amazon private key :
Okiee... After that back to main putty screen, just hit "Open" button

After successfully login with putty, you'll gonna see a main screen like this :
Then let's install supervisor by using this command :
"sudo easy_install supervisor"
After that go to /usr/local/bin, open "echo_supervisord_conf" with this command :
"./echo_supervisord_conf"
Copy the content of echo_supervisord_conf, then create another file on /etc/ directory, this file called for example "laravel-worker-supervisor.conf"... mmm... for copying the content of echo_supervisord_conf, mark these lines :


then hit "SHIFT + CTRL + C" on your keyboard for copying the content and then type "sudo nano /etc/laravel-worker-supervisor.conf" for creating a new file and opening the file. After type hit "CTRL + V" for saving our copied text before from echo_supervisord_conf. Now our laravel-worker-supervisor.conf should be looked like this :

Okiee... Save this file "CTRL + X" then type "y"....

Go to the next Part...