[iyunv@gitlab ~]# tar Jxf Python-2.7.6.tar.xz
[iyunv@gitlab ~]# cd Python-2.7.6
[iyunv@gitlab ~]# ./configure --prefix=/usr/local/python
[iyunv@gitlab ~]# make && make install
[iyunv@gitlab redis-3.0.3]# ./utils/install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] /etc/redis.conf
Please select the redis log file name [/var/log/redis_6379.log] /var/log/redis.log
Please select the data directory for this instance [/var/lib/redis/6379] /var/lib/redis.pid
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port : 6379
Config file : /etc/redis.conf
Log file : /var/log/redis.log
Data dir : /var/lib/redis.pid
Executable : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
更改redis的启动脚本,并启动服务
1
2
[iyunv@gitlab ~]# mv /etc/init.d/redis_6379 /etc/init.d/redis
[iyunv@gitlab ~]# service redis start
4、安装MySQL数据库
MySQL的编译安装文档很多,这里为了方便,我采用的是yum安装过程
1
[iyunv@gitlab ~]# yum install mysql mysql-server mysql-devel -y
为了保证数据的安全,应该数据和二进制日志会放在单独的分区中
1
2
[iyunv@gitlab ~]# vim /etc/my.cnf
datadir = /data/mysql
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
上面对于数据库的部署已经OK了,下面就要为gitlab创建一个库用来存储数据
1
2
3
4
5
6
7
8
9
10
11
12
[iyunv@gitlab ~]# mysql -uroot -pgitlab
mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'gitlab';
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE DATABASE IF NOT EXISTS `gitlab` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlab`.* TO 'gitlab'@'localhost';
Query OK, 0 rows affected (0.00 sec)
[iyunv@gitlab ~]# su - git
[git@gitlab ~]$ cd gitlab
修改Gemfile文件,将gem源改成淘宝的源
1
2
[git@gitlab ~]$ vim Gemfile
source "http://ruby.taobao.org"
安装一些依赖包
1
2
3
4
5
6
7
8
9
10
11
12
13
[git@gitlab ~]$ bundle install --deployment --without development test postgres puma aws
...
Remember to run generator to generate sample file and include mousetrap-rails with Rails Asset Pipeline
$ rails generate mousetrap:install
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
[git@gitlab ~]$ bundle exec rake gitlab:setup RAILS_ENV=production
...
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? yes