首页 文章 精选 留言 我的

精选列表

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

CentOS系列之简单搭建ftp服务器

注:以下全部是以CentOS 6为例 # 如果有需要的小伙伴可以将yum源转换到国内可以将以下shell粘贴带命令行等待执行结果 cd /etc/yum.repos.d mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget http://mirrors.163.com/.help/CentOS6-Base-163.repo yum clean all yum makecache 1、安装vsftp和ftp(可安可不安) # 安装vsftp,ftp yum install vsftp # ftp 可不安装,不影响 yum install ftp 2、创建ftp所需要的用户 #添加组 groupadd -g 1002 vsftpd #创建用户组目录 mkdir -p /home/vsftpd #添加用户 useradd -c "FTP User" -d /home/vsftpd/vsftpd -g vsftpd -s /sbin/nologin -u 1002 vsftpd useradd -c "FTP User" -d /home/vsftpd/test -g vsftpd -s /sbin/nologin test #设置密码(格式:passswd 用户名),输入密码回车,再次输入密码回车 passwd vsftpd passwd test #创建指定访问目录 mkdir -p /data/vsftpd mkdir -p /data/test #更改权限 chown vsftpd:vsftpd /data/vsftpd chown vsftpd:vsftpd /data/test chmod -R 775 /data/vsftpd chmod -R 775 /data/test 注:以后想添加用户可以以这为摸版进行创建 3、可以查看添加进来的新用户 cat /etc/passwd #如下 # vsftpd:x:1002:1002:FTP User:/home/vsftpd/vsftpd:/sbin/nologin # test:x:1003:1002:FTP User:/home/vsftpd/test:/sbin/nologin 注:/bin/false跟/sbin/nologin的区别! 1、/bin/false什么也不做只是返回一个错误状态,然后立即退出。将用户的shell设置为/bin/false,用户会无法登录,并且不会有任何提示。 2、/sbin/nologin会礼貌的向用户显示一条信息,并拒绝用户登录:This account is currently not available. 3、有一些软件,比如一些ftp服务器软件,对于本地非虚拟账户,只有用户有有效的shell才能使用ftp服务。这时候就可以使用/sbin/nologin使用户即不能登录系统,还能使用一些系统服务,比如ftp服务。/bin/false则不行,这是二者的重要区别之一 4、修改配置文件 #备份原文件 mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.txt #生成新的配置文件 touch /etc/vsftpd/vsftpd.conf #编辑配置文件 vim /etc/vsftpd/vsftpd.conf 4.1、粘贴下面这些配置到vsftpd.conf # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all compiled in defaults. # # READ THIS: This example file is NOT an exhaustive list of vsftpd options. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's # capabilities. # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=NO # # Uncomment this to allow local users to log in. local_enable=YES # # Uncomment this to enable any form of FTP write command. write_enable=YES # # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) local_umask=022 # # Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. #anon_upload_enable=YES # # Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enable=YES # # Activate directory messages - messages given to remote users when they # go into a certain directory. dirmessage_enable=YES # # The target log file can be vsftpd_log_file or xferlog_file. # This depends on setting xferlog_std_format parameter xferlog_enable=YES # # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES # # If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! #chown_uploads=YES #chown_username=whoever # # The name of log file when xferlog_enable=YES and xferlog_std_format=YES # WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log #xferlog_file=/var/log/xferlog # # Switches between logging into vsftpd_log_file and xferlog_file files. # NO writes to vsftpd_log_file, YES to xferlog_file xferlog_std_format=YES # # You may change the default value for timing out an idle session. #idle_session_timeout=600 # # You may change the default value for timing out a data connection. #data_connection_timeout=120 # # It is recommended that you define on your system a unique user which the # ftp server can use as a totally isolated and unprivileged user. #nopriv_user=ftpsecure # # Enable this and the server will recognise asynchronous ABOR requests. Not # recommended for security (the code is non-trivial). Not enabling it, # however, may confuse older FTP clients. #async_abor_enable=YES # # By default the server will pretend to allow ASCII mode but in fact ignore # the request. Turn on the below options to have the server actually do ASCII # mangling on files when in ASCII mode. # Beware that on some FTP servers, ASCII support allows a denial of service # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd # predicted this attack and has always been safe, reporting the size of the # raw file. # ASCII mangling is a horrible feature of the protocol. ascii_upload_enable=YES ascii_download_enable=YES # # You may fully customise the login banner string: #ftpd_banner=Welcome to blah FTP service. # # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enable=YES # (default follows) #banned_email_file=/etc/vsftpd/banned_emails # # You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). chroot_local_user=NO chroot_list_enable=YES # (default follows) chroot_list_file=/etc/vsftpd/chroot_list # # You may activate the "-R" option to the builtin ls. This is disabled by # default to avoid remote users being able to cause excessive I/O on large # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume # the presence of the "-R" option, so there is a strong case for enabling it. #ls_recurse_enable=YES # # When "listen" directive is enabled, vsftpd runs in standalone mode and # listens on IPv4 sockets. This directive cannot be used in conjunction # with the listen_ipv6 directive. listen=YES # # This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6 # sockets, you must run two copies of vsftpd with two configuration files. # Make sure, that one of the listen options is commented !! #listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES 5、设置FTP用户信息 #建立限制用户访问目录的空文件 touch /etc/vsftpd/chroot_list #添加ftp用户进来 vim /etc/vsftpd/user_list #注释掉上面的用户,在后面加上 vsftpd test #创建日志文件 mkdir -p /var/log/vsftpd mkdir -p /var/log/test touch /var/log/vsftpd/xferlog touch /var/log/vsftpd/vsftpd.log touch /var/log/vsftpd/test.log 6、处理防火墙 # 查看防火墙是否有端口,有就退出编辑,没有就执行下句 vim /etc/sysconfig/iptables #添加端口 -A INPUT -p tcp -m state --state NEW -m tcp --dport 20000:30000 -j ACCEPT #保存 /etc/init.d/iptables save #另外需要注意,如果是阿里云的,还需要登录阿里云在安全组里面添加入方向规则 #重启iptables 服务 service iptables restart 7、重启vsftpd服务 #停止vsftpd 服务 service vsftpd stop #启动vsftpd 服务 service vsftpd start #重启vsftpd 服务 service vsftpd restart 1 2 3 4 5 6 8、测试 8.1、在浏览器中 8.2、在pycharm中测试

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

