This document describes how to deploy Nginx projects on CentOS and is suitable for new individual users of Tencent Cloud.
The versions of software tools used in this document are as follows, which may be different from your software versions during actual operations.
# Install Nginx
yum -y install nginx
# View Nginx version
nginx -v
# View Nginx installation directory
rpm -ql nginx
# Start Nginx
service nginx start
/usr/share/nginx/html
. Modify the index.html
static page in the html
directory to mark the specialness of this page. Relevant operations are as follows:index.html
static page in html
:vim /usr/share/nginx/html/index.html
<body></body>
tag:# You are recommended to enter directly under `<body>`
Hello nginx , This is rs-1!
URL is index.html
:wq
to save the change./image
path. Relevant operations are as follows:image
directory:mkdir /usr/share/nginx/html/image
cd /usr/share/nginx/html/image
index.html
static page in the image
directory:vim index.html
Hello nginx , This is rs-1!
URL is image/index.html
:wq
to save the change.The default port of Nginx is
80
. To change the port, please modify the configuration file and restart Nginx.
Access the public IP and path of your CVM instance. If the deployed static page is displayed, Nginx has been successfully deployed.
index.html
page of rs-1
:/image/index.html
page of rs-1
:
Was this page helpful?