In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Nginx server binding domain name and setting root directory is very convenient, first enter the nginx installation directory, and then execute vim conf/nginx.conf to open the nginx configuration file, find
server { ..... ..... }
This code segment, this code is used to configure the corresponding site, first we should resolve the domain name to the IP address of our server in the domain name control panel, and then the binding can take effect.
First find the server_name item in our code snippet and then change the domain name behind it to the domain name we want to bind
root This item is the specified root directory. Set it to the directory we specify.
What if we want to bind multiple domain names, or various secondary domain names, such as hao., tools. Such a secondary domain name; first or the domain name resolution to the server, and then copy the whole above server{} code segment repeated paste into the following, so that the construction of multiple servers is multi-site configuration, pay attention to copy the whole, braces to be symmetrical, and shell script braces and the previous statement must have spaces or newlines, this is very important such as server {or if () {and so on must pay attention to, the rest are easy to understand; Of course, many integration packages will set a code such as vhost in the same directory as the configuration file nginx.conf. For binding multiple domain names, set multiple configuration files, such as aa.conf, bb.conf, and then use include vhost/*.conf in nginx.conf; all introduced, the introduction is equivalent to all code written in nginx.conf, and do not consider the relationship between other directories, all subject to nginx.conf, so convenient management, such as aa.conf;
Other rule configurations can also be managed uniformly by creating multiple files as above. Save and exit after all configurations are completed, and then restart the server to take effect.
In addition, listen specifies the site port. You can customize the configuration without conflict. Server_name specifies the domain name, index specifies the default home page, and root specifies the root directory. In this way, these basic configurations can be mastered.
The above is all the content of this article, I hope to help everyone's study, but also hope that everyone a lot of support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.