首页 文章 精选 留言 我的

精选列表

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

阿里云服务器CentOS 7.3 64位部署FTP服务

一、安装vsftpd yum -y install vsftpd 二、配置 vsftpd的配置文件在/etc/vsftpd,其中vsftp.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). # 匿名访问,NO关闭,默认为YES开启状态 anonymous_enable=NO # # Uncomment this to allow local users to log in. # When SELinux is enforcing check for SE bool ftp_home_dir 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. # When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access #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 # # Activate logging of uploads/downloads. 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 # # You may override where the log file goes if you like. The default is shown # below. #xferlog_file=/var/log/xferlog # # If you want, you can have your log file in standard ftpd xferlog format. # Note that the default log file location is /var/log/xferlog in this case. 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(). # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that # the user does not have write access to the top level directory within the # chroot) #chroot_local_user=YES #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=NO # # This directive enables listening on IPv6 sockets. By default, listening # on the IPv6 "any" address (::) will accept connections from both IPv6 # and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6 # sockets. If you want that (perhaps because you want to listen on specific # addresses) then 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 # FTP跟路径设置 local_root=/home 理论上什么都不用修改就可以,但是实际上,我们都会把匿名访问给关闭,和设置一个FTP根路径 anonymous_enable=NO YES改为NO 添加local_root=/home 等号后面为想要设置的文件路径 三、添加用户 useradd ftpadmin -s /sbin/nologin // ftpadmin可改为你的FTP账号 passwd ftpadmin // 设置密码,输入两遍,密码不可见 chown -R ftpadmin /var/ftp // 改动用户权限,格式为chown -R 用户名 文件路径 四、开启服务 service vsftpd start 附:这篇就先这样,以后再更新卸载,vsftpd主配置文件修改及介绍,黑白名单,制定用户配置权限等等

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

centos 安装部署docker与局域网主机相通详细配置

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化.有了docker,对于运维和开发都是福音。下面直接上配置: centos安装docker源: yum install http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm 安装docker: yum install -y docker-io 启动docker: service docker start 如果启动报错的话: /usr/bin/docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference 解决:yum install device-mapper-event-libs 然后再次启动docker即可。 docker可以创建本次仓库,也可以将镜像提交到公有仓库,下面讲创建本地仓库: 创建本地仓库: docker run -d -p 5000:5000 registry 创建完成启动之后,你会发现 使用docker push无法上传此时: 注意 需要https验证:修改/etc/init.d/docker 增加: DOCKER_OPTS="--insecure-registry 192.168.1.231:5000"##我的ip为192.168.1.231,根据实际情况修改 将 $exec -d $other_args &>> $logfile &改成$exec -d $DOCKER_OPTS &>> $logfile & 重新启动docker,再次push就OK了 service docker restart 初步搭建就此完成。下面讲多个服务器之间怎么搭建网桥通讯。 注意事项: 1.docker启动容器之后,或默认创建一个网桥,并且会为启动的容器自动分配一个ip,这个时候可以容器和主机是相通的,但是与其他主机是不通的。 要想与其他容器相通,可以自己建立网桥,将物理网卡加入网桥,并且此时启动的容器必须为手动给到ip(pipeword),要不然会导致局域网内不能上网 设置自定义网桥,修改网络配置: cp /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-br0 vi /etc/sysconfig/network-scripts/ifcfg-br0加入: DEVICE="br0" ONBOOT=yes TYPE="Bridge" BOOTPROTO=ststic IPADDR=192.168.1.215 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS=119.6.6.6 DEFROUTE=yes vi /etc/sysconfig/network-scripts/ifcfg-eth1##将网卡加入网桥 DEVICE=eth0 HWADDR=00:0c:29:a2:9e:53 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none BRIDGE=br0 #IPADDR=192.168.1.215 #NETMASK=255.255.255.0 #GATEWAY=192.168.1.1 重新启动 service network restart 删除以前的网桥:##docker0 为你启动容器时候自动创建 ip link set dev docker0 down brctl delbr docker0 查看网桥: brctl show##此时可以看见了eth0已经加入到网桥了 启动容器的时候,不要自动分配ip,要不然会导致局域网不能上网加上--name xxx --net=none eg: docker run -it --name 123 --net=none centos /bin/bash 使用pipe工具设置静态ip: git clone https://github.com/jpetazzo/pipework 直接进入pipework目录: ./pipework br0##网桥名称 123##容器名称 192.168.1.175/24@192.168.1.1##@后面为网关,此时可以和其他主机相通了 设置时候可能会报错:Object "netns" is unknown, try "ip help" 解决办法:rpm -Uvh https://repos.fedorapeople.org/openstack/EOL/openstack-grizzly/epel-6/iproute-2.6.32-130.el6ost.netns.2.x86_64.rpm 完成之后就可以设置ip了。可以使brctl show可以查看已经多了一个网卡。进入容器可以看到ip已经设置完成 配置ssh登录: yum install openssh-server -y mkdir -p /var/run/sshd /usr/sbin/sshd -D & 修改ssh服务的安全登录配置,取消pam登录限制: 将 session required pam_loginuid.so 注释掉即可 mkdir /root/.ssh cd /root/.ssh ssh-keygen -t rsa##生产公钥 passwd root xxx xxx 最后创建启动脚本 vi /root/run.sh #!/bin/bash /usr/sbin/sshd -D chmod +x /root/run.sh 最后commit镜像即可 启动容器: docker run -d centos /root/run.sh##ssh服务自动开启,此时可以通过ip和密码登录,安装你想安装的东西,然后commit了。 本文转自 674591788 51CTO博客,原文链接:http://blog.51cto.com/mrdeng/1768771

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

Centos7.3部署Elasticsearch5.4.0集群

