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
Vue+Openlayer uses modify to modify elements. The...
MySQL's CAST() and CONVERT() functions can be...
The database I use is MySQL database version 5.7 ...
Table of contents 1. Check the status of the serv...
Copy code The code is as follows: <form action...
There are two types of scheduled tasks in Linux s...
The solution to the problem that Ubuntu 18.04 in ...
Method 1: Use the lsb_release utility The lsb_rel...
This article mainly introduces how to evenly dist...
Table of contents 1. ES syntax getter and setter ...
Preface This tutorial installs the latest version...
123WORDPRESS.COM provides you with the FileZilla ...
I recently made a file system and found that ther...
Table of contents Overview Virtual Dom principle ...
The execution relationship between the href jump ...