CentOS搭建企业级PPTP服务器

第一个里程碑:检查系统是否支持ppp 1 2 [root@m01 ~] # cat /dev/ppp cat : /dev/ppp : No such device or address 如果出现以上提示则说明ppp是开启的,可以正常架设pptp服务,若出现Permission denied等其他提示,你需要先去VPS面板里看看有没有enable ppp的功能开关。 第二个里程碑:设置内核转发 1 2 3 4 5 6 7 8 9 10 11 [root@m01 ~] # grep forw /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 0 [root@m01 ~] # sed -i 's#net.ipv4.ip_forward = 0#net.ipv4.ip_forward = 1#g' /etc/sysctl.conf [root@m01 ~] # grep forw /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 1 [root@m01 ~] # sysctl -p 第三个里程碑:安装pptp 1 [root@m01 ~] # yum -y install pptpd 注意:pptp软件的安装需要依赖与epel源。 第四个里程碑:配置pptp 1 [root@m01 ~] # cp /etc/pptpd.conf{,.bak} #配置前对配置文件进行备份 [root@m01 ~]#egrep -v "^#|^$" /etc/pptpd.conf option /etc/ppp/options.pptpd logwtmp localip 10.0.0.61 remoteip 172.16.1.160-190 配置文件说明: localip 添加本机公网IP remoteip 分配VPN用户的内网网段 第五个里程碑:vpn连接的用户和密码 1 2 [root@m01 ~] # tail -1 /etc/ppp/chap-secrets vpn * vpn * 说明:第一个vpn为用户名,第二个vpn为密码,第一个* 为允许登陆主机允许,第二个*为分配给客户端的IP地址。 第六个里程碑:启动pptp服务,设置为开机自启动 1 2 3 4 5 [root@m01 ~] # /etc/init.d/pptpd start Starting pptpd: [ OK ] [root@m01 ~] # chkconfig |grep ppt pptpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off 第七个里程碑:windwos客户端测试 1 注意,在连接之前,将vpn设置中的ipv4 下的高级选项中进行修改,将勾选取消掉 在windows主机上测试ping内网地址 1 2 3 4 5 6 7 8 9 [f:\~]$ ping 172.16.1.8 正在 Ping 172.16.1.8 具有 32 字节的数据: 来自 172.16.1.8 的回复: 字节=32 时间=3ms TTL=63 来自 172.16.1.8 的回复: 字节=32 时间=3ms TTL=63 172.16.1.8 的 Ping 统计信息: 数据包: 已发送 = 1,已接收 = 1,丢失 = 0 (0% 丢失), 往返行程的估计时间(以毫秒为单位): 最短 = 2ms,最长 = 3ms,平均 = 2ms

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

