CentOS On VirtualBox
背景
后台开发需要随时与服务器交互,本人使用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
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的更多相关文章
- centos安装VirtualBox增强包VBoxGuestAdditions
1.如果你的CentOS 版本早于 6,那么需要在 /etc/grub.conf 中添加一行 divider=10,以将这个参数传递给核心,以减少 idle CPU load. 2.#yum up ...
- OS + CentOS 7 / centos 7 / VirtualBox /vegrant
s VirtualBox:解决VirtualBox安装时libSDL-1.2.so.0()错误的问题. http://www.sklinux.com/983 为Centos6.2安装VirtualBo ...
- virtualbox centos安装增强工具和Centos与VirtualBox共享文件夹设置
VirtualBox 大家都习惯性把它简称为 Vbox ,比 VM 的体积小.开源.速 度快.不过在使用 VirtualBox 在虚拟机中安装 CentOS 之后,不能直接运行安装好 Virtual ...
- CentOS安装VirtualBox增强工具
安装过程中出现错误: Bulding the VirtualBox Guest Additions Kernel modules failedYour system does not seem to ...
- centos安装virtualbox
参考:http://www.if-not-true-then-false.com/2010/install-virtualbox-with-yum-on-fedora-centos-red-hat-r ...
- CentOS在VirtualBox虚拟机中网络配置
1. 宿主机网络参数 2. 右键设置,对虚拟机进行设置网络 3.虚拟机 vi /etc/sysconfig/network-scripts/ifcfg-eth1 打开该配置文件 eth0 ...
- CentOS下使用VirtualBox 安装 Windows虚拟机的简单方法
1.物理服务器安装CentOS7.5 2. 安装VNC 3. 关闭防火墙,关闭selinux,上传virtualbox的rpm包. http://download.virtualbox.org/vir ...
- vagrant + virtualbox安装centos环境+docker安装
1. 下载vagrant 并安装,安装完成后,输入vagrant回车查看是否安装成功 2. 下载virtualbox.box并安装,安装完成后. 3. 创建虚拟机文件夹,例如.F:/vmimg/fir ...
- CentOS 6.5安装KVM实践
一,安装CentOS6.5,使用最小化的minimal安装二.安装完CentOS后,使用root登录配置网卡,使虚拟机可以使用外网上网 vi /etc/sysconifg/network-script ...
随机推荐
- Arc GIS engine10.2与VS2012的安装及匹配步骤
本文章已收录于: .embody { padding: 10px 10px 10px; margin: 0 -20px; border-bottom: solid 1px #ededed } ...
- 搜索技巧<转>
平时工作,搜索引擎是少不了的,作为程序员,当然首推 Google.这里简单介绍下几个 Google 搜索的小技巧,方便别人也方便自己查阅. ps:以下所有操作,均可以在 「谷歌搜索首页 -> 设 ...
- iOS APP可执行文件的组成
iOS APP编译后,除了一些资源文件,剩下的就是一个可执行文件,有时候项目大了,引入的库多了,可执行文件很大,想知道这个可执行文件的构成是怎样,里面的内容都是些什么,哪些库占用空间较高,可以用以下方 ...
- Bootstrap 简洁、直观、强悍的前端开发框架,让web开发更迅速、简单。
Bootstrap 简洁.直观.强悍的前端开发框架,让web开发更迅速.简单.
- tungsten抽取和应用mysql binlog
首先举例说明 api的基本使用方式 首先进行配置 , 可以看到源数据库和目的数据库 TungstenProperties tp=new TungstenProperties(); tp.setStri ...
- Java_位运算(移位、位与、或、异或、非)
public class Test { public static void main(String[] args) { // 1.左移( << ) // 0000 0000 0000 0 ...
- OpenGL编程指南(第七版)
OpenGL编程指南(第七版) 转自:http://blog.csdn.net/w540982016044/article/details/21287645 在接触OpenGL中,配置显得相当麻烦,特 ...
- JSON数据和对象
在js中像数字类型.字符串类型.布尔类型这些都不能再被拆分,属于基本类型.与之相对有一种复杂类型:对象类型,它是本身由多个其他类型组合而成的. 创建对象有两种方法,一.new Object()创建一个 ...
- Python新建动态命名txt文件
# -*- coding: utf-8 -*- import os,sys,time fname=r"D:\01-学习资料\python" def GetNowTime():#获取 ...
- Smart3D系列教程3之 《论照片三维重建中Smart3D几个工作模块的功能意义》
[摘要] 近年来,倾斜摄影测量技术是国际测绘遥感领域近年发展起来的一项高新技术,利用照片进行三维重建成为一项关键性的技术.Smart3D软件,是照片三维重建主流软件之一,本文将就Smart3D建模软件 ...