The existing nginx.php script controls Nginx.
If there is a start, stop, restart, and so on.
PHP and Nginx are not root privileges.
With the EXEC system function,
Some of the basic LS CP commands are no problem.
Kill-int ' Cat/usr/local/nginx/logs/nginx.pid ';
How to test can not be executed.
Cat/usr/local/nginx/logs/nginx.pid is no problem, the kill command can't be executed,
Estimated kill permission problem, do not know how to do.
There is also the assumption that the nginx can be stopped. That nginx.php oneself can not run, is to be on the server to start Nginx.
To ensure that the nginx.php can operate properly, how to handle it better?
Do you want a new opening, a process or something?
A friend with experience in this field is pointing out.
Or Daniel to give some information to learn.
------Solution--------------------
http://www.osseye.com/?p=295
The article I'm looking for helps.
------Solution--------------------
is also the authority problem, deserves attention, waits for solves ~ ~
------Solution--------------------
chmod 755 Try
------Solution--------------------
Writing a shell and then using PHP to invoke the shell is possible?
I wipe the BB machine ... Think of the elder brother 1500 of the Chinese Yun-message BB machine in the belt more dazzling ...
------Solution--------------------
Of course, it's not working through the Web interface--。。
Write a PHP script that uses SSH to operate the remote server to perform nginx restart shutdown, and related interfaces:
HTTP://CN.PHP.NET/SSH2, the server sshd service opens.
In this case, the permissions will be associated with your SSH user and the command can be executed with the appropriate user ssh.
Synopsis
#include
int Kill (pid_t pid, int sig);
For a process to which the permission to send a signal to a process designated by PID, unless the sending process has Appropria Te privileges, the real or
Effective user ID of the sending process shall match the real or saved Set-user-id of the receiving process.
This is the permission problem of kill, either you are root, or you are the same as the real user ID of the nginx process, either with the Nginx process save set User ID, you should be able to implement.
------Solution--------------------
From the Nginx C source implementation angle, the master process is root startup, its actual user ID is the file owner, if the master bind Gen Y setuid cut to another valid user ID, then savfed set-user-id will be root.
So if you want to kill Nginx, you either SSH as root, or nginx is the primary identity of the binary file ssh, both of which can achieve kill.
Nothing else, don't look at your nginx configuration file written in the work of users and workgroups, are not rights, they are nginx worker process setuid lower permissions to use.
------Solution--------------------
discuss
This ssh2 also know a little bit, this is to telnet it? The password to root:
I'm writing to someone else to provide the root password as if it's not quite right.
Reference:
Of course, it's not working through the Web interface--。。
Write a PHP script that uses SSH to operate the remote server to perform nginx restart shutdown, and related interfaces:
HTTP://CN.PHP.NET/SSH2, the server sshd service opens.
In that case, the permissions will be with your SS ...
And can you say the method mentioned in the building?
Reference:
Reference:
This ssh2 also know a little bit, this is to telnet it? The password to root:
I'm writing to someone else to provide the root password as if it's not quite right.
......
------Solution--------------------
Do not know what problem you have encountered?
Nginx, like other software that provides continuous service, needs to be initiated by an administrator-level user, or the service will stop once the user logs off.
You said to manipulate nginx with nginx.php feet.
From the nginx.php file name, it should be web-run
But when Nginx stops, how does nginx.php work?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service