首页 文章 精选 留言 我的

精选列表

搜索[服务],共10000篇文章
优秀的个人博客,低调大师

Centos7安装vsftpd (FTP服务器)

一、通过yum安装vsftpd yum install -y vsftpd 二、修改vsftpd的配置文件 vi /etc/vsftpd/vsftpd.conf 修改配置文件如下: 1.不允许匿名访问 anonymous_enable=NO 2.允许使用本地帐户进行FTP用户登录验证 local_enable=YES 3.使用户不能离开主目录 当chroot_list_enable=YES,chroot_local_user=YES时,在/etc/vsftpd.chroot_list文件中列出的用户,可以切换到其他目录;未在文件中列出的用户,不能切换到其他目录。 chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd/chroot_list 配置文件最后添加 allow_writeable_chroot=YES 要不然会报错 500 OOPS: vsftpd: refusing to run with writable root inside chroot() 如果/etc/vsftpd/chroot_list不存在,则需要创建该文件 vi /etc/vsftpd/chroot_list :wq直接保存并退出就行。 4.设定支持ASCII模式的上传和下载功能。 ascii_upload_enable=YES ascii_download_enable=YES 最后:wq保存修改,重启vsftpd systemctl restart vsftpd.service 三、新建FTP用户 useradd -d /var/ftp/public_root -g ftp -s /sbin/nologin ftpuser 修改该FTP用户密码 passwd ftpuser

优秀的个人博客,低调大师

Appium使用命令行方式启动服务

1.一个简单的例子,没有指定任何参数: 命令行中输入:appium 第一行:欢迎使用Appium,版本 v1.6.5 第二行:Appium启动成功,启动ip为默认的 0.0.0.0,端口为默认的 4723;默认即表示“不指定”的情况下; 2.指定一些参数 命令行中输入:appium -a 127.0.0.1 -p 4723 --session-override -a是指定监听的ip(也可写成--address),后面“127.0.0.1”可以改为你需要的ip地址; -p是指定监听的端口(也可写成 --port),也可以修改为你需要的端口; --session-override是指覆盖之前的session; 3.实际工作中常用的命令 命令行中输入:appium -a 127.0.0.1 -p 4727 -bp 4728 --chromedriver-port 9519 -U xiaomi --session-override -bp是连接Android设备bootstrap的端口号,默认是4724(也可写成--bootstrap-port) --chromedriver-port是chromedriver运行需要指定的端口号,默认是9515 -U是连接的设备名称,如"adb devices"获取的设备标识(也可写成--udid) http://blog.csdn.net/a_little_smallsharp/article/details/77338272 本文转自 知止内明 51CTO博客,原文链接:http://blog.51cto.com/357712148/1965857,如需转载请自行联系原作者

优秀的个人博客,低调大师

高性能缓存服务器Squid架构配置

