Home > Backend Development > PHP Tutorial > How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

WBOY
Release: 2016-07-29 08:55:27
Original
1521 people have browsed it

What is the essence of the problem?

Generally, we use redhat system such as centos yum, debian system apt-get to install nginx. Generally, the sbin directory and conf directory are separated, so the security dog ​​cannot find the nginx directory, and it does not work when we enter the directory manually. (As shown in the picture below), because only one directory can be entered at a time, I have encountered this problem once before, on the centos server. At that time, cloud lock was used instead of the security dog. This time I explored the solution myself

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

So how did I solve it

The following takes ubuntu as an example

Since they are separated, can we merge them? (Using soft connections of course)

First look where are they?

whereis nginx
Copy after login

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

For example, we want to merge them in /usr/local/nginx

cd /usr/local/nginx/
sudo ln -s /usr/sbin/ ./sbin
sudo ln -s /etc/nginx ./conf
Copy after login

Then start the safe dog’s py installation script again

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

There is a new problem, it seems that nginx is down

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

Restart the server, but it still doesn’t work. Use the following command to check why it can’t be restarted

sudo nginx -t
Copy after login

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

Create it if it doesn’t exist

cd /usr/local/nginx
sudo mkdir logs
cd logs/
sudo touch error.log
sudo service nginx restart
Copy after login
How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

Open your own website to test it, it’s successful, haha~ ~~

How to install security dog ​​if the sbin and conf files of nginx are not in the same directory?

The above introduces how to install security dog ​​when the sbin and conf files of nginx are not in the same directory, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template