首页 文章 精选 资源 留言

精选列表

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

解决VMware Workstation Pro安装CentOS7桥接网络无法连接

系统镜像:CentOS-7-x86_64-DVD-1804.iso 虚拟机:VMware Workstation 12 Pro 12.5.9 build-7535481 新建虚拟机中选择了网络类型,使用桥接网络。 安装完成系统后,通过命令查看、检验网络。 ip addr查看网络 ping www.baidu.com检验网络 发现网络不通,首先修改网络配置文件。 cd /etc/sysconfig/network-scripts vi ifcfg-ens33文件名为 “ifcfg-???”,???是2中查看网络中的名字”ens33”。 将ONBOOT=no改为yes service network restart重启网络生效 依然不能连接网络??? 那就打开VMware操作界面的”编辑”>>>”虚拟网络编辑器”>>>”更改网络设置”>>>”VMnet信息”>>>”桥接模式”>>>”桥接到”中列表内容一个一个试下去,应用后直接执行 ping www.baidu.com检验网络 不通下一个,我是第三个好了,Good Luck!

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

虚拟机里centos7忘记root密码修改root密码

我在虚拟机安装了cent OS7,但是忘记了root密码,登录的时候发现登录不上了,然后重新修改密码 1、登录失败的页面 2、重启虚拟机,在重启的时候不停的连续按着ESC键 3、进入到该页面之后,选中第一个(高亮显示即为选中)选项,然后按下键盘的“E”键 4、进入到初始化脚本编辑页面,该脚本有两页,用下键向下拉,直到最后两行 5、光标拉到最后两行需要加入一些文字 shgb后面加入下面这一行文字 rw LANG=\zh_CN.UTF-8(我安装的是中文版的,也有可能你的是\en_US.utf-8)后面加下面这一行文字 init=/bin/sh 6、加好之后如下图所示 然后按ctrl+x退出 7、进入到这个页面之后(一开始只有上面那一行),表示初始化成功,然后依次输入 mount -o remount,rw / passwd root 输入两次新的密码(密码不会直接显示出来) touch /.autorelabel exec /sbin/init

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

Docker系列教程02-Docker安装(CentOS7/Ubuntu/macOS/Windows)

