背景

后台开发需要随时与服务器交互,本人使用Mac开发。但是不愿意在Mac上直接安装redis以及mysql等等工具。所以选择在VirtualenvBox下安装一个服务器系统,并且使用ssh与其连接。为方便日后环境重现,记录下安装配置过程。本文介绍开发人员必备的常见工具及数据库。

开始

1,下载镜像,这里我选择CentOS版本。

2,安装系统。

3,配置超级用户权限

vi /etc/sudoers

增加如下信息

frank  ALL=(ALL)   ALL

4,配置网络。

cd /etc/sysconfig/network-scripts
vi ifcfg-enp0s3

然后是把ONBOOT=no修改为ONBOOT=yes

5,配置yum

安装工具

1,安装VIM

sudo yum install vim

2,安装[netstat]

yum install net-tools

3,安装SSH

sudo yum install openssh-server

配置ssh

vim /etc/ssh/sshd_config

修改以下几项为。

Port 22
AddressFamily any

然后是修改/etc/hosts.allow/etc/hosts.deny

分别在最后文件的最后一行添加如下语句

sshd:ALL

重启sshd服务

systemctl restart sshd.service

新的centOS系统已经不再使用service xxxx restart命令了。

测试sshd服务是否已经启用。

netstat -ltnp

随机启动可以通过如下命令。

systemctl enable sshd.service

4,安装[wget]

yum install wget

5,安装[nc]

yum install nc

6,安装[gcc]

yum install gcc

7,安装[g++]

sudo yum install gcc-c++

8,安装[tmux]

yum install tmux

9,安装[bzip2]

sudo yum install bzip2

安装Python

1,安装[python]

sudo yum -y install python-devel
sudo yum -y install python-setuptools

2,安装[pip]

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python get-pip.py

3,安装[virtualenv]

sudo pip install virtualenv

4,安装[supervisor]

sudo pip install supervisor

启动

echo_supervisord_conf > /etc/supervisord.conf
supervisord

运行客户端测试服务

supervisorctl

安装VirtualBox扩展

sudo mount -t auto /dev/cdrom /mnt/
sudo sh ./VBoxLinuxAddition.run

依赖源

如果安装redis或者nginx等,出现如下错误

[root@localhost frank]# yum -y install redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
No package redis available.

上面的错误提示都可以通过下面的方式解决。

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

安装数据库

1,安装Redis

sudo yum -y install redis

安装成功后可以通过下面的命令启动。

systemctl start redis.service

随机启动可以通过如下命令。

systemctl enable redis.service

2,安装MySQL

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo yum install mysql-server

启动

systemctl restart mysql.service

root用户设置密码

mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

3,安装MongoDB

新建如下文件。

vi /etc/yum.repos.d/mongodb.repo

添加如下代码。

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

开始安装

sudo yum install mongodb-org

启动

systemctl start mongod.service

MongoDB参考

4,安装Nginx

wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install nginx

安装消息队列

1,安装ZeroMQ

sudo yum install zeromq

2,安装[RabbitMQ]

rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
yum install rabbitmq-server
systemctl start rabbitmq-server
systemctl enable rabbitmq-server

