Installing and Configuring NGINX on CentOS

  Рет қаралды 86,350

Juriy Bura

Juriy Bura

Күн бұрын

Пікірлер: 89
@JuriyBura
@JuriyBura 6 жыл бұрын
IMPORTANT ------------------ From 2018 and on, the setup in this video will only work if your SELinux is configured correctly (to allow nginx to connect to Node and to read files from home folder). Otherwise you will be getting "Not Found" and "Permission Denied" errors. Check out this video if that's what you are experiencing: kzbin.info/www/bejne/fpnclYGqlrF4gZI
@RichardBronosky
@RichardBronosky 5 жыл бұрын
6:45 Yo, dawg! I hear you like including configurations. So I included configurations inside your included configurations. Seriously though, this is an absolutely stellar demonstration. Thank you.
@ShaifulBorhan
@ShaifulBorhan 5 жыл бұрын
I wish I had seen this video 6 months ago. Having said that, I still learn so many things from your Deploying Node video series. A million thanks Juriy! Please keep on educating.
@nishchhal42
@nishchhal42 4 жыл бұрын
Finally after wandering in whole internet for days your video showed the exact process to do this. Thanks a lot for creating such to the point and working code.
@jordanfromit5998
@jordanfromit5998 2 жыл бұрын
This guide was like heroin to me, I've been trying to figure this out for hours and you just breezed right through it explaining everything. thank you so much!
@javierlopez5877
@javierlopez5877 5 жыл бұрын
Very great video!! Congratulations, I was following usin docker, but your instructions where so good that I managed to follow along. Keep up the great work pleas!!
@purovenezolano14
@purovenezolano14 5 жыл бұрын
Thank you so much. Super helpful. Love how you explain the flags for all the commands you use.
@romeobotviewers
@romeobotviewers 4 жыл бұрын
Thank you for your great explanation.. now my nodejs running on nginx like a charm
@distro6077
@distro6077 5 жыл бұрын
*FIRST TIME IN MY LIFE* it worked for me but it error for the youtuber :D 8:25
@jiyere
@jiyere 4 жыл бұрын
I keep getting this "Not found" error page The requested URL was not found on this server. anyone has a clue?
@akshayseth669
@akshayseth669 4 жыл бұрын
Same
@jiyere
@jiyere 4 жыл бұрын
@@akshayseth669 After reading my comment again I don't think I could even help myself... Can you tell me what action gets you this error? Maybe I can help, I don't have that issue no more
@akshayseth669
@akshayseth669 4 жыл бұрын
@jean I resolved it. In server name you have to add private ip of the server.
@jiyere
@jiyere 4 жыл бұрын
@@akshayseth669 Ok cool!
@sweetjs
@sweetjs 4 жыл бұрын
Hey Juriy, great video series, i think i've watched every video 3 or 4 times haha. But, did you mean to install and run Nginx as root? would it be "better" to install nginx as non-root user?
@rakeshpk4991
@rakeshpk4991 3 жыл бұрын
Nice intro music and good tutorial too. Thanks.
@hnasr
@hnasr 6 жыл бұрын
Hey Juriy great video as usual.. in 7:27 you used localhost because nginx is in the same server as nodejs correct? If Nodejs was on another server would you have used the ip instead? Question number 2, that being said how can I do this config dynamically? lets say my nodejs is hosted on ip address 192.168.1.100 then I add a new node js server on ip address 192.168.1.101 how can I scale nginx without editing this config file everytime? thanks again! we miss you here wish you post more videos or just talk randomly about software engineering topics .. btw you can answer this question in another video i think it will be useful as well..
@JuriyBura
@JuriyBura 6 жыл бұрын
For the first question - this is correct. For the second question, I haven't really heard of automated solutions, but they may exist. If you're starting to look into autoscaling groups it might make sense to look at something like AWS instead.
@josephkim4723
@josephkim4723 5 жыл бұрын
Juriy, thanks for these great tutorials! I have a question, can I add database to this configuration? In other words, would I be able to run Postgres, Node, and React all from one server? Would you recommend against it?
@JuriyBura
@JuriyBura 5 жыл бұрын
There's no problem in setting all these up on one host. React is just static files, Node you got covered in this tutorial series already, all you got to do is install Postgres.
@josephkim4723
@josephkim4723 5 жыл бұрын
@@JuriyBura awesome! thanks for the quick reply, really appreciate it. I'm gonna give it a try, hopefully it will go smoothly.
@JuriyBura
@JuriyBura 5 жыл бұрын
@@josephkim4723 Leave a comment if you'll need help, either myself or other subscribers will give a hand.
@abdelrahmansaeed9754
@abdelrahmansaeed9754 6 жыл бұрын
very interesting tutorial, thank you, can you give us tutorial about deployment multiple nodejs app on the same host ip address with different ports numbers
@tanishqasharma7
@tanishqasharma7 3 жыл бұрын
excellent video.
@noordeenm3561
@noordeenm3561 4 жыл бұрын
This is way good resource ... what to specify in place of server_name if i dont have any domain name. shall i use ip address there instead ?
@ambuj3
@ambuj3 5 жыл бұрын
please post a video on configuring nginx to pick up static html file in centos7 and host it over the local network. TIA
@ahmadbanijamali
@ahmadbanijamali 6 жыл бұрын
Great work! Keep it up. ThankS!
@pranavbhat92
@pranavbhat92 6 жыл бұрын
Excellent video... Thank you!!!
@juanpaul6141
@juanpaul6141 4 жыл бұрын
Great one
@mokanamedia
@mokanamedia 5 жыл бұрын
The plugin you are using in Safari, the one for the Network Stats and requests, used throughout like at 10:27, where does one get that?
@JuriyBura
@JuriyBura 5 жыл бұрын
That's standard DevTools for Chrome. You can open this panel with Comman + Option + J on Mac, or F12 on Windows.
@distro6077
@distro6077 5 жыл бұрын
6:46 "How did he delete that line so fast?" He ESC out of Insert mode and type "dd".
@martinwashington3152
@martinwashington3152 5 жыл бұрын
M.A.G.I.C and you ain't part of the circle :D it's just magic man!!
@paulgonzalez9893
@paulgonzalez9893 5 жыл бұрын
Are there any repositories needed instead of EPEL if I'm doing this in Ubuntu 18.04?
@mattiarasulo9934
@mattiarasulo9934 4 жыл бұрын
Hi @Juri! the final config repo url is broken! :)
@JKhalaf
@JKhalaf 6 жыл бұрын
This was great, thanks. Is there a video for how to configure ngnix for php, mysql (wordpress) ..etc?
@JuriyBura
@JuriyBura 6 жыл бұрын
Unfortunately not yet :) But that's a good idea to make one. With MySQL you don't have to do anything special with NGINX, they don't talk directly. With PHP it is a bit more interesting process. The best way to set it up would be through PHP-FPM and that includes configuring php-fpm itself, plus nginx to talk to it.
@JuriyBura
@JuriyBura 6 жыл бұрын
By the way, I moved from MySQL to MariaDB since Oracle got MySQL. MariaDB has exactly the same interface and works with exactly the same drivers, but don't have Oracle licensing issues.
@JKhalaf
@JKhalaf 6 жыл бұрын
Yes please, make one :) It is a very common issue, and n00bs like me find quality videos such as yours very helpful.
@JKhalaf
@JKhalaf 6 жыл бұрын
aye, I have MariaDb setup on my server, but I want to move from Apache to Ngnix, and I don't know how.
@segaboy9894
@segaboy9894 6 жыл бұрын
I want to use reverse proxy to say "service a:8083" is www.mydomain.com/servicea. I have failed so many times.
@siya_bong_a
@siya_bong_a 4 жыл бұрын
Hi thanks man this really helped me
@soldadopreciso
@soldadopreciso 3 жыл бұрын
hello pal, how set a FQDN and a static ip in my RHEL server? Like you have there, can anyone have a link to a tutorial?. Or how can we configure the typical parameters of a RHEL sever after a fresh installation?
@SivaRamachandran8990
@SivaRamachandran8990 7 жыл бұрын
When I am trying to start nginx service its showing error " Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. "
@prabhmeetsinghsarna1396
@prabhmeetsinghsarna1396 4 жыл бұрын
Brother were you able to resolve it?
@DarrensTechTutorials
@DarrensTechTutorials 6 жыл бұрын
I still don't have a clue if it's epel or E.P.E.L 😂
@sushantkoul7777
@sushantkoul7777 3 жыл бұрын
you didnt showed what is pm2 because i got the error command not found
@JGlezRg
@JGlezRg 6 жыл бұрын
hi man, thx for the tutorial but when i reach to 9:34 and the error triggers in my page i havent pm2 so i cant start it. is there any other way so i can use my nginx without pm2?
@JuriyBura
@JuriyBura 6 жыл бұрын
Yes, just start node.js process normally with screen or nohup, so that it does not terminate when you log off.
@rajeshchawla3571
@rajeshchawla3571 6 жыл бұрын
follow the steps and done with settings no error showing but not able to access URL without 3000 port
@ПетроКобзар
@ПетроКобзар 6 жыл бұрын
In my case I writed in conf file server_name: url of my site. But instead I was trying in browser my server Ip. (without port 8080) So by url I could get my site.
@TensaiTech
@TensaiTech 6 жыл бұрын
in your config file 7:27 try to use 127.0.0.1 instead of localhost
@socautomation3103
@socautomation3103 6 жыл бұрын
how to running nginx on browser ? please help me
@nikhilverma4976
@nikhilverma4976 6 жыл бұрын
I am not sure what you mean by web sockets. Can you elaborate?
@JuriyBura
@JuriyBura 6 жыл бұрын
developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
@haydermajli804
@haydermajli804 7 жыл бұрын
Hay Juriy When i try systemctl start nginx then back this error Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. PLZ HELP
@JuriyBura
@JuriyBura 7 жыл бұрын
I would suggest to do exactly what it says: run "journalctl -xe" and check the latest failure, it will tell you more about the root cause. Quite likely you just have an error in config syntax.
@haydermajli804
@haydermajli804 7 жыл бұрын
that because your node port 80... plz change to other port like 8080 and retry
@inkajoo
@inkajoo 6 жыл бұрын
I'm using a VPS on GoDaddy and can't figure out how to actually access my website with the browser. The hostname at the top of the page doesn't work. Can anyone give me some help?
@pindi251210
@pindi251210 6 жыл бұрын
Don't know your exact problem but you might want to look up SSH. It's how you connect to servers (your VPS), sorry if that's not what you asked.
@anhvuuc8693
@anhvuuc8693 4 жыл бұрын
Thank you so much but I dont know why my nginx not run :( Anyone have a link to read? st like step by step install nodejs :( run in local pc is dream, but run on VPS is a madnight
@whatthedoctype2565
@whatthedoctype2565 6 жыл бұрын
systemctl command not found i have centos 6
@barioualarou6008
@barioualarou6008 6 жыл бұрын
You should type Service nginx start
@whatthedoctype2565
@whatthedoctype2565 6 жыл бұрын
i made another server name for http and one for www. because it wasnt loading my website with www. is that right or wrong so what i did was make another server underneith
@JuriyBura
@JuriyBura 6 жыл бұрын
Basically yes, you add another "server" block and inside that block you redirect from WWW to regular non-www: server { server_name www.foo.com; return 301 $scheme://foo.com$request_uri; }
@arubachannel7426
@arubachannel7426 6 жыл бұрын
Error systemctl start nginx Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
@JuriyBura
@JuriyBura 6 жыл бұрын
Well, seems that something is wrong :) Do what the message suggests: run journalctl -xe and try to see if that helps to understand why exactly nginx wasn't happy.
@arubachannel7426
@arubachannel7426 6 жыл бұрын
Thanx i finde the problem. My VPS is 512 Mb of RAM and cant start NGINX
@JuriyBura
@JuriyBura 6 жыл бұрын
Hmm, that sounds very strange, 512Mb is plenty for Nginx. I'm quite sure that default configuration was starting just fine on 512 megs.
@arubachannel7426
@arubachannel7426 6 жыл бұрын
i don't know where i add more RAM {1GB } everything work great
@JuriyBura
@JuriyBura 6 жыл бұрын
Well :) then that's great that it worked at the end.
@codingdiva4906
@codingdiva4906 7 жыл бұрын
Hmm, my conf file looks much different. User is www-data. Also, I can't get anything to work on port 80, even though my netstat -tln says tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN . If i put my site on a port, it works fine, it just stubbornly won't server anything on port 80 (firewall is off so it's not that)...
@JuriyBura
@JuriyBura 7 жыл бұрын
Are you using CentOS and you use Digital Ocean installation? Distros may be slightly different across providers, so the config can be slightly different too. Can you tell a bit more about your system?
@kman889
@kman889 6 жыл бұрын
Well mine is a nodejs one click install running on ubuntu 16 and mine doesnt even have a server config. its all commented out
@JuriyBura
@JuriyBura 6 жыл бұрын
The configs on nginx can be slightly different on different installations (the initial default config that is available after an install). Yet the principles of organising those configs, and what each block does, remains the same. I published my configs that I used in this video here on github: github.com/Juriy/easyio
@whatthedoctype2565
@whatthedoctype2565 6 жыл бұрын
try and turn of apache because that runs on port 80 thats what i did and im good to go
@JustinDuijn
@JustinDuijn 3 жыл бұрын
Your saying Apple. It's pronounced E-pel.
@karmavil4034
@karmavil4034 3 жыл бұрын
Are you serious? Did you install Nginx to avoid run your app as root and you ended up running your app with sudo after 20 minutes of video? Jesus..
@JuriyBura
@JuriyBura 3 жыл бұрын
Where exactly am I running it as sudo?
@karmavil4034
@karmavil4034 3 жыл бұрын
@@JuriyBura Oh I'm so sorry, you're right, You were using root before and you switched to a standard user. Ok thanks for your reply
@threeone6012
@threeone6012 6 жыл бұрын
VIM is the worst program ever created by mankind. Install nano!
@JuriyBura
@JuriyBura 6 жыл бұрын
Text editor is a matter of choice really. I tried to become vim "power user" but I did not have enough patience to memorise all the hotkeys and go through all the plugins. Maybe I'll give it another try this year :)
@threeone6012
@threeone6012 6 жыл бұрын
haha! By the way I love the video and I'm using your format. I uninstalled Ubuntu and Apache and I installed CentOS and Nginx for my node.js backend. Thanks so much for your upload!
@RuchejAlex
@RuchejAlex 6 жыл бұрын
Юрий, ты вроде русский человек, неужели нельзя по русски говорить? Как этот английский напрягает. Нихрена не понимаю.
@JuriyBura
@JuriyBura 6 жыл бұрын
Так сложилось, что международный язык технологий - именно английский. Да и аудитория куда больше: вон тут сколько ребят из Индии, Штатов, Африки, даже несколько человек из Китая было, хоть у них стоит Большой Китайский Фаервол.
@RuchejAlex
@RuchejAlex 6 жыл бұрын
Это понятное дело, просто на русском тяжело найти что-то стоящее. А на анг. то можно выхватить слова, но не уловишь смысл.
@ПетроКобзар
@ПетроКобзар 6 жыл бұрын
Александр не вопрос, можете переводить видео Juriy Bura на русский. Или перевиложыть или через субтитры...
@dipendrachaudhary3601
@dipendrachaudhary3601 2 жыл бұрын
it shows this ``` # yum install nginx Last metadata expiration check: 0:17:45 ago on Wed 16 Feb 2022 12:57:09 PM UTC. All matches were filtered out by exclude filtering for argument: nginx Error: Unable to find a match: nginx ``` I have already installed epel-release ``` # yum install -y epel-release Last metadata expiration check: 0:18:24 ago on Wed 16 Feb 2022 12:57:09 PM UTC. Package epel-release-8-14.el8.noarch is already installed. Dependencies resolved. Nothing to do. Complete! ```
Proxying WebSockets with NGINX
8:25
Juriy Bura
Рет қаралды 71 М.
Kubernetes Cluster Setup Centos 7 | 100% Working | Tech Arkit
37:24
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 35 МЛН
这是自救的好办法 #路飞#海贼王
00:43
路飞与唐舞桐
Рет қаралды 121 МЛН
Proxy vs Reverse Proxy vs Load Balancer | Simply Explained
13:19
TechWorld with Nana
Рет қаралды 194 М.
Reverse proxy nginx letsencrypt tutorial
17:12
Christian Lempa
Рет қаралды 121 М.
Understanding Network Interfaces
15:45
Juriy Bura
Рет қаралды 60 М.
Configure NGINX as a Reverse Proxy
16:43
NGINX
Рет қаралды 222 М.
Configuring Nginx as a reverse proxy for Apache
11:05
Alex Grebeshkov
Рет қаралды 37 М.
AlmaLinux: Set up your Workstation Today!
46:11
Stephen's Tech Talks
Рет қаралды 10 М.
OpenSSH for Absolute Beginners
23:00
Veronica Explains
Рет қаралды 115 М.
How to configure Nginx as a Reverse proxy | Configuring with SSL
12:30
The NGINX Crash Course
50:53
Laith Academy
Рет қаралды 495 М.
"The Life & Death of htmx" by Alexander Petros at Big Sky Dev Con 2024
23:01
Montana Programmers
Рет қаралды 68 М.