在CentOS上搭建PHP服务器环境

安装apache: yum install httpd httpd-devel 配置系统让 Apache 随系统启动: chkconfig --levels 235 httpd on 配置完毕,启动apache: /etc/init.d/httpd start 此时输入服务器的IP地址,应该看到apache的服务页面,端口不用输,apache默认就是使用80端口 注意,如果其他机器访问这台服务无法显示这个页面,而直接在这台服务器上可以访问的话,一般情况下是 CentOS 自带的防火墙禁止了。你只需要进入防火墙,将 “WWW” 对应的 “80” 端口打开即可。 安装php yum install php php-devel 重启apache使php生效 /etc/init.d/httpd restart 此时可以在目录:/var/www/html/下建立一个PHP文件 代码: <?php phpinfo(); ?> 然后访问这个文件,就能看到PHP的一些信息,php.ini配置文件的路径可以在这个页面上看到 安装php的扩展 yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc 安装完扩展之后需要再次重启apache /etc/init.d/httpd restart

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

沫沫金 - ADT初始环境搭建问题清单

Eclipse ADT版jdk指定 1 2 3 4 5 //1、打开eclipse.ini //2、复制下面代码 -vm ./jdk6. 32 /jre/bin/client/jvm.dll //3、放到-vmargs之前(必须!) Android虚拟机创建经典问题 1、Failed to allocate memory: 1455 这个调整RAM值就可以(不要和发烧友一样整好几个G) 2、启动Android虚拟机失败:start Android panic could not... 需要配置ANDROID_SDK_HOME并加入Path中指定到sdk的绝对目录的tools目录 以上,谢谢。 跑起来了,最终效果收尾 本文转自 沫沫金 51CTO博客,原文链接:http://blog.51cto.com/zl0828/1732568,如需转载请自行联系原作者

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

做网站应该搭建哪些功能栏目管理模块?

中国的互联网在调整发展,带企业带来了巨大的网络营销市场与机遇。如果一家传统企业不再加入互联网营销的大潮,则很快会被老的市场运营模式淘汰。也要跟上互联网的发展节奏与市场,不能被互联网抛弃。想要加入互联网营销市场模式的第一个重要工作内容就是,建设一个属于自已公司的官方网站。企业有了一个自已的公司网站是启动网络营销的一个最基础的条件,也说明着开辟了一条全新的营销之路。那么在网站上面展示哪些内容,设计成哪种风格一般都会知道,但是开发哪些模块功能栏目呢?因为网站的功能模块栏目就是为了完成网站日常更新的工作的,所以这点也是很重要的,下面松一设计(www.songyi.net)给大家简单介绍几个常用常见的网站功能栏目管理模块。 一、模块管理系统不管是,产品,新闻,资讯,信息,案例,等其它相关信息内容。每个网站都会做到日常更新维护管理的工作。那么我们通常叫这种为模块开发,产品模块,新闻模块,案例模块等等,那么模块需要完成的工作就是,分类,列表,单个详细页面的添加,删除,修改工作实现。这样我们就可以管理网站的栏目信息内容日常更新了。 二、下载管理系统下载功能模块要单独说下,因为这个是双向的,因为可以前台下载相关资料,一般格式,PDF,.ZIP,.doc等相关格式文档资料。一般分为2种情况,在详细页有点击下载按钮,一种是在线查阅按钮模式,但是我一般建议还是在线阅读比较好,因为效率比较高,但是有个小的注意事项就是,上传的文档千万不要太大,一般不能超过10M。最好保持在2M以内的大小最为合适。 三、表单管理系统表单管理系统我想一般人对此应该并不陌生。就是在网站上面建立一个表单提交页面,用户可以访问网站时直接在前台提交留言给网站后台,有时会提交到邮箱,但是在这里有几点要说明下,就是不要全部填写项目都做上必填,这样客户比较反感,还有就是一定要加上验证码,因为很多木马文件都是通过表单上传到后台的。还有就是如果做到提交到邮箱的话,最好不要这样操作,因为有时因为页面编码的问题,可能会出现乱码,所以我一般还是建议客户提交到后台。 四、在线客服应用网站除了展示和应用功能部分之外,就是在线客服功能了,一般可以用QQ,或微信等相关及时聊天工具。为了方便客户在访问网站时第一时间联络上。还有一种就是及时聊天工具,我是很建议使用的,但是希望可以尽量使用付费的在线网页客服软件。因为反应速度比较好,稳定,信息管理储存比较方便。

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