CentOS On VirtualBox的更多相关文章

  1. centos安装VirtualBox增强包VBoxGuestAdditions

    1.如果你的CentOS 版本早于 6,那么需要在 /etc/grub.conf 中添加一行 divider=10,以将这个参数传递给核心,以减少 idle CPU load.   2.#yum up ...

  2. OS + CentOS 7 / centos 7 / VirtualBox /vegrant

    s VirtualBox:解决VirtualBox安装时libSDL-1.2.so.0()错误的问题. http://www.sklinux.com/983 为Centos6.2安装VirtualBo ...

  3. virtualbox centos安装增强工具和Centos与VirtualBox共享文件夹设置

    VirtualBox 大家都习惯性把它简称为 Vbox ,比 VM 的体积小.开源.速 度快.不过在使用 VirtualBox  在虚拟机中安装 CentOS 之后,不能直接运行安装好 Virtual ...

  4. CentOS安装VirtualBox增强工具

    安装过程中出现错误: Bulding the VirtualBox Guest Additions Kernel modules failedYour system does not seem to  ...

  5. centos安装virtualbox

    参考:http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-r ...

  6. CentOS在VirtualBox虚拟机中网络配置

    1. 宿主机网络参数  2. 右键设置,对虚拟机进行设置网络 3.虚拟机   vi   /etc/sysconfig/network-scripts/ifcfg-eth1   打开该配置文件 eth0 ...

  7. CentOS下使用VirtualBox 安装 Windows虚拟机的简单方法

    1.物理服务器安装CentOS7.5 2. 安装VNC 3. 关闭防火墙,关闭selinux,上传virtualbox的rpm包. http://download.virtualbox.org/vir ...

  8. vagrant + virtualbox安装centos环境+docker安装

    1. 下载vagrant 并安装,安装完成后,输入vagrant回车查看是否安装成功 2. 下载virtualbox.box并安装,安装完成后. 3. 创建虚拟机文件夹,例如.F:/vmimg/fir ...

  9. CentOS 6.5安装KVM实践

    一,安装CentOS6.5,使用最小化的minimal安装二.安装完CentOS后,使用root登录配置网卡,使虚拟机可以使用外网上网 vi /etc/sysconifg/network-script ...

随机推荐

  1. ASP.NET 一句代码实现批量数据绑定

    摘要:对于一个以数据处理为主的应用中的UI层,我们往往需要编写相当多的代码去实现数据绑定.如果界面上的控件和作为数据源的实体类型之间存储某种约定的映射关系,我们就可以实现批量的数据绑定,作者开发了的插 ...

  2. 手持移动扫描终端 PDA移动开单系统-批发零售管理

    条码数据采集器通过扫描商品条码移动开单,实现便携式办公,伴随式销售,是我公司的一款最新便携式开单配套产品,采集器能通过WIFI无线局域网.GPRS互联网直接与主机连接,让公司业务人员能随时随地了解公司 ...

  3. 【转】C/S,B/S区别

    C/S结构,即Client/Server(客户机/服务器)结构,是大家熟知的软件系统体系结构,通过将任务合理分配到Client端和Server端,降低了系统的通讯开销,可以充分利用两端硬件环境的优势. ...

  4. MsSQLserver中修改字段值系统自动生成的脚本

    主要参考一下脚本的实现思路: ①创建临时表 ②创建临时表 ③向临时表插入数据 ④删除原表 ⑤临时表改名 /* 为了防止任何可能出现的数据丢失问题,您应该先仔细检查此脚本,然后再在数据库设计器的上下文之 ...

  5. 从OOP的角度看Golang

    资料来源 https://github.com/luciotato/golang-notes/blob/master/OOP.md?hmsr=toutiao.io&utm_medium=tou ...

  6. JS操作Json

    因为我水啊 所以我就要手打一下 熟悉一下 ===== JSON 全称 JavaScript Object Notation(标记) 一种轻量级的数据交互格式,采用完全独立于语言的文本格式 同事JSON ...

  7. delay(和setTimeout()的区别

    近来几日在写游戏代码时,频繁会用到定时器,偶尔想到有个.delay()方法,用了几次发现两者效果相差很大,遂就仔细考究了一下两者的区别! 1. setTimeout函数是从页面开始的时候计算time的 ...

  8. linux终端 字符界面 显示乱码

    方法一:配置SSH工具 SecureCRT中文版配置 [全局选项]→[默认会话]→[编辑默认设置]→[终端]→[外观]→[字体]→[新宋体 10pt CHINESE_GB2312]→[字符编码 UTF ...

  9. flash小游戏在Kongregate上线——BasketBall Master(篮球大师)

    小游戏地址,欢迎上去留言评论.游戏完成度没有达到期望水平,只能算完成了核心玩法吧,一些其他构想来不及实现. BasketBall Master(篮球大师) 这个小游戏很早之前就基本做好了,只因有些细节 ...

  10. MFC覆盖OnPrepareDC实现“所见即所得”打印

    附件下载:http://files.cnblogs.com/mengdejun/print.zip void CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* ...