Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic commands used in the Centos server?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What are the basic commands used in the Centos server? in order to solve this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Note: this is only a basic operation. For the installation environment, please see: one-click installation of LNMP environment under centos system

Kill-HUP `cat / usr/local/nginx/logs/ nginx.pid` restart nginx

The method of changing the permissions of subdirectories and files under a directory at one time

Use the command: chmod-R 777 directory name

When php.ini does not take effect, you can restart:

/ usr/local/php/sbin/php-fpm restart

Whereis directory name lookup file

Jump directory: cd directory name

For example, cd/usr/local jumps to the local directory under usr

Add a new site: (take the environment in one-click installation of LNMP environment under centos as an example)

Edit nginx.conf

Vi / usr/local/nginx/conf/nginx.conf

Find the last "}" and join before

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 site directory location

Location. *\. (php | php5)? $

Location = / 404.html {

Root / your net 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 uppercase ZZ to complete the save operation.

You can finish adding the site.

The answers to the questions about the basic commands to be used in the Centos server are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report