CentOS系统维护手册_linux系统维护手册
CentOS系统维护手册由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“linux系统维护手册”。
CentOS维护手册
※ 启动系统Web服务:
# ulimit-SHn 65535 # php-fpm start # nginx # /etc/init.d/mysqld start
其它相关指令:
php-fpm {start | stop | quit | restart | reload | logrotate} nginx-s {reload | start | stop}
※ 系统Web服务配置:
[Nginx] Nginx的配置目录 /usr/local/nginx/conf
[Nginx] Nginx的Host表 /usr/local/nginx/vhosts
[PHP] PHP的配置文件 /usr/local/php/etc/php.ini
※ 系统使用说明:
[CentOS] 删除当前目录下所有文件
ls | xargs-i rm-rf {}
[MySQL] 清除mysql-bin.0000X 日志文件 # mysql-u root –p mysql> reset master;
[CentOS] 查看文件夹下子目录的大小 # du-h /www.daodoc.comp_level 2;gzip_types
text/plain application/x-javascript text/c application/xml;gzip_vary on;i on;i_silent_errors off;i_types text/shtml;#limit_zone crawler $binary_remote_addr 10m;server listen
80;server_name 192.168.16.32;index index.shtml index.php index.html index.htm;root /www/htdocs;location ~.*.(php|php5)?$
} location ~.*.(gif|jpg|jpeg|png|bmp|swf)$
{ } expires
30d;{
} stub_status on;acce_log
off;fastcgi_pa 127.0.0.1:9000;fastcgi_index index.php;include fastcgi.conf;location /status { 5
}
} location ~.*.(js|c)?$
{ } expires 7d;acce_log off;include vhosts/*.conf;
例:配置news.hynews.net虚拟主机
在目录 /usr/local/nginx/conf下创建vhosts 文件夹 在 vhosts 下创建文件 news.conf,内容为: server {
listen 80;
server_name news.hynews.net;
index index.shtml index.php index.html;
root /www/htdocs/news;
location ~.*.(php|php5)?$
{
fastcgi_pa 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~.*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires
30d;
}
location ~.*.(js|c)?$
{
expires
7d;
}
acce_log off;} 6
例:配置news.hynews.net/section虚拟目录
在/usr/local/nginx/conf/vhosts目录下的二级域名配置文件中加入
location /section { alias /www/htdocs/mainsite/section;index index.shtml index.php index.html index.htm;} 7