Text content
The article about installing nginx on centos was posted earlier. . . I won’t go into details here anymore, I don’t know how to find information
Use commands to view services
netstat -anpt | grep nginx

Then edit the nginx configuration file, you need to modify the parameters.
vim /usr/local/nginx/conf/nginx.conf

Refer to this picture for modification parameters, which can be customized.
# Add a new module
 server {
  listen    80;
  server_name www.juzhen.com;
  charset utf-8;
  location /{
   root /var/www/juzhen;
   index index.html index.htm;}}
# The following is to modify the original configuration file
 server {
  listen       8080;
  server_name  www.zizhen.com;
  charset utf-8;
  # charset koi8-r;
  # access_log  logs/host.access.log  main;
  location /{
   root   /var/www/zizhen;
   index  index.html index.htm;}
Then modify it in the local analysis directory.
vim /etc/hosts

Change the IP address to your own, don’t write yours!
Create the corresponding website file
# This is the website file of juzhen
mkdir -p /var/www/juzhen
cd /var/www/juzhen
vim index.html
# This is zizhen's website file
mkdir -p /var/www/zizhen
cd /var/www/zizhen
vim index.html
carry out testing


Based on the IP method, you can search for information by yourself, so I won't talk about it here.
Recommended Posts