2019/04/03Linux虚拟机配置记录
初始配置
网络配置
/etc/sysconfig/network-scripts
附ifcfg-XX配置
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=fc7c6548-7621-4075-b28e-4a18407b0b7e
DEVICE=ens33
ONBOOT=yes
IPADDRO=192.168.74.1
PREFIXO=24
GATEWAYO=192.168.74.0
DNS1=114.114.114.114
yum配置成阿里云镜像
yum -y install wget
wget http://mirrors.aliyun.com/repo/Centos-7.repo
mv CentOS-Base.repo CentOS-Base.repo.bak
mv Centos-7.repo CentOS-Base.repo
yum clean all
yum makecache
安装peal环境
yum install perl*
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
配置开启ftp
yum -y install vsftpd
vim /etc/vsftpd/vsftpd.conf
systemctl restart vsftpd.service
chmod 777 /ftp
553 Could not create file报错
getsebool -a | grep ftp(查看ftp功能权限)
setsebool allow_ftpd_full_access on(重启失效)
setsebool -P allow_ftpd_full_access on(长久生效,重启不会失效)
增加ftp用户
useradd -d /ftp -s /sbin/nologin poer
passwd poer
附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=YES
#
# 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
anon_other_write_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.
安装rz sz
yum -y install lrzsz
mongodb
tar -zxvf mongodb-linux-x86_64-4.0.8.tgz
export PATH=/usr/local/mongodb/mongodb-linux-x86_64-4.0.8/bin:$PATH
mongod -f mongodb.conf
mongo奇怪报错修复
mongod --repair
mongo无法宿主机访问
bind_ip=0.0.0.0
附mongo.conf
dbpath=/usr/local/mongodb/data/
logpath=/usr/local/mongodb/logs/mongodb.log
logappend=true
port=27017
fork=true
bind_ip=0.0.0.0