Logstash+Elasticsearch+Kibana日志服务器搭建

官网https://www.elastic.co 软件版本: Logstash 2.2.0 All Plugins Elasticsearch 2.2.0 Kibana 4.4.0 说明:此环境Centos6.5 64位,单机做测试,具体配置从简。 1.Logstash安装配置 解压到/usr/local/logstash-2.2.0/ Logstash配置文件: vim /usr/local/logstash-2.2.0/etc/agent.conf input{ file{ path=>"/usr/local/nginx/logs/access.log" start_position=>beginning } } output{ elasticsearch{} stdout{} } logstash启动 nohup /usr/local/logstash-2.2.0/bin/logstash -f /usr/local/logstash-2.2.0/etc/agent.conf & 2.Elasticsearch安装配置 解压到/usr/local/elasticsearch-2.2.0/ Elasticsearch配置文件 vim /usr/local/elasticsearch-2.2.0/config/elasticsearch.yml #SetthebindaddresstoaspecificIP(IPv4orIPv6): # network.host:0.0.0.0 # #SetacustomportforHTTP: # http.port:9200 Elasticsearch启动(非root用户) /usr/local/elasticsearch-2.2.0/bin/elasticsearch -d 3.Kibana安装配置 解压到/usr/local/kibana-4.4.0-linux-x64/ Kibana配置文件 vim /usr/local/kibana-4.4.0-linux-x64/config/kibana.yml #Kibanaisservedbyabackendserver.Thiscontrolswhichporttouse. server.port:5601 #Thehosttobindtheserverto. server.host:"0.0.0.0" #Ifyouarerunningkibanabehindaproxy,andwanttomountitatapath, #specifythatpathhere.ThebasePathcan'tendinaslash. #server.basePath:"" #Themaximumpayloadsizeinbytesonincomingserverrequests. #server.maxPayloadBytes:1048576 #TheElasticsearchinstancetouseforallyourqueries. elasticsearch.url:"http://localhost:9200" Kibana启动 nohup /usr/local/kibana-4.4.0-linux-x64/bin/kibana & 浏览器访问 http://yourhost.com:5601 本文转自 ygqygq2 51CTO博客,原文链接:http://blog.51cto.com/ygqygq2/1741119,如需转载请自行联系原作者

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

CentOS7下快速搭建Docker私有库

1. 安装Docker yum -y install docker 2. 启动Docker服务 systemctl enable docker systemctl start docker 3. 启动Docker私有库 mkdir /home/docker_repo cd /home/docker_repo docker run -d -p 5000:5000 --name registry --restart=always --privileged=true -v $PWD:/var/lib/registry registry:2 4. 提交Docker镜像 docker tag docker.io/hello-world:latest 192.168.1.75:5000/hello-world:latest docker push 192.168.1.75:5000/hello-world 如果push遇到问题,编辑/usr/lib/systemd/system/docker.service,在ExecStart=之后追加一行参数: --insecure-registry=192.168.1.75:5000 \ 然后重启Docker服务: systemctl daemon-reload systemctl restart docker 5. Docker私有库HTTP API 测试库内已有centos和Docker官方的hello-world镜像 查看当前库列表http://192.168.1.75:5000/v2/_catalog 返回: { "repositories": [ "centos", "hello-world" ] } 查看某个库标签列表http://192.168.1.75:5000/v2/hello-world/tags/list 返回: { "name": "hello-world", "tags": [ "latest" ] } 注: 需要把192.168.1.75替换成你的Docker私有库所在服务器IP 本文转自 zl1030 51CTO博客,原文链接:http://blog.51cto.com/zl1030/2047891

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

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

用户登录
用户注册
修改密码
忘记密码