linux创建用户配置sftp访问指定目录

Linux 发表时间:2021-12-02 11:31:31 作者:梁子亮

首先安装sshd,一般服务器都自带,如果没有安装也可以yum或者apt-ge安装配置sshdvim /etc/ssh/sshd_config在后面添加以下几行,注意要把原本的Subsystem sftp /usr/libexec/openssh/sftp-server这行配置要注释掉,不然重启sshd时会报错Subsystem sftp internal-sftp Match Group sftp ChrootDirectory /home/wwwroot/ ForceCommand internal-sftp创建目录 /home/wwwroot 注意,注意,注意,重要的事件说三遍

阅读更多 2215

mqtt mosquitto服务搭建与配置

Linux 发表时间:2021-11-23 14:18:30 作者:梁子亮

第一步,先安装mosquitodocker安装mosquitto(2选1)先拉取本地镜像,这里拉取的是1.6.15版,因为latest版会有各种问题,暂时无解docker pull eclipse-mosquitto:1.6.15执行如下命令创建目录mkdir -p /mosquitto/config mkdir -p /mosquitto/data mkdir -p /mosquitto/log执行如下命令创建初始化配置文件vim /mosquitto/config/mosquitto.conf在配置文件中添加如下内容,然后保存退出persistence true persistenc

阅读更多 2545

docker使用教程

Linux 发表时间:2021-11-03 18:22:41 作者:梁子亮

一、docker普通安装部署lnp示例(没有m,因为mysql取其他服务器的数据库)1、docker安装nginx(在/root目录即可,后面如无说明也是相同...)docker pull nginx:latest2、docker安装php-fpm,为了跟测试环境一致这里安装的是7.2.18(在/root目录即可,后面如无说明也是相同...)docker pull bitnami/php-fpm:7.2.18-ol-7-r33-prod注意:若安装的是php-fpm5.6,启动后phpinfo报timezone错误,则,可以进入php-fpm5.6的容器内,直接写入以下代码到conf.d文件夹

阅读更多 1612

Nginx实现负载均衡

Linux 发表时间:2021-10-28 11:25:49 作者:梁子亮

修改loadbalance.conf,新增 location / 的配置,注意注释掉 include /home/wwwroot/nginx_rewrite.conf此句(其余配置不用变动),不然会跟location /的配置冲突listen 80 ; server_name lb.lziang.com; location / { proxy_pass http://tim-server; proxy_redirect default; } index index.php index.html index.htm; root /home/wwwroot/lb;

阅读更多 1424

yac扩展安装&使用

Linux 发表时间:2021-05-05 15:00:26 作者:梁子亮

yac扩展安装git clone https://github.com/laruence/yaccd yacphpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make install此时出现以下表面安装成功,安装路径可记住后面或许需要使用Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/修改php.ini文件,添加扩展vim /usr/local/

阅读更多 1807

Linux服务器内存,CPU优化

Linux 发表时间:2021-04-22 10:01:47 作者:梁子亮

第一部分php中的优化1、load average 中3个数的含义,如果是1核cpu,那么不能超过1,4核那么就不能超过4,1分钟代表短期,5分钟代表中期,15分钟可以代表长期top2、查看消耗内存最多的前40个进程ps auxw|head -1;ps auxw|sort -rn -k4|head -403、查看通过命令查看服务器上一共开了多少的 php-cgi 进程ps -fe |grep "php-fpm"|grep "pool"|wc -l4、查看已经有多少个php-cgi进程用来处理tcp请求netstat -anp|grep "ph

阅读更多 1572

每时每刻每分每秒的Linux定时任务

Linux 发表时间:2021-04-21 17:53:30 作者:梁子亮

先编写shell脚本(在/home/www/crontab.sh)step=2 #间隔的秒数,不能大于60 for (( i = 0; i < 60; i=(i+step) )); do #$(/usr/bin/curl https://test.zhimeikm.com/api/crontab/xxxxxxxxxx) $(/usr/bin/curl https://test.zhimeikm.com/api/crontab/xxxxxxxxxx) sleep $step done exit 0在crontab -e 时加入刚刚编写的shell脚本* * * * * /ho

阅读更多 1464

svn 命令批量操作 批量增加或删除

Linux 发表时间:2021-01-14 08:48:16 作者:梁子亮

在项目根目录中执行以下进行添加 - 已验证svn st | awk '{if ( $1 == "?") { print $2}}' | xargs svn add执行完即可全部增加并提交svn ci -m '批量添加所有哈~'但svn status发现不少!的文件,表示已经本地删除了但还未提交到svn的状态,如! img/p/2-49-small.jpg ! img/p/2-48-thickbox.jpg ! img/p/2-48-medium.jpg在项目根目录中执行以下进行删除 - 未验证svn s

阅读更多 1681

更新index.html后页面存在缓存

Linux 发表时间:2020-12-10 14:47:01 作者:梁子亮

nginx配置index.html不缓存的办法location /index.html { #return 404 "not found"; #add_header Cache-Control no-cache add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate"; }或者把js|css|html页面的过期时间改为1h, 2m, 3s,5d,-1 注:-1表示永远过期(未测试),1h表示1小时,2

阅读更多 1456

svn报错svn: error: The subversion command line tools are no longer provided by Xcode.

Linux 发表时间:2020-12-07 13:56:02 作者:梁子亮

在iMac的terminal里输入以下安装brew/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"选择镜像中选择1使用brew命令安装SVNbrew install svn

阅读更多 1450
1-1019