阿里云centOS配置实录

Step1. 系统挂载数据盘

df -h,看不到数据盘。

fdisk -l ,可以看到数据盘

执行“fdisk -S 56 /dev/xvdb”命令,对数据盘进行分区;

根据提示,依次输入“n”,“p”“1”,两次回车,“wq”,分区就开始了,很快就会完成。

使用“fdisk -l”命令可以看到,新的分区xvdb1已经建立完成了。

使用“mkfs.ext3 /dev/xvdb1”命令对新分区进行格式化

使用“echo ‘/dev/xvdb1 /mnt ext3 defaults 0 0′ >> /etc/fstab”(不含引号)命令写入新分区信息。然后使用“cat /etc/fstab”命令查看。

使用“mount -a”命令挂载新分区,然后用“df -h”命令查看,出现以下信息就说明挂载成功,可以开始使用新的分区了。

Step2 安装node

确认服务器有nodejs编译及依赖相关软件,如果没有可通过运行以下命令安装。[root@BobServerStationlocal]#yum -y install gcc gcc-c++ openssl-devel下载NodeJS源码包并解压。

[root@BobServerStationlocal]#wgethttp://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz

[root@BobServerStationlocal]# tar zxvfnode-v0.10.24.tar.gz

[root@BobServerStationlocal]# cd node-v0.10.24配置、编译、安装。

[root@BobServerStationnode-v0.10.24]#./configure –prefix=/usr/local/node

[root@BobServerStationnode-v0.10.24]# make && make install接下来配置Node环境

[root@BobServerStationnode-v0.10.24]#vim /etc/profile

#set nodejs envexport NODE_HOME=/usr/local/nodeexport PATH=$NODE_HOME/bin:$PATHexport NODE_PATH=$NODE_HOME/lib/node_modules:$PATH[root@BobServerStationnode-v0.10.24]#source /etc/profile –重启生效测试是否安装成功

[root@BobServerStationnode-v0.10.24]#node -v

v0.10.24

step3 搭建git服务器安装git:#yum install git安装python的setuptool#yum install python python-setuptools安装gitosis#git clone git://github.com/res0nat0r/gitosis.git

#cd gitosis/

#python setup.py install

客户端生产密钥并上传到服务器端:

#ssh-keygen -t rsa

#scp ~/.ssh/id_rsa.pub root@服务器ip:~/

在服务器端生成管理库:

#sudo -H -u git gitosis-init < ~/id_rsa.pub

Initialized empty Git repository in /home/git//repositories/gitosis-admin.git/ Reinitialized existing Git repository in /home/git/repositories/gitosis-admin.git/

注解:

1. 生成的gitosis-admin为Git的用户访问权限管理库,gitosis通过这个git库来管理所有git库的访问权限。

2. 通过执行初始化,该公钥的拥有者就能修改用于配置gitosis的那个特殊Git仓库了

修改上传权限:

#chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

阿里云centOS配置实录

相关文章:

你感兴趣的文章:

标签云: