How to Host Multiple WordPress Websites on One Server with Nginx

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • Learn how to host multiple websites on a single IP address or server. This video will teach you the Nginx configuration settings necessary to run many WordPress websites on one hosting plan, each with their own domain name.
    Need an Nginx LEMP server? • How to Install a LEMP ...
    Find more at tonyteaches.te...
    Check out my vlog channel ‪@TonyFlorida‬
    #nginx #wordpress

ความคิดเห็น • 127

  • @vanvuite7307
    @vanvuite7307 3 ปีที่แล้ว +1

    I thought Superman was only in a movie, you just proved we have a living Superman - I found you now! thank you!

  • @helmholtzwatson8884
    @helmholtzwatson8884 3 ปีที่แล้ว +1

    Thanks for a great tutorial. I'm just starting to explore nginx and this is very useful. In case you don't know, the problem you had with vim not replacing all instances of 'site2' in site3.xyz.conf is probably due to you using search and replace the same way copying site1.xyz.conf to site2.xyz.conf. The way you wrote it, it only changes the first instance on a line. That's why you had a 'site1' left over. To replace all instances, use the global tag: ':%s/site1/site2/g' That error got carried over to site3.xyz.conf. You fixed that but you may still have the original error in site2.xyz.conf if you haven't already fixed it.

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Yeah you're right! The find and replace command should have been.... %s/site2/site3/g
      Thanks for the feedback on the video! I have a bunch of other Nginx videos on my channel th-cam.com/channels/WPJwoVXJhv0-ucr3pUs1dA.htmlsearch?query=nginx and I'm working on some new Nginx videos right now!

  • @ShibuHara
    @ShibuHara 3 ปีที่แล้ว +3

    This was super helpful, thank you! I like that you leave your little stumbles in the video too, makes you come across as very likable and approachable :) Subscribed!

  • @harmonymoyo4420
    @harmonymoyo4420 ปีที่แล้ว

    Man you're such a great teacher, thank you for the clear explaination and nice clear step by step demo.

  • @mohamedtadwala0
    @mohamedtadwala0 ปีที่แล้ว

    Hi Tony. You know whenever you doing videos and you are using the terminal, I suggest that you keep the terminal a bit up. Because when I pause the video to see the command. the TH-cam bar comes up and blocks the view. To understand better watch this video and then pause the video at 10:23 and you will know what I am talking about. By the way great tutorial videos. keep it up.

    • @TonyTeachesTech
      @TonyTeachesTech  ปีที่แล้ว +1

      Thanks, others have pointed this out and my newer videos have been adjusted accordingly. Sorry for the inconvenience!

  • @NagenderGiri
    @NagenderGiri 3 ปีที่แล้ว

    you stumbled for writing privileges... i loved that... and on that tone.. subscribed

  • @DappledJoker
    @DappledJoker 10 หลายเดือนก่อน

    😃 Thank you so much! Really helpful. Would you please consider in future videos that involve a CLI, placing your monitor feed to the top right of the video so that we can see the whole command you enter? It's blocked when your monitor feed is in the lower right.

  • @GabrielBarbosa-yp4vy
    @GabrielBarbosa-yp4vy ปีที่แล้ว

    Following the idea of this video, I would love to watch another video from you giving a deeper explanation about how you configured nginx and mysql =)

  • @alexk9513
    @alexk9513 3 ปีที่แล้ว +2

    Hi, 很高興在你的頻道上學了很多知識, 謝謝你, 看了你的 BLOG 歡迎你到台灣來旅遊.

  • @donny533
    @donny533 9 หลายเดือนก่อน +1

    so every site needs its own WP? not something like, a vim for all users?

  • @hassamulhaq7762
    @hassamulhaq7762 ปีที่แล้ว

    I use virtualmin as free cPanel alternative with Nginx. Using this we can manage multiple sites, mails and all features of a control panel.

  • @khalidelgazzar
    @khalidelgazzar 3 ปีที่แล้ว +2

    Great video .. a small glitch in 9:30 where the conf file contained site2 by mistake which needs to be changed to site2 as well. Still a great video

  • @Matfi93
    @Matfi93 9 หลายเดือนก่อน

    Thank you Tony!

  • @kernag7688
    @kernag7688 2 ปีที่แล้ว

    Tony, can you please make a video on how to pull down an application from git on new Vultr server?

  • @_zh3ro_
    @_zh3ro_ 3 ปีที่แล้ว +1

    GREAT video! Thank you so much!

  • @andersonfornalski1944
    @andersonfornalski1944 3 ปีที่แล้ว

    Tony, você me salvou, obrigado pela ajuda, estava com muitos problemas aqui, sou brasileiro e nao achei nenhum video aqui para me ajudar!!
    ==============================================================
    Tony, you saved me, thanks for the help, I was having a lot of problems here, i`m brasilian e nao achei nenhum video aqui para me ajudar!!

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      You're welcome. Thanks for watching :)

  • @chenghuayang8273
    @chenghuayang8273 3 ปีที่แล้ว +1

    May I ask if I build sites by Docker with different WordPress container, and use Nginx to direct to different port # in VPS, is there any difference between this and your way?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +1

      I'm not familiar enough with Docker to answer that

  • @KaydotOrigin
    @KaydotOrigin 3 ปีที่แล้ว +1

    This would be a top notch tutorial and educational video if it was complete. But there is no SSL here, theres no mention of the loss of encryption between the proxy and the site and how to do this in production not local development

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +2

      I have a few other videos on this channel in regards to setting up SSL on Nginx

  • @lylefabian1691
    @lylefabian1691 ปีที่แล้ว

    Hello Tony, I'd like to see how Nginx and WordPress can be installed on an UnRaid server via docker? I've been searching for ways of getting this done but found no real step by steps tutorials.

  • @NagenderGiri
    @NagenderGiri 3 ปีที่แล้ว

    your nginx video is really fantastic..i love your work.. but also,, could you do this on podman container with specific port..that'll be good to know

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      I'm not familiar with podman containers, what's that?

  • @metamask0x
    @metamask0x 7 หลายเดือนก่อน

    How do i host different website using the domainname but different ports ? one is port 80 another is port 5080 ?

  • @TobyDunn-jd1jl
    @TobyDunn-jd1jl ปีที่แล้ว

    Well done!

  • @SamiKhan-fd8gn
    @SamiKhan-fd8gn ปีที่แล้ว

    Tony I have a question, I have configured multiple sites in this way. How do I install an SMTP server in this machine which can server all of these sites.

  • @kapitankidlattv9613
    @kapitankidlattv9613 ปีที่แล้ว

    Tony, god day, how can we get rid of the extra /wordpress/ directory?\

  • @mohamednabil542
    @mohamednabil542 ปีที่แล้ว

    Hi Tony, thanks for this great video, after following the steps and at the point of having the WP installation starts, the setup screen is not showing instead I have a pop-up asking me to download the install.php file. Note that, the first site is working with no issue, the second one is having this issue (I have only 2 sites) any help on this? Thanks

  • @blackiek7
    @blackiek7 2 ปีที่แล้ว

    Hi Tony, can we connect a cpanel like hestia with the oracle free tier? I’m using a mac but i can’t seem to understand how to generate a private key from the ssh using terminal putty gen command. Would you be able to do a video tutorial on this?

  • @berthasebastian1490
    @berthasebastian1490 ปีที่แล้ว

    Hi Tony, I was wondering if you could give me your thoughts on using this approach (linode) to host wp sites than other web hosters such as siteground, bluehost and the myriad of others? One cheapest server could be $5/mo on linode but for siteground at least, my yearly cost comes to $300ish. In my understanding, I could save a lot just by doing this approach. Thanks!

  • @mluevanos
    @mluevanos 4 ปีที่แล้ว +1

    How would I get a Node.js App and Wordpress running on Ubuntu Digital Ocean?

    • @TonyTeachesTech
      @TonyTeachesTech  4 ปีที่แล้ว

      Digital Ocean has some of the best tutorials available for so many different hosting topics. Check this one out for your specific setup... www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04
      You would simple set up WordPress as instructed in this video and then create another directory (/var/www/nodejsapp/ for example) and edit your Nginx configuration file to point to that path.
      Does that make sense?

    • @kyuna4843
      @kyuna4843 3 ปีที่แล้ว

      th-cam.com/video/B62QSbPhh1s/w-d-xo.html

  • @sokhakho7154
    @sokhakho7154 3 ปีที่แล้ว

    sir, may you tell me about Nginx and caddy webserver which is better I should use for my web hosting?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      I don't know much about Caddy, sorry

  • @DOCGaming911YT
    @DOCGaming911YT ปีที่แล้ว

    do you have video on how to install cloudpanel?

  • @magicyvan
    @magicyvan 2 ปีที่แล้ว

    Hi Tony, thanks a lot, I'm beginner but I love this possibility ! I would love to help friends and host their WP websites. Would it be more efficient to use dockers for each new website to deploy ? and for the ssl also ? Thanks

  • @soldadopreciso
    @soldadopreciso ปีที่แล้ว

    5:09 But if i want to use my normal user and not root, How can we do?

  • @tiosing_eduard1
    @tiosing_eduard1 3 ปีที่แล้ว

    so if I run a multiple website on one web server it will means all website I link in on my web server is shared on the capacity of the web server storage disk? I hope you understand what I mean... Couse I was now good in English... thank you so much for sharing informative video tutorial!!! I love it!!!

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Thank you very much. To answer your question: yes when you have multiple websites on the same server, the storage capacity as well as the processing power is shared between all websites on the server.

  • @KentJudeBeldeniza1818
    @KentJudeBeldeniza1818 3 ปีที่แล้ว +1

    Thanks for this!

  • @SprintsNClimbs
    @SprintsNClimbs ปีที่แล้ว

    Just to share an issue I had when getting a 403 Forbidden error. The autoindex module didn't seem to be working which apparently allows Nginx to generate and serve an index of the files and directories within a given directory if an index file (like index.html or index.php) is not present. Without this module, Nginx will return a "403 Forbidden" error when it is asked to serve a directory without an index file. So to fix this I just added the following line in my .conf file 'index index.php index.html index.htm;' after the server_name line. Hope this helps someone

    • @zagamerx7348
      @zagamerx7348 ปีที่แล้ว

      Hey there, i got this error too... Which config file you mean? Nginx.conf or site.xyz.conf or the default in sites available

  • @kapitankidlattv9613
    @kapitankidlattv9613 2 ปีที่แล้ว

    Tony, can this procedure be applied to say hmm different type of site, say one site is WP, then I have web app in python+ django. Or is this exclusively for WP sites only?

  • @sarvagyamaithani2093
    @sarvagyamaithani2093 2 ปีที่แล้ว

    how did you get the conf file for site 1 & 2 directly on the sites-available directory. I only have the default one there. Can I copy that with a new name for my website

  • @jinu.freelance
    @jinu.freelance 3 ปีที่แล้ว

    What kind of language is used to get these this..? How can i learn what to type and do this..?

  • @atulhostvideos
    @atulhostvideos 4 ปีที่แล้ว +2

    Salt keys are nothing but a secure way of encrypting logged in sessions.

  • @irmscher9
    @irmscher9 3 ปีที่แล้ว

    Is there any benefit of serving Wordpress with Docker? Or does Nginx has to be dockerized then as well?
    PS. Thanks a lot for this very useful video by the way :)

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Not sure, I'm not too familiar with Docker yet

  • @akramsuleyman1567
    @akramsuleyman1567 2 ปีที่แล้ว

    You forgot to put the global option '/g' on the substitute command in vim that's why 'site1' wasn't changed :)

  • @Than3Dane
    @Than3Dane ปีที่แล้ว

    Hey Tony, I'm almost done setting up my two websites on each their raspberry pi on the same public ip using your guidance so far.
    First site and server runs fine when port forward routed on the router, I routed that to the second site, messed around with reverse proxy/load balancing, trying to redirect access to 1st site server, but suddenly site 2 would load a result. Now both sites are setup with wordpress, but I just cannot figure out how to route the connection from site 2 to site 1. They each have their own specific domain address

    • @Than3Dane
      @Than3Dane ปีที่แล้ว

      on site 2 which should act as the proxy, I have 3 .conf files one for each domain and one for the proxy settings, when I edit and I'm looking at the .conf file which belongs to site 1, I can see changes on load, but theres a conflict either with finding content or ssl, depending on what changes I make.
      So that proves there is atleast a connection going on, they are interacting/communicating, just a small hiccup I suppose. If you have a moment, I'm all ears & eyes! Merry Christmas

  • @ChrisMinardi
    @ChrisMinardi 3 ปีที่แล้ว

    Hey Tony, great video! Followed all of the steps to a T, but I'm getting a Bad Gateway error. Any easy fix for that? Thanks!

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      This is usually an issue with the "upstream" server. Are you sure that your PHP FPM socket exists at /var/run/php/php7.2-fpm.sock ? Perhaps you have a different version of PHP installed.
      Please let me know if that helps or if that doesn't make sense.

  • @yangjiao9136
    @yangjiao9136 3 ปีที่แล้ว

    Thanks for the tutorial! I have a question. I already installed a wordpress using the WordPress Application on a Vultr vps, and I was trying to add another wordpress site to the same server. By 8'57" of the video, after I typed "/etc/nginx# cd sites-available/", the terminal told me "No such file or directory" . I suddently don't know what to do. Should I create a directory? Any help is appreciated!

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Try to access the directory with an absolute path:
      cd /etc/nginx/sites-available/

  • @petertremblay3725
    @petertremblay3725 ปีที่แล้ว

    Hi Tony, does nginx root have to be var/www since i was trying to point the root to /home/username/website_01 and it doesn't load the page?

  • @seopostoffer205
    @seopostoffer205 3 ปีที่แล้ว

    Hi Tony ,How to install Wordpress on docker compose and using Nginx web server. Please advice thank you so much.

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Hi, I am not yet familiar with docker. Soon though :)

  • @karaipantsu9973
    @karaipantsu9973 3 ปีที่แล้ว

    Great video! So how do you transfer files from hard drive into the nginx environment? Would rsync work in this case?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +1

      Yes, you could use rsync. SCP is another option:
      - If you are on Mac/Linux: th-cam.com/video/q2OHvlr081s/w-d-xo.html
      - If you are on Windows: th-cam.com/video/w1Tqr7Wk5aU/w-d-xo.html

    • @karaipantsu9973
      @karaipantsu9973 3 ปีที่แล้ว

      @@TonyTeachesTech ah very nice! Thank you! And the curly thing at prompt is a "tilde" hehe

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      @@karaipantsu9973 Sure thing Melanie. Yes, that's it 😉

  • @satishkumarojha5377
    @satishkumarojha5377 3 ปีที่แล้ว

    Do I have to install phpmyadmin separately for each individual WordPress...?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      No, you'll only need one install of phpmyadmin for multiple websites

  • @abelmurua6980
    @abelmurua6980 3 ปีที่แล้ว

    Thanks for the video. How many websites can I host under a VPS doing this? Is this like "messing with the server" or its how it's supposed to do it? I am new to this and I am moving from Cloud Server to VPS

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      This is a very legit thing to do. It's not messing with the server. You can host many websites like this on a single server. I don't have an exact number. This will depend on the RAM and CPU of your VPS

    • @abelmurua6980
      @abelmurua6980 3 ปีที่แล้ว

      @@TonyTeachesTech thanks, I appreciate your answer.

    • @afelfemale
      @afelfemale 3 ปีที่แล้ว

      @@TonyTeachesTech Hey Tony, how does Hosting Multiple WordPress Websites on One Server with Nginx effects SEO ranking? Do have experience with this? 😊 Is it safe?

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      @@afelfemale There's no effect on SEO rankings

  • @axelrocky5372
    @axelrocky5372 3 ปีที่แล้ว

    thank you a lot that's a valuable lesson for me, just have 1 question, i do everything as you did step by step, but i have a 403 error forbidden, i google it and it seems like to be that nginx doesnt found an index.php file, but is there inside my wordpress directory hummmmm so iam still looking for that thank you again :D

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว +1

      Can you confirm that the index directive in your Nginx config file is index.php (not index.html) and your root directive in your Nginx config file is the full path to WordPress?
      Another issue might be permissions...
      find /var/www/html/ -type d -exec chmod 755 {} \;
      find /var/www/html/ -type f -exec chmod 644 {} \;
      Please let me know if one of those works for you.

    • @axelrocky5372
      @axelrocky5372 3 ปีที่แล้ว

      @@TonyTeachesTech after a couple of days, it finally finds it, I have checked the permissions and paths as you suggested, then I found it to be the ownership, which was as nobody: nogroup change it to root and voila! Thank you Tony :D

    • @themobileinternet991
      @themobileinternet991 2 ปีที่แล้ว

      I had the same error, permissions were fine, but I did have to add index index.php in my wesite.conf file, that seemed to fix it.

  • @rayoseldev819
    @rayoseldev819 3 ปีที่แล้ว

    I have permission acces problem
    You don't have permission to access / on this server.

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      This sounds like you will need to prefix your commands with sudo or use a different user that has the appropriate permissions.
      BTW, why do you need permissions to access /? You shouldn't be creating or modifying anything in the root of your server

    • @rayoseldev819
      @rayoseldev819 3 ปีที่แล้ว

      @@TonyTeachesTech I put the server in conf.g and all works

  • @dhiyaaulauliyaa3988
    @dhiyaaulauliyaa3988 4 ปีที่แล้ว

    I get "Error establishing a database connection". I can assure that the mysql db, user, and password not wrong. anybody has experienced this?

    • @TonyTeachesTech
      @TonyTeachesTech  4 ปีที่แล้ว

      At what point do you get this error?

  • @christopherrimplington3643
    @christopherrimplington3643 2 ปีที่แล้ว

    Same video but in "non-nerd" would be great

    • @TonyTeachesTech
      @TonyTeachesTech  2 ปีที่แล้ว +1

      Haha sorry that's just the nature of the topic

  • @aldrinwong6160
    @aldrinwong6160 7 หลายเดือนก่อน

    Title is misleading. Should say how to add another website to a previously hosted server using Nginx. All you did is copy and paste what you had in the server already.

    • @Kaotix_music
      @Kaotix_music 4 วันที่ผ่านมา

      ‘How to host multiple Wordpress websites on nginx” what’s so misleading about that? He literally showed how to have multiple websites, based on Wordpress, on the same server. If you want to take a website and migrate it, follow his steps, make a Wordpress for the new site, and go on the ‘previous hosted site’ and download all its contents, but it in the new one you made, changed the A records for the domain, you’re done. But you assumed this was a migration tutorial, when it showed how to start a ‘new’ site…but some rules apply just use Wordpress import/export feature to take from the old and put on the new

  • @quissy5923
    @quissy5923 2 ปีที่แล้ว

    use open windows we are not all coders stressed!!

  • @FabioGMartinez
    @FabioGMartinez 2 ปีที่แล้ว

    Amazing. Are you human? 😁 thanks

  • @finnteuwsen3789
    @finnteuwsen3789 3 ปีที่แล้ว

    403 forbidden

    • @TonyTeachesTech
      @TonyTeachesTech  3 ปีที่แล้ว

      Please see this video to solve the 403 error th-cam.com/video/01T5JJGW4_c/w-d-xo.html

  • @dj786jojo
    @dj786jojo ปีที่แล้ว

    hi tony, thx for you tutorial, but i have question
    iI followed your tutorial and missed nothing
    but I run into my website
    403 Not Found
    nginx/1.18.0 (Ubuntu)
    maybe you can give info why it happened
    i placed the file in
    /var/www/html/mydomain.tld
    conf file in
    /etc/nginx/sites-available/mydomain.tld.conf
    then i link
    ln -s /etc/nginx/sites-available/mydomain.tld.my.id.conf /etc/nginx/sites-enabled/

  • @GiridharVedula
    @GiridharVedula 2 ปีที่แล้ว

    Who to do with Joomla. (Joomla, Nginx, CentOS, MariaDB

  • @paperlanes07
    @paperlanes07 3 ปีที่แล้ว

    How can I do this using docker containers and nginx proxy?