一、 安装JDK 1.1下载安装 cd /usr/local/src tar -zxvf jdk-8u131-linux-x64.tar.gz mv jdk1.8.0_131 /usr/local/java 1.2修改配置文件 vim /etc/profile //最后面添加 export JAVA_HOME=/usr/local/java CLASSPATH=/usr/local/java/lib/dt.jar/usr/local/java/lib/tools.jar PATH=/usr/local/java/bin:$PATH export PATH JAVA_HOMECLASSPATH source /etc/profile //导入配置文件 java -version //查看java版本 二、安装Elasticsearch 官网:https://www.elastic.co/downloads 参考:http://blog.csdn.net/u013365215/article/details/70159159 2.1下载安装 cd /usr/local/src/ curl -L -Ohttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz tar -xvf elasticsearch-5.4.0.tar.gz mv elasticsearch-5.4.0 /usr/local/ cd /usr/local/elasticsearch-5.4.0/ 2.2系统调优 1)配置系统最大打开文件描述符数 vim /etc/sysctl.conf vm.max_map_count = 262144 执行以下命令生效 sysctl -p 2)配置进程最大打开文件描述符 vim /etc/security/limits.conf //文件最后 * soft nofile 65536 * hard nofile 65536 2.3编写ES Master节点配置文件 vim config/elasticsearch.yml cluster.name: my-es node.name:node-1 network.host:192.168.19.141 http.port: 9200 transport.tcp.port: 9300 discovery.zen.ping.unicast.hosts: ["192.168.19.141","192.168.19.142","192.168.19.143"] discovery.zen.minimum_master_nodes: 2 #避免出现跨域问题 http.cors.enabled: true http.cors.allow-origin: "*" 第二个、第三个节点的配置只需修改成对应的即可。 2.4启动ES 用root账号启动会报错:java.lang.RuntimeException: can not runelasticsearch as root 因为Elasticsearch5.0之后,不能使用root账户启动,我们先创建一个elasticsearch组和账户: groupadd elsearch useradd elsearch -g elsearch -p elasticsearch chown -R elsearch.elsearch /usr/local/elasticsearch-5.4.0/ 后台启动: su -elsearch -c "/usr/local/elasticsearch-5.4.0/bin/elasticsearch -d" 2.5安装head开源插件 参考:http://blog.csdn.net/ronmy/article/details/63685254 只在master上安装插件即可。elasticsearch5不可以直接通过plugin -install mobz/elasticsearch-head安装,并且head需要在node环境下运行,具体步骤如下: 第一步:安装node curl -sL -o /etc/yum.repos.d/khara-nodejs.repohttps://copr.fedoraproject.org/coprs/khara/nodejs/repo/epel-7/khara-nodejs-epel-7.repo yum install -y nodejs nodejs-npm 查看安装版本 第二步:安装grunt cd /usr/lib/node_modules/npm/ npm install grunt-cli npm install grunt 查看版本: /usr/lib/node_modules/npm/node_modules/.bin/grunt -version 第三步:安装head yum install -y git cd /usr/local/ git clone git://github.com/mobz/elasticsearch-head.git cd elasticsearch-head/ npm install 注意:这步可以会有一些报错信息,可以忽略。 vim _site/app.js #修改『http://localhost:9200』字段到本机ES端口与IP 第四步:启动head并在后台运行 ./node_modules/grunt/bin/gruntserver & 浏览器访问: 注意:若不能形成集群,可能是 iptables 或者 selinux 的原因 2.6开机自启 vim /etc/rc.local su - elsearch -c "/usr/local/elasticsearch-5.3.1/bin/elasticsearch -d" /usr/local/elasticsearch-head/node_modules/grunt/bin/grunt server & 保存退出后,给自启文件赋予执行权限(若不加,Centos7不会开机执行) chmod +x /etc/rc.d/rc.local 本文转自M四月天 51CTO博客,原文链接:http://blog.51cto.com/msiyuetian/1926325,如需转载请自行联系原作者

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

Centos7部署ntp服务器同步时间

查看时区列表: timedatectl list-timezones|grep Asia 设置中国时区: timedatectl set-timezone Asia/Shanghai 执行完后时间就变为北京时间了 查看当前时间: date 查看当前设置: [root@localhost ~]# timedatectl Local time: Mon 2017-10-09 16:44:08 CST Universal time: Mon 2017-10-09 08:44:08 UTC RTC time: Mon 2017-10-09 08:44:08 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a 如果没有系统没有安装ntp服务器的话可以安装yum install ntp -y 然后编辑ntp的配置文件vi /etc/ntp.conf (日志文件默认在/var/log/messages中),添加以下几个服务器域名,如果原配置文件没有的话 server 0.centos.pool.ntp.org iburst server 1.centos.pool.ntp.org iburst server 2.centos.pool.ntp.org iburst server 3.centos.pool.ntp.org iburst systemctl restart ntpd systemctl enable ntpd 这样,服务器端就配置得差不多了,但我为了让效果更明显,把服务器修改为纽约时区,另一台需要同步的linux客户端的时区修改为非洲时间,结果导致,客户端ntpdate之后没有同步,后来才发现,需要在同一时区内才能同步时间,也就是说,服务端和客户端的时区必须在中国这个时区内才可以 下面来测试我们的ntp服务器配置有没有成功 在服务器端(ip:10.0.3.66)上 使用date -s 23:30:30 (时间可以随便改,反正改一个跟客户端时间不一样的就可以了),然后date可以看到时间变成了23:30:30 在客户端上 ntpdate 10.0.3.66 执行后发现,时间也变成了23:30:30

资源下载

更多资源
Mario

Mario

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

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

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部分的功能。

用户登录
用户注册