原文:http://www.itmuch.com/docker/02-docker-install/ 2.1 CentOS 2.1.1 系统要求 CentOS 7或更高版本 centos-extras 仓库必须处于启用状态,该仓库默认启用,但如果您禁用了该仓库,请按照https://wiki.centos.org/AdditionalResources/Repositories 中的描述重新启用。 建议使用overlay2 存储驱动 2.1.2 yum安装 2.1.2.1 卸载老版本的Docker 在CentOS中,老版本Docker名称是docker 或docker-engine ,而Docker CE的软件包名称是docker-ce 。因此,如已安装过老版本的Docker,需使用如下命令卸载。 sudo yum remove docker \ docker-common \ docker-selinux \ docker-engine 需要注意的是,执行该命令只会卸载Docker本身,而不会删除Docker存储的文件,例如镜像、容器、卷以及网络文件等。这些文件保存在/var/lib/docker 目录中,需要手动删除。 2.1.2.2 安装仓库 执行以下命令,安装Docker所需的包。其中,yum-utils 提供了yum-config-manager 工具;device-mapper-persistent-data 及 lvm2 则是devicemapper 存储驱动所需的包。 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 执行如下命令,安装stable 仓库。必须安装stable 仓库,即使你想安装edge 或test 仓库中的Docker构建版本。 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo [可选] 执行如下命令,启用edge 及test 仓库。edge/test仓库其实也包含在了docker.repo 文件中,但默认是禁用的,可使用以下命令来启用。 sudo yum-config-manager --enable docker-ce-edge # 启用edge仓库 sudo yum-config-manager --enable docker-ce-test # 启用test仓库 如需再次禁用,可加上--disable 标签。例如,执行如下命令即可禁用edge仓库。 sudo yum-config-manager --disable docker-ce-edge TIPS:从Docker 17.06起,stable版本也会发布到edge以及test仓库中。 2.1.2.3 安装Docker CE 执行以下命令,更新yum的包索引 sudo yum makecache fast 执行如下命令即可安装最新版本的Docker CE sudo yum install docker-ce 在生产环境中,可能需要指定想要安装的版本,此时可使用如下命令列出当前可用的Docker版本。 yum list docker-ce.x86_64 --showduplicates | sort -r 这样,列出版本后,可使用如下命令,安装想要安装的Docker CE版本。 sudo yum install docker-ce-<VERSION> 启动Docker sudo systemctl start docker 验证安装是否正确。 sudo docker run hello-world 这样,Docker将会下载测试镜像,并使用该镜像启动一个容器。如能够看到类似如下的输出,则说明安装成功。 Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world b04784fba78d: Pull complete Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/ 2.1.2.4 升级Docker CE 如需升级Docker CE,只需执行如下命令: sudo yum makecache fast 然后按照安装Docker的步骤,即可升级Docker。 2.1.2.5 参考文档 CentOS 7安装Docker官方文档:https://docs.docker.com/engine/installation/linux/docker-ce/centos/ ,文档中还讲解了在CentOS 7中安装Docker CE的其他方式,本文不作赘述。 2.1.3 shell一键安装 curl -fsSL get.docker.com -o get-docker.sh sudo sh get-docker.sh 搞定一切。 2.2 Ubuntu 2.2.1 系统要求 Docker支持以下版本的Ubuntu,要求64位。 Zesty 17.04 Xenial 16.04 (LTS) Trusty 14.04 (LTS) 支持运行的平台:x86_64 、armhf 、s390x(IBM Z) 。其中,如选择IBM Z,那么只支持Ubuntu Xenial以及Zesty。 本文使用Ubuntu 16.04 LTS,下载地址:http://cn.ubuntu.com/download/ 2.2.2 安装步骤 2.2.2.1 卸载老版本Docker 在Ubuntu中,老版本的软件包名称是docker 或者docker-engine ,而Docker CE的软件包名称是docker-ce 。因此,如已安装过老版本的Docker,需要先卸载掉。执行以下命令,即可卸载老版本的Docker及其依赖。 sudo apt-get remove docker docker-engine docker.io 需要注意的是,执行该命令只会卸载Docker本身,而不会删除Docker内容,例如镜像、容器、卷以及网络。这些文件保存在/var/lib/docker 目录中,需要手动删除。 2.2.2.2 Ubuntu Trusty 14.04 额外建议安装的包 除非你有不得已的苦衷,否则强烈建议安装linux-image-extra-* 软件包,以便于Docker使用aufs 存储驱动。执行如下命令,即可安装linux-image-extra-* 。 sudo apt-get update sudo apt-get install \ linux-image-extra-$(uname -r) \ linux-image-extra-virtual 对于Ubuntu 16.04或更高版本,Linux内核包含了对OverlayFS的支持,Docker CE默认会使用overlay2 存储驱动。 2.2.2.3 安装仓库 执行如下命令,更新apt 的包索引。 sudo apt-get update 执行如下命令,从而允许apt 使用HTTPS仓库。 sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common 添加Docker官方的GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 确认指纹是9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 。 sudo apt-key fingerprint 0EBFCD88 执行如下命令,安装stable 仓库。无论如何都必须安装stable 仓库,即使你想安装edge 或test 仓库中的Docker构建。如需添加edge 或test 仓库,可在如下命令中的“stable" 后,添加edge 或test 或两者。请视自己Ubuntu所运行的平台来执行如下命令。NOTE:如下命令中的lsb_release -cs 子命令用于返回您Ubuntu的发行版名称,例如xenial 。有时,在例如Linux Mint这样的发行版中,您可能需要将如下命令中的$(lsb_release -cs) 更改为系统的父级Ubuntu发行版。例如,如果您使用的是Linux Mint Rafaela,则可以使用trusty 。amd64: $ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" armhf: $ sudo add-apt-repository \ "deb [arch=armhf] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" s390x: $ sudo add-apt-repository \ "deb [arch=s390x] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" NOTE:从Docker 17.06起,stable版本也会发布到edge以及test仓库中。 2.2.2.4 安装Docker CE 执行如下命令,更新apt 包索引。 sudo apt-get update 执行如下命令,即可安装最新版本的Docker CE。任何已存在的Docker将会被覆盖安装。 sudo apt-get install docker-ce WARNING:如启用了多个Docker仓库,使用命令apt-get install 或apt-get update 命令安装或升级时,如未指定版本,那么将会安装最新的版本。这可能不适合您的稳定性要求。 在生产环境中,我们可能需要指定想要安装的版本,此时可使用如下命令列出当前可用的Docker版本。 apt-cache madison docker-ce 这样,列出版本后,可使用如下命令,安装想要安装的Docker CE版本。 sudo apt-get install docker-ce=<VERSION> Docker daemon会自动启动。 验证安装是否正确。 sudo docker run hello-world 2.2.2.5 升级Docker CE 如需升级Docker CE,只需执行如下命令: sudo apt-get update 然后按照安装Docker的步骤,即可升级Docker。 2.2.2.6 参考文档 Ubuntu安装Docker官方文档:https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/ ,文档还讲解了在Ubuntu中安装Docker CE的其他方式,本文不作赘述。 2.3 macOS 2.3.1 系统要求 macOS Yosemite 10.10.3或更高版本 2.3.2 安装步骤 前往https://store.docker.com/editions/community/docker-ce-desktop-mac ,点击页面右侧的“Get Docker”按钮,下载安装包; 双击即可安装。 2.4 Windows(docker for windows) 2.4.1 系统要求 Windows 10 Professional 或 Windows 10 Enterprise X64 对于Win 7,可使用Docker Toolbox(不建议使用) 2.4.2 安装步骤 前往https://store.docker.com/editions/community/docker-ce-desktop-windows ,点击页面右侧的“Get Docker”按钮,下载安装包; 双击即可安装。 2.5 其他系统 详见官方文档:https://docs.docker.com/engine/installation/ 2.6 加速安装 注册阿里云,参考该页面的内容安装即可:https://cr.console.aliyun.com/#/accelerator

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

