linux环境nginx、php相关的常用命令
2017-12-05 00:00
459 查看
linux相关
1、路径添加到环境变量
2、添加新用户
3、查看文件夹下各个文件的大小
4、查看硬盘及分区
5、cache缓存清除
对于小内存系统,经常发现cache被占满,导致系统很卡,可手动进行清理
参数官方文档解释
Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.
To free pagecache:
* echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
* echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
* echo 3 > /proc/sys/vm/drop_caches
As this is a non-destructive operation, and dirty objects are notfreeable, the user should run "sync" first in order to make sure allcached objects are freed.
This tunable was added in 2.6.16.
php相关
1、查看php已有的扩展模块
2、启动php-fpm
3、查看php信息
4、查看php版本
5、phpize
phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
nginx相关
1、查看nginx版本
2、检查ngix.conf配置文件
3、启动nginx
1、路径添加到环境变量
$vi /etc/profile #执行生效 $source /etc/profile
2、添加新用户
#添加www用户并设置组 $useradd www $chown -R www:www /home/www/src/testweb/
3、查看文件夹下各个文件的大小
$du -h *
4、查看硬盘及分区
$lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 253:0 0 50G 0 disk └─vda1 253:1 0 50G 0 part / $fdisk -l Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0005fc9a Device Boot Start End Blocks Id System /dev/vda1 * 2048 104857599 52427776 83 Linux
5、cache缓存清除
对于小内存系统,经常发现cache被占满,导致系统很卡,可手动进行清理
#查看默认值 0 $cat /proc/sys/vm/drop_caches #清除前将缓存内容写入到磁盘 $sync #写入参数值 $echo 3 > /proc/sys/vm/drop_caches
参数官方文档解释
Writing to this will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.
To free pagecache:
* echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
* echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
* echo 3 > /proc/sys/vm/drop_caches
As this is a non-destructive operation, and dirty objects are notfreeable, the user should run "sync" first in order to make sure allcached objects are freed.
This tunable was added in 2.6.16.
php相关
1、查看php已有的扩展模块
$php -m #或/usr/local/php/bin/php -m
2、启动php-fpm
$service php-fpm start #或/usr/local/php/sbin/php-fpm $service php-fpm restart #重启 $service php-fpm stop #停止 $killall php-fpm #停止 $ps aux |grep php-fpm #查看php-fpm进程启动是否ok
3、查看php信息
#查看ini配置 $php --ini #查看php信息 $php -i #可根据需要grep 或 php --info|grep swoole
4、查看php版本
$php -v #或/usr/local/php/bin/php -v
5、phpize
phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块
$phpize #编译 $./configure #安装 $make && make install
nginx相关
1、查看nginx版本
$nginx -v #查看完成的nginx配置信息 $nginx -V nginx version: nginx/1.12.2 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-pcre --with-http_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream
2、检查ngix.conf配置文件
$nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successfu
3、启动nginx
$service nginx start #nginx -s reload 或/usr/local/nginx/sbin/nginx 或nginx $service nginx restart #重启 $nginx -s stop #停止
相关文章推荐
- (六)Linux环境部署(Centos+Nginx+Tomcat+Mysql) - 常用命令总结
- Linux下环境变量的种类及相关的常用命令
- linux PHP 环境配置以及相关命令
- Linux下搭建nginx和php环境
- Linux 入门常用命令-7.在Linux环境下运行DOS命令
- PHP执行linux系统命令的常用函数使用说明
- Linux常用命令以及其他相关的小知识点
- Linux常用命令总结1(用户操作相关)
- 工作常用的linux/mysql/php/工具命令
- linux php 命令行常用的命令
- CENTOS环境下nginx常用命令及优化--不断更新中
- LINUX入门常用命令之在Linux环境下运行DOS命令
- mysql常用操作命令 linux系统环境
- Linux 入门常用命令-7.在Linux环境下运行DOS命令
- PHP执行Linux命令常用的6个函数
- Linux+Nginx+Php+Mysql环境搭建
- Linux开发中的常用命令(cygwin环境也同样适用)
- Linux常用的几个监控系统性能的相关命令
- VPS 快速安装 Linux+Nginx+MySQL+PHP 环境
- linux环境变量相关命令和文件