ウェブサイトとアプリケーションをホストするために、Ubuntu 22.04 に Nginx ウェブ サーバーをインストールして構成します。
This comprehensive guide will walk you through installing Nginx on Ubuntu 22.04. Follow these steps carefully to ensure a successful installation.
First, ensure your system is up to date:
sudo apt update
Install required dependencies:
sudo apt install curl gnupg2 ca-certificates lsb-release ubuntu-keyring -y
Now install Nginx using the package manager:
sudo apt install nginx -y
Start the Nginx service and enable it to run on boot:
sudo systemctl start nginx
sudo systemctl enable nginx
Edit the configuration file located at /etc/nginx/nginx.conf:
sudo nano /etc/nginx/nginx.conf
Check that Nginx is running correctly:
sudo nginx -t
sudo systemctl status nginx
Congratulations! You now have Nginx running on Ubuntu 22.04. For additional configuration options, refer to the official Nginx documentation.