背景

后台开发需要随时与服务器交互,本人使用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. JQuery表格插件DataTables 当前页合计功能

    公司项目表格插件使用的是DataTables,最近添加表合计功能,发现百度统一都是如图类型的代码,不知道是配置问题还是怎么了,在我的页面下根本不能用 var addd=0; $(document).r ...

  2. C# 发送邮件中包含图片

    List<string> To = new List<string>(); To.Add("jake_ge@askey.com.tw"); List< ...

  3. unity3D项目中如何避免硬代码(C#)

    平时做项目,代码中是不允许出现硬代码的,一般我们是怎么处理的呢? 那么硬代码又是什么呢? 我们俗称的硬代码:eg:   label.text = "欢迎来到梦幻岛";  这样我们俗 ...

  4. Maven 配置远程仓库

    最近要用到一个包:spark-1.6.0-cdh5.8.2,在https://mvnrepository.com网站上搜到该包的pom.xml语句.但是看到下面有这样一句话: 该包在图中所述repos ...

  5. spring源码解析——spring源码导入eclipse

    一.前言     众所周知,spring的强大之处.几乎所有的企业级开发中,都使用了spring了.在日常的开发中,我们是否只知道spring的配置,以及简单的使用场景.对其实现的代码没有进行深入的了 ...

  6. MongoDB实现分页(两种方法)

    1.插入实验数据 偷懒用下samus,100条. ; i < ; i++) { Document doc = new Document(); doc["ID"] = i; d ...

  7. 面向对象课后深入学习(C++ 类的静态成员详细讲解)

    今天在刚申请了博客,一下午都在写那个随笔,所以说好的来看c++的也放在了最后,下星期就考试了,这个类的静态成员是我不是很懂的,在网上 看到一片很详细的博客考下来回去慢慢看. 在C++中,静态成员是属于 ...

  8. 文件处理命令:sed

    使用:sed [-nefr] actionaction:-i直接修改读取的档案内容,而不是由屏幕输出,-r表示支持延伸型正则表达式的语法.动作说明:[n1[,n2]] function n1,n2表示 ...

  9. 无法加载 DLL“SQLite.Interop.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)

    SQLite部署-无法加载 DLL“SQLite.Interop.dll”: 找不到指定的模块 近期刚使用SQLite,主要引用的是System.Data.SQLite.dll这个dll,在部署到测试 ...

  10. Sublime Text 3实用快捷键大全

      下面是我通过网上教程和文本资料学习sublime Text3时收集的一些实用功能和常用快捷键,现在分享出来,如果还有其它的好用的功能可以在下面留言,以便互相学习和交流,谢谢!. 选择类 Ctrl+ ...