背景

后台开发需要随时与服务器交互,本人使用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. hoj 2662 经典状压dp // MyFirst 状压dp

    题目链接:http://acm.hit.edu.cn/hoj/problem/view?id=2662 1.引言:用dp解决一个问题的时候很重要的一环就是状态的表示,一般来说,一个数组即可保存状态. ...

  2. jsp中如何判断el表达式中的BigDecimal==0

    比较蠢一点的做法: <c:if test="${not ((someBigDecimal < 0) or (someBigDecimal > 0))}"> ...

  3. asp.net(C#)读取文件夹和子文件夹下所有文件,绑定到GRIDVIEW并排序 .

    Asp部分: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyFiles ...

  4. linux shell输出带颜色文本

    echo -e "\033[33;31m Color Text" - red echo -e "\033[33;32m Color Text" - green ...

  5. .NET CLI 命令

    您可以立即使用的部分通用 .NET CLI 命令 命令 说明 dotnet new 使用 C# 语言初始化用于类库或控制台应用程序的有效项目. dotnet restore 还原在指定项目的 proj ...

  6. java的基础知识文件操作和标识符

    1.文件夹的操作 dir :显示当前文件夹中的所有文件和文件夹. cd 路径:  进入到指定的路径. cd ..  : 回到上一级目录 cd  \ : 回到当前目录的跟目录 md 文件夹名  创建一个 ...

  7. thrift 服务端linux C ++ 与客户端 windows python 环境配置(thrift 自带tutorial为例)

    关于Thrift文档化的确是做的不好.摸索了很久才终于把跨linux与windows跨C++与python语言的配置成功完成.以下是步骤: 1)                 Linux下环境配置 ...

  8. JavaScript鼠标经过图片的放大镜效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. qemu ubuntu for zynq(armhf)

    apt-get install qemu-user-static qemu-system mkdir qemu-ubuntu qemu-debootstrap --arch=armhf trusty ...

  10. solr使用语法笔记

    http://127.0.0.1:8095/shangbiao_sale/select?sort=id+desc&fq=&wt=json&json.nl=map&q=s ...