By default, PHP on CentOS 7 runs as apache or nobody. This method requires large permissions to run PHP, which may pose a security risk and may also be affected by other users of the server. View the PHP information through phpinfo as follows: apache runs php As you can see, PHP is currently running as part of Apache, rather than running a separate process for each script. If you want PHP scripts to run as the current user instead of Apache, you can do this by deploying suPHP. Next, we will introduce how to install suPHP on CentOS 7. First configure the environment required to install suphp:
Download suphp installation package:
Download and install the suphp patch:
Run ./configure:
Compile and install:
Create suphp.conf in the Apache configuration directory
And write:
Create the suphp.conf configuration file in the /etc directory:
And write the configuration file content as follows:
If you want the domainname directory to run as user user, then change the directory owner property to user, as follows:
Finally, find the corresponding domain name in the Apache configuration file and enable suphp:
Finally restart Apache file. Through the info.php test, we can find that the Server API running the domain name has changed from Apache to CGI/FastCGI, as shown in the following figure: At this point we have completed CentOS's domain name access settings to run through suph instead of the default Apache Handler. Other domain names need to be set up. Just follow the above steps again. You may also be interested in:
|
<<: MySQL 8.0.16 installation and configuration graphic tutorial under macOS
>>: An in-depth introduction to React refs
Table of contents Set is a special collection who...
Table of contents Preface: Kind tips: variable 1....
Mysql 8.0 installation problems and password rese...
The default ssh remote port in Linux is 22. Somet...
Table of contents 1. Vue Overview Vue official we...
The image can be easily pushed directly to the Do...
Table of contents Preface What is DrawCall How do...
The outermost boxF rotates 120 degrees, the secon...
Preface Introduction Lombok is a handy tool, just...
Purpose: 1. In order to map the server's exte...
Preface The so-called fuzzy query is to provide q...
Preface: When we are making web pages, we often n...
Problem description: When inserting Chinese chara...
introduction When I was learning more about datab...
I recently made a file system and found that ther...