CentOS7系统配置国内yum源和epel源

1.首先进入/etc/yum.repos.d/目录下,新建一个repo_bak目录,用于保存系统中原来的repo文件 [root@bogon ~]# cd /etc/yum.repos.d/ [root@bogon yum.repos.d]# mkdir repo_bak [root@bogon yum.repos.d]# mv *.repo repo_bak/ 2.在CentOS中配置使用网易和阿里的开源镜像 到网易和阿里开源镜像站点下载系统对应版本的repo文件 [root@bogon yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo [root@bogon yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo [root@bogon yum.repos.d]# ls Centos-7.repo CentOS-Base-163.repo repo.bak 或者手动下载repo文件并上传到/etc/yum.repos.d/目录 网易开源镜像站 阿里开源镜像站 3.清除系统yum缓存并生成新的yum缓存 [root@bogon yum.repos.d]# ls # 列出/etc/yum.repos.d/目录下的文件 Centos-7.repo CentOS-Base-163.repo repo.bak [root@bogon yum.repos.d]# yum clean all # 清除系统所有的yum缓存 Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Cleaning repos: base extras updates Cleaning up everything Cleaning up list of fastest mirrors [root@bogon yum.repos.d]# yum makecache # 生成yum缓存 Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/12): base/7/x86_64/filelists_db | 6.7 MB 00:00:02 (2/12): base/7/x86_64/group_gz | 156 kB 00:00:02 (3/12): base/7/x86_64/other_db | 2.5 MB 00:00:01 (4/12): base/7/x86_64/primary_db | 5.7 MB 00:00:02 (5/12): extras/7/x86_64/prestodelta | 51 kB 00:00:01 (6/12): extras/7/x86_64/filelists_db | 494 kB 00:00:02 (7/12): extras/7/x86_64/other_db | 86 kB 00:00:00 (8/12): extras/7/x86_64/primary_db | 130 kB 00:00:01 (9/12): updates/7/x86_64/prestodelta | 406 kB 00:00:01 (10/12): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01 (11/12): updates/7/x86_64/other_db | 354 kB 00:00:00 (12/12): updates/7/x86_64/primary_db | 3.6 MB 00:00:01 Determining fastest mirrors Metadata Cache Created 4.安装epel源 [root@bogon yum.repos.d]# yum list | grep epel-release Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration epel-release.noarch 7-9 extras [root@bogon yum.repos.d]# yum install -y epel-release Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:7-9 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================= Package Arch Version Repository Size ============================================================================================================= Installing: epel-release noarch 7-9 extras 14 k Transaction Summary ============================================================================================================= Install 1 Package Total download size: 14 k Installed size: 24 k Downloading packages: epel-release-7-9.noarch.rpm | 14 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : epel-release-7-9.noarch 1/1 Verifying : epel-release-7-9.noarch 1/1 Installed: epel-release.noarch 0:7-9 Complete! [root@bogon yum.repos.d]# ls # epel源安装成功,比原来多了一个epel.repo和epel-testing.repo文件 Centos-7.repo CentOS-Base-163.repo epel.repo epel-testing.repo repo.bak 5.再次清除系统yum缓存,并重新生成新的yum缓存 [root@bogon yum.repos.d]# yum clean all Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Cleaning repos: base epel extras updates Cleaning up everything Cleaning up list of fastest mirrors [root@bogon yum.repos.d]# yum makecache Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration base | 3.6 kB 00:00:00 epel/x86_64/metalink | 6.0 kB 00:00:00 epel | 4.7 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/18): base/7/x86_64/filelists_db | 6.7 MB 00:00:02 (2/18): base/7/x86_64/primary_db | 5.7 MB 00:00:01 (3/18): base/7/x86_64/other_db | 2.5 MB 00:00:00 (4/18): base/7/x86_64/group_gz | 156 kB 00:00:03 (5/18): epel/x86_64/group_gz | 261 kB 00:00:02 (6/18): epel/x86_64/updateinfo | 848 kB 00:00:05 (7/18): extras/7/x86_64/filelists_db | 494 kB 00:00:01 (8/18): extras/7/x86_64/prestodelta | 51 kB 00:00:00 (9/18): extras/7/x86_64/primary_db | 130 kB 00:00:00 (10/18): extras/7/x86_64/other_db | 86 kB 00:00:00 (11/18): updates/7/x86_64/filelists_db | 2.1 MB 00:00:01 (12/18): updates/7/x86_64/prestodelta | 406 kB 00:00:00 (13/18): updates/7/x86_64/primary_db | 3.6 MB 00:00:01 (14/18): updates/7/x86_64/other_db | 354 kB 00:00:00 (15/18): epel/x86_64/primary_db | 6.1 MB 00:00:11 (16/18): epel/x86_64/filelists_db | 9.8 MB 00:00:14 (17/18): epel/x86_64/prestodelta | 884 B 00:00:00 (18/18): epel/x86_64/other_db | 2.9 MB 00:01:15 Determining fastest mirrors * epel: mirrors.ustc.edu.cn Metadata Cache Created 6.查看系统可用的yum源和所有的yum源 [root@bogon yum.repos.d]# yum repolist enabled # 查看系统可用的yum源 Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Loading mirror speeds from cached hostfile * epel: mirrors.ustc.edu.cn repo id repo name status base/7/x86_64 CentOS-7 - Base - 163.com 9,591 epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,071 extras/7/x86_64 CentOS-7 - Extras - 163.com 282 updates/7/x86_64 CentOS-7 - Updates - 163.com 1,084 repolist: 23,028 [root@bogon yum.repos.d]# yum repolist all # 查看系统所有的yum源 Loaded plugins: fastestmirror, langpacks Repository base is listed more than once in the configuration Repository updates is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Loading mirror speeds from cached hostfile * epel: mirrors.ustc.edu.cn repo id repo name status base/7/x86_64 CentOS-7 - Base - 163.com enabled: 9,591 centosplus/7/x86_64 CentOS-7 - Plus - 163.com disabled contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,071 epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled epel-source/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debu disabled epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Sour disabled extras/7/x86_64 CentOS-7 - Extras - 163.com enabled: 282 updates/7/x86_64 CentOS-7 - Updates - 163.com enabled: 1,084 repolist: 23,028

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

Centos7服务器下apache网站环境搭建与wordpress

需要安装apache,php,mariadb 安装Apache yum install -y httpd apache启动并设置开机自启 systemctl start httpd.service systemctl enable httpd.service 安装PHP及其各项服务 yum -y install php php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-mysql 安装MariaDB数据库 yum -y install mariadb-server mariadb-client mariadb启动并设置开机自启 systemctl start mariadb.service systemctl enable mariadb.service 给数据库root用户设置密码 mysqladmin -u root password //以root身份登录,回车后输入密码 登录数据库 mysql -u root -p //回车后输入设置的密码 登录数据库后,可以新建其他用户并授全权 grant all privileges on mysql.* to 用户名@localhost identified by '用户名.me'; //修改用户为自己想建的用户名 update mysql.user set password=password('密码') where User="用户名" and Host="localhost"; //给新建用户设置密码 flush privileges; //更新数据库 exit; //退出数据库 防火墙开启80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd –reload //更新防火墙规则 解压wordpress tar -zxvf wordpress-4.7.4-zh_CN.tar.gz //默认应该是解压到/root/wordpress目录下 cp -fr /root/wordpress/* /var/www/html //复制wordpress所有文件到apache根目录 chown -R apache:root /var/www/html/ //不更改权限会导致主题和插件安装不了 浏览器输入服务器公网ip/域名,开始安装wordpress 注意:数据库名为mysql,用户名和密码为刚才在mariadb新建的用户名和密码,wp_表前缀最好修改,_不要删除 提交以后会提示无法写入wp-config.php,需要新建,然后把内容复制到里面 touch /var/www/html/wp-config.php vim /var/html/wp-config.php 全部内容都复制进去,保存退出,点击提交 开始设置网站标题和后台用户名和密码,不再赘述 修改wordpress文件上传上限以及执行脚本时间限制: vim /etc/php.ini 找到upload_max_filesize=2M,修改为upload_max_filesize=20M 找到post_max_size = 8M,修改为post_max_size = 20M 找到max_execution_time=30,修改为max_execution_time=0,这里的0表示没有时间限制

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

阿里云ECS服务器CentOS7上安装vsftpd服务

使用root登录 1.确保服务器系统处于最新状态 [root@localhost ~]# yum -y update 如果显示以下内容说明已经更新完成 Complete! 2.重启服务器 [root@localhost ~]# reboot 3.首先检查是否已经安装,如果已经安装先删除以前版本,以免安装不成功 [root@localhost ~]# rpm -qa | grep vsftpd 或 [root@localhost ~]# yum list installed | grep vsftpd 4.查看httpd包是否可用 [root@localhost ~]# yum list | grep vsftpd 5.安装vsftpd [root@localhost ~]# yum -y install vsftpd 6.设置vsftpd服务开机自启 [root@localhost ~]# systemctl enable vsftpd.service 7.检查是否已经安装了开机自动启动 [root@localhost ~]# systemctl list-unit-files | grep vsftpd 如果显示以下内容说明已经完成设置 vsftpd.service enabled 8.激活vsftpd服务 [root@localhost ~]# systemctl start vsftpd.service 9.将原有配置文件备份 [root@localhost ~]# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak 10.修改配置文件 [root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 11.常用配置 #设定不允许匿名访问 anonymous_enable=NO #设定允许本地用户可以访问 local_enable=YES #设定允许登陆用户有写权限 write_enable=YES local_umask=022 #anon_upload_enable=YES #anon_mkdir_write_enable=YES #如果启动这个选项,那么使用者第一次进入一个目录时,会检查该目录下是否有.message这个档案,如果有,则会出现此档案的内容,通常这个档案会放置欢迎话语,或是对该目录的说明。默认值为开启。 dirmessage_enable=YES #是否启用上传/下载日志记录。如果启用,则上传与下载的信息将被完整纪录在xferlog_file 所定义的档案中 xferlog_enable=YES #指定FTP使用20端口进行数据传输 connect_from_port_20=YES #chown_uploads=YES #chown_username=whoever #设置日志文件名和路径,默认值为/var/log/vsftpd.log。 xferlog_file=/var/log/vsftpd.log #启用,则日志文件将会写成xferlog的标准格式 xferlog_std_format=YES #设置多长时间不对FTP服务器进行任何操作,则断开该FTP连接,单位为秒 idle_session_timeout=600 #设置建立FTP数据连接的超时时间,单位为秒 data_connection_timeout=120 #nopriv_user=ftpsecure #async_abor_enable=YES #设定支持ASCII模式的上传功能 ascii_upload_enable=YES #设定支持ASCII模式的下载功能 ascii_download_enable=YES #定义欢迎话语的字符串 ftpd_banner=Welcome to FTP service. #deny_email_enable=YES #banned_email_file=/etc/vsftpd/banned_emails #将所有用户限制在主目录 chroot_local_user=YES #启动限制用户的名单 chroot_list_enable=YES #限制用户的名单列表,chroot_local_user=YES时,这些用户作为“例外”,不受限制 chroot_list_file=/etc/vsftpd/chroot_list #ls_recurse_enable=YES #设置vsftpd服务器是否以standalone模式运行 listen=YES #禁止使用ipv6 #listen_ipv6=YES pam_service_name=vsftpd userlist_enable=YES #这个是ftp根目录,根据你自己的情况配置 #local_root=/var/ftp tcp_wrappers=YES #若设置为YES,则使用PASV被动模式工作模式;若设置为NO,则使用PORT模式。默认值为YES,即使用PASV工作模式。 pasv_enable=YES #在PASV工作模式下,数据连接可以使用的端口范围的最大端口,0 表示任意端口。默认值为0。 pasv_max_port=33003 #在PASV工作模式下,数据连接可以使用的端口范围的最小端口,0 表示任意端口。默认值为0。 pasv_min_port=33000 #设置vsftpd允许的最大连接数,默认值为0,表示不受限制。若设置为100时,则同时允许有100个连接,超出的将被拒绝。只有在standalone模式运行才有效。 max_clients=50 #设置每个IP允许与FTP服务器同时建立连接的数目。默认值为0,表示不受限制。只有在standalone模式运行才有效。 max_per_ip=50 12.创建FTP用户网站根目录 [root@localhost ~]# mkdir -p /home/ftpusername/www/{databases,logfiles,others,wwwroot} 13.增加FTP账户 [root@localhost ~]# useradd ftpusername -d /home/ftpusername/www 14.给FTP账户设置密码 [root@localhost ~]# passwd ftpusername 15.给FTP账户设置权限,用户不允许登录(通过ftp可以连接) [root@localhost ~]# usermod -s /sbin/nologin ftpusername 16.修改用户网站根目录权限 [root@localhost ~]# chown -R ftpusername /home/ftpusername/www/wwwroot [root@localhost ~]# chmod -R 777 /home/ftpusername/www/wwwroot 17.创建用户工作组 [root@localhost ~]# groupadd clent 18.把Ftp用户移动指定工作组 [root@localhost ~]# usermod -G clent ftpusername 19.创建限制用户的名单列表文件 [root@localhost ~]# vim /etc/vsftpd/chroot_list

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

解决Centos7 下安装PHP7 phpredis扩展报错办法

heckingwhether-lcshouldbeexplicitlylinkedin...no checkingdynamiclinkercharacteristics...GNU/Linuxld.so checkinghowtohardcodelibrarypathsintoprograms...immediate checkingwhetherstrippinglibrariesispossible...yes checkingiflibtoolsupportssharedlibraries...yes checkingwhethertobuildsharedlibraries...yes checkingwhethertobuildstaticlibraries...no creatinglibtool appendingconfigurationtag"CXX"tolibtool configure:creating./config.status config.status:creatingconfig.h [root@iZ236oj5mp5Zphpredis-master]#make&&makeinstall /bin/sh/usr/local/src/redis-stable/phpredis-master/libtool--mode=compilecc-I.-I/usr/local/src/redis-stable/phpredis-master-DPHP_ATOM_INC-I/usr/local/src/redis-stable/phpredis-master/include-I/usr/local/src/redis-stable/phpredis-master/main-I/usr/local/src/redis-stable/phpredis-master-I/usr/local/php/include/php-I/usr/local/php/include/php/main-I/usr/local/php/include/php/TSRM-I/usr/local/php/include/php/Zend-I/usr/local/php/include/php/ext-I/usr/local/php/include/php/ext/date/lib-DHAVE_CONFIG_H-g-O2-c/usr/local/src/redis-stable/phpredis-master/redis.c-oredis.lo mkdir.libs cc-I.-I/usr/local/src/redis-stable/phpredis-master-DPHP_ATOM_INC-I/usr/local/src/redis-stable/phpredis-master/include-I/usr/local/src/redis-stable/phpredis-master/main-I/usr/local/src/redis-stable/phpredis-master-I/usr/local/php/include/php-I/usr/local/php/include/php/main-I/usr/local/php/include/php/TSRM-I/usr/local/php/include/php/Zend-I/usr/local/php/include/php/ext-I/usr/local/php/include/php/ext/date/lib-DHAVE_CONFIG_H-g-O2-c/usr/local/src/redis-stable/phpredis-master/redis.c-fPIC-DPIC-o.libs/redis.o Infileincludedfrom/usr/local/src/redis-stable/phpredis-master/redis.c:27:0: /usr/local/src/redis-stable/phpredis-master/common.h:3:40:致命错误:ext/standard/php_smart_str.h:没有那个文件或目录 #include<ext/standard/php_smart_str.h> ^ 编译中断。 make:***[redis.lo]错误1 解决办法,因为最新的 phpredis 分了几大分支,针对最新的PHP稳定发行版 php7 有专门为php7的分支,所以我们从github拉下phpredis 源码 需要切换到 PHP7的分支 首先git clone phpredis : git clone https://github.com/nicolasff/phpredis git checkout php7 /usr/local/php7/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install 然后看到了等字样,就说明安装成功了

资源下载

更多资源
优质分享Android(本站安卓app)

优质分享Android(本站安卓app)

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

Mario,低调大师唯一一个Java游戏作品

Mario,低调大师唯一一个Java游戏作品

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

Java Development Kit(Java开发工具)

Java Development Kit(Java开发工具)

JDK是 Java 语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。JDK是整个java开发的核心,它包含了JAVA的运行环境(JVM+Java系统类库)和JAVA工具。

Sublime Text 一个代码编辑器

Sublime Text 一个代码编辑器

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