In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-10-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "CentOS7 how to add Nginx to system services", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "CentOS7 how to add Nginx to system services" bar!
View Servic
First check the service status of nginx, enter systemctl status nginx, and the result is as follows
If the relevant services are not found, the next step is to add system services.
Add system services
Add nginx.service to the / usr/lib/systemd/system directory and modify it according to the actual situation. For detailed analysis, see the article in Resources below. The contents are as follows
[unit] description=nginx-high performance web serverdocumentation= http://nginx.org/en/docs/after=network.target remote-fs.target nss-lookup.target [service] type=forkingpidfile=/usr/local/nginx/logs/nginx.pidexecstartpre=/usr/local/nginx/sbin/nginx-t-c / usr/local/nginx/conf/nginx.confexecstart=/usr/local/nginx/sbin/nginx-c / usr/local/nginx/conf/nginx.confexecreload=/bin/kill-s hup $mainpidexecstop=/bin/kill-s quit $mainpidprivatetmp=true [install] wantedby=multi-user.target
Let's take a look at it after it has been added.
Set the boot to start automatically
Test it first, restart it, and then check the nginx service
It didn't start. Enter systemctl start nginx to start
You can start with systemctl, indicating that there is no problem with the previously added nginx.service. Then enter systemctl enable nginx to set boot up
Finally, restart to check whether the setting is successful.
No problem, so the compilation and installation of nginx is complete, followed by the installation of php.
Thank you for your reading, the above is the content of "CentOS7 how to add Nginx to system services". After the study of this article, I believe you have a deeper understanding of how CentOS7 adds Nginx to system services, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.