Centos服务器下一些基本要用到的命令
<p><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>注意:这里只是基本的操作</span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>现在把这玩意发来,希望能和大家一起交流. </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>kill -HUP `cat /usr/local/nginx/logs/nginx.pid` 重启nginx; </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>将某个目录下的子目录和文件权限一次性更改的方法 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>使用命令:</span><font color="#ff0000" style='line-height: 25.2px; font-size: 14px; font-family: tahoma, arial, "Microsoft YaHei";'>chmod -R 777 目录名 </font><br><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>当php.ini没有生效时,可以重启: </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000" style='line-height: 25.2px; font-size: 14px; font-family: tahoma, arial, "Microsoft YaHei";'>/usr/local/php/sbin/php-fpm restart <br>
whereis 目录名 查找文件</font><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'> </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>跳转目录:</span><font color="#ff0000" style='line-height: 25.2px; font-size: 14px; font-family: tahoma, arial, "Microsoft YaHei";'>cd 目录名</font><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'> </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>如:cd/usr/local 即跳转到usr下的local目录中 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>添加一个新的站点:(以centos下的LNMP环境一键安装中的环境为例) </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>编辑nginx.conf </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><font color="#ff0000" style='line-height: 25.2px; font-size: 14px; font-family: tahoma, arial, "Microsoft YaHei";'>vi /usr/local/nginx/conf/nginx.conf</font><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'> </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>找到最后一个”}“,在之前加入</span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
server<br>
{<br>
listen 80;<br>
server_name 绑定域名1 绑定域名2;<br>
index index.html index.htm index.php;<br>
root 网站目录位置;<br>
location ~ .*\.(php|php5)?$<br>
location = /404.html { <br>
root /你的网404错误目录/; <br>
}<br>
{<br>
fastcgi_pass unix:/tmp/php-cgi.sock;<br>
#fastcgi_pass 127.0.0.1:9000;<br>
fastcgi_index index.php;<br>
include fcgi.conf;<br>
}<br>
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$<br>
{<br>
expires 30d;<br>
}<br>
location ~ .*\.(js|css)?$<br>
{<br>
expires 12h;<br>
}<br>
access_log off;<br>
}</p>
<p>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>然后按下Esc,输入大写ZZ即可完成保存操作 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>即可完成添加站点.</span></p>
頁:
[1]