前言*随着网站访问人数越来越多,承受的并发和压力也越来越高,这时候我们需要对网站和架构进行优化,今天我们来讨论使用Squid对架构进行优化,缓存网站。网上对squid描述的文章也有成千上万,我这里简单记录一下实践的步骤。 一、实施环境 1 2 3 系统版本:CentOSx86_645.8 Squid版本:squid-2.6 Nginx版本:nginx-1.4.2 二、正式安装 安装之前我们需要对系统进行优化,主要优化系统内核相关参数,仅供参考: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 vi /etc/sysctl .conf #sysctl.confconfig2014-03-26 net.ipv4.ip_forward=0 net.ipv4.conf.default.rp_filter=1 net.ipv4.conf.default.accept_source_route=0 kernel.sysrq=0 kernel.core_uses_pid=1 net.ipv4.tcp_syncookies=1 kernel.msgmnb=65536 kernel.msgmax=65536 kernel.shmmax=68719476736 kernel.shmall=4294967296 net.ipv4.tcp_max_tw_buckets=10000 net.ipv4.tcp_sack=1 net.ipv4.tcp_window_scaling=1 net.ipv4.tcp_rmem=4096873804194304 net.ipv4.tcp_wmem=4096163844194304 net.core.wmem_default=8388608 net.core.rmem_default=8388608 net.core.rmem_max=16777216 net.core.wmem_max=16777216 net.core.netdev_max_backlog=262144 net.core.somaxconn=262144 net.ipv4.tcp_max_orphans=3276800 net.ipv4.tcp_max_syn_backlog=262144 net.ipv4.tcp_timestamps=0 net.ipv4.tcp_synack_retries=1 net.ipv4.tcp_syn_retries=1 net.ipv4.tcp_tw_recycle=1 net.ipv4.tcp_tw_reuse=1 net.ipv4.tcp_mem=94500000915000000927000000 net.ipv4.tcp_fin_timeout=1 net.ipv4.tcp_keepalive_time=15 net.ipv4.ip_local_port_range=102465535 优化Linux文件打开最大数: 1 2 3 4 5 vi /etc/security/limits .conf *softnproc65535 *hardnproc65535 *softnofile65535 *hardnofile65535 接下来上自动安装Squid脚本,里面分别配置了两个虚拟主机域名,前端有LVS,LVS均衡后端多组squid集群,根据命中率去调整squid集群的数量,Squid后端均衡Nginx或者Apache。(完整的架构LVS+Keepalived+Squid+Nginx+Resin/Tomcat/PHP+MySQL集群) 简单逻辑图如下: 直接上脚本: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 #!/bin/sh #Automakeinstallsquidserver #Authorwugk2014-03-26 SQUID_CNF= /etc/squid/squid .conf CACHE_DIR=( /data/cache1 /data/cache2 ) #Installsquidshell yum install -ysquid #configsquid.conf cat >>$SQUID_CNF<<EOF #globalconfigsquid.conf2014-03-26 http_port80accelvhostvport cache_peer192.168.149.128parent800originservername=wugk1 cache_peer192.168.149.129parent800originservername=wugk2 cache_peer_domainwugk1www.wugk1.com cache_peer_domainwugk2www.wugk2.com visible_hostnamelocalhost forwarded_foroff viaoff cache_varyon #aclconfig aclmanagerprotocache_object acllocalhostsrc127.0.0.1 /32 aclto_localhostdst127.0.0.0 /8 0.0.0.0 /32 acllocalnetsrc10.0.0.0 /8 #RFC1918possibleinternalnetwork acllocalnetsrc172.16.0.0 /12 #RFC1918possibleinternalnetwork acllocalnetsrc192.168.0.0 /16 #RFC1918possibleinternalnetwork aclSSL_portsport443 aclSafe_portsport808080 #http aclSafe_portsport21 #ftp aclSafe_portsport443 #https aclallsrc0.0.0.0 /0 aclCONNECTmethodCONNECT http_accessallowmanagerlocalhost http_accessdenymanager http_accessdeny!Safe_ports http_accessdenyCONNECT!SSL_ports http_accessallowlocalnet http_accessallowlocalhost http_accessallowall aclPURGEmethodPURGE http_accessallowPURGElocalhost http_accessdenyPURGE #squidconfig2014-03-25 cache_diraufs /data/cache1 1024016256 cache_diraufs /data/cache2 1024016256 cache_mem4000MB maximum_object_size8MB maximum_object_size_in_memory256KB hierarchy_stoplistcgi-bin? coredump_dir /var/spool/squid refresh_pattern^ ftp :144020%10080 refresh_pattern^gopher:14400%1440 refresh_pattern-i( /cgi-bin/ |\?)00%0 refresh_pattern\.(jpg|png|gif|mp3|xml|html|htm|css|js)144050%2880ignore-reload refresh_pattern.020%4320 EOF #configcache_dir mkdir -p${CACHE_DIR[@]}; chown -Rsquid:squid${CACHE_DIR[@]} #restartsquidserver /etc/init .d /squid restart if [ "$?" == "0" ]; then echo "TheSquidServerInstallSuccessfully!!" else echo "TheSquidServerInstallFailed!!,PleaseCheckLog......" fi 最后测试,前端LVS截图(注LVS此处不配置了,博客有专门的安装方法) 通过浏览器查看head头,缓存命中情况截图如下: 通过命令 1 squidclient-p 80 mgr:info|egrep "(RequestHitRatios|ByteHitRatios)" 查看缓存命中率如下: 三、批量清空缓存 使用Shell脚本批量清空squid缓存脚本auto_clean_cache.sh 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #!/bin/sh DIR= /data/cache/ Command= /usr/sbin/squidclient if [ "$1" = "" ]; then echo "Usage:{$0" \$1 ",Exampleexec$0forum.php}" exit fi grep -r-a$1${DIR}|strings| grep "http:" | grep - v "=" >list.txt count=` cat list.txt| wc -l` if [ "$count" - eq "0" ]; then echo -e "---------------------------------\nThe$1cachealreadyupdate,Pleaseexit......" exit fi while read line do $Command-mPURGE-p80 "$line" >> /dev/null if [$?- eq 0]; then echo -e "----------------------------------\nThe$linecacheupdatesuccessfully!" fi done <list.txt 脚本执行: 1 2 3 4 [root@node2~]#shauto_clean_cache.shforum.php ---------------------------------- Thehttp: //www.wugk2.com/forum.phpcacheupdatesuccessfully! [root@node2~]# 更多squid优化及深入配置后期更新。。 本文转自 wgkgood 51CTO博客,原文链接:http://blog.51cto.com/wgkgood/1384580

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册