Some basic commands under CentOS server

Time:2021-12-3

Note: This is only a basic operation. For the installation environment, see:One click installation in LNMP environment under CentOS system
Now send this thing, hoping to communicate with you

Kill – HUP ` cat / usr / local / nginx / logs / nginx. PID ` restart nginx;
Method of changing subdirectories and file permissions under a directory at one time
Use command:Chmod – R 777 directory name
When php.ini does not take effect, you can restart:
/usr/local/php/sbin/php-fpm restart
Where is directory name lookup file

Jump to directory:CD directory name
For example, CD / usr / local will jump to the local directory under usr
Add a new site: (take the LNMP environment under CentOS as an example)
Edit nginx.conf
vi /usr/local/nginx/conf/nginx.conf
Find the last “}” and join before

Copy code

The code is as follows:

server
{
listen 80;
server_ Name bind domain name 1 bind domain name 2;
index index.html index.htm index.php;
Root website directory location;
location ~ .*\.(php|php5)?$
location = /404.html {
Root / your network 404 error directory /;
}
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}

Then press ESC and enter capital ZZ to complete the save operation
You can finish adding the site