If you can access all of your projects, data files, songs, movies, photos and so on, anytime, anywhere, with any device (ipad on your mobile phone), here's how it works.
Installation environment: Ubuntu Server 14.04
1: Install Gitlab (open source version Management Server, emulated by GitHub)
Download and install Gitlab
Official Note document: https://about.gitlab.com/downloads/
Before installing the Gitlab, you first need to install OpenSSH and postfix, if the installation system selects the software package directly selected Openssh-server, then these two packages will not need to install again
sudo apt-get install Openssh-server
sudo apt-get install Postfix
Download the Deb package using wget (wget default download to the current directory), the official package on the Amazon S3, the domestic download speed is very slow (you know ...) ), can even under the foreign VPN, the speed will be a bit faster.
wget Https://downloads-packages.s3.amazonaws.com/debian-7.8/gitlab_7.8.1-omnibus-1_amd64.deb
Installation is simple, a sentence to be done
sudo dpkg-i gitlab_7.8.1-omnibus-1_amd64.deb
Once the installation is complete, you must reload the configuration to access
sudo gitlab-ctl reconfigure
Next, you can access the test, the default port is 80, direct browser input IP or domain name, at this time, Gitlab is ready to use. Default User name password (first login will require password change):
Username:root
Password:5ivel!fe
Start Stop and restart:
sudo gitlab-ctl status
sudo gitlab-ctl stop
sudo gitlab-ctl restart
Set Gitlab
Official configuration and Help document address:
Https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
In fact, there are not many items that need to be configured, the configuration file path:
/etc/gitlab/gitlab.rb
Although Gitlab based on N and many other services, but all the settings are integrated in this configuration file, do not need to set up a separate n, such as its own configuration file (except for the depth settings), all the settings in the file is commented out (using the default), if you need to configure, remove the line at the beginning of # can make the configuration effective
After modifying the configuration, remember to reload for the configuration to take effect
sudo gitlab-ctl reconfigure
To configure the default host address and port number:
#例如修改成http://www.xx.com, Port 3131:
External_url "http://www.xx.com:3131"
Modify the Git archive data location (default in/var/opt/gitlab/git-data/repositories):
#例如修改到/mnt/nas/git-data
Git_data_dir "/mnt/nas/git-data"
To migrate archived data, first modify the configuration file, specify the GIT archive data location to the new location, and then:
#停止服务 to prevent someone from submitting
sudo gitlab-ctl stop
#迁移数据 (Rsync is a data-mirroring backup tool that comes with Linux, and uses Google for its own functionality)
sudo rsync-av/var/opt/gitlab/git-data/repositories/mnt/nas/git-data/
#重载配置
sudo gitlab-ctl reconfigure
#确认一下是否有数据存在
sudo ls/mnt/nas/git-data/
#启动
sudo gitlab-ctl start
Gitlab Problems encountered
Installation can not receive verification messages, modify the mail server use 163 also do not, sent the mail is treated as spam, only use Gmail registration to succeed, but my gitlab mainly for the team internal use, so I have the root user login manually created account, so did not delve into this issue , if you solve this problem, please reply to the solution.
2: Download and install peanut shells (dynamic IP parsing)
To register a peanut shell account, you will get a level two domain name and then download and install the Peanut Shell client.
The official documents are already very detailed.
Http://service.oray.com/question/1890.html
Install (note whether the file name is the same as the download version):
Dpkg-i Phddns_2.0.6_i386.deb
Run and configure
After installation, run under Terminal: Phddns
The following series of prompt questions will appear:
First step: Enter server address (press Enter use phddns60.oray.net):
This is prompted to enter the Peanut Shell server domain name, if the site does not update the domain name of the bulletin description, this step directly enter, will use the default phddns60.oray.net domain name.
Step two: Enter your Oray account:
This is to prompt you to enter the Peanut Shell website registered user name, please enter according to the actual situation.
Step Three: Password:
This is prompted to enter the Peanut Shell website registered user name corresponding password, please enter according to the actual situation.
Fourth Step: Network Interface (s):
[Eth0] = [ip:192.168.33.195]
[Lo] = [ip:127.0.0.1]
Choose One (default eth0):
This is to configure your server's network parameters, the peanut shell software will automatically check and output your network situation. The eth0 section may not be the same as above, which is your actual network settings.
If you have two NICs, eth0 and eth1, and you want to use eth1 to bind the peanut shells, enter eth1 here and then enter. If you have only one network card, or if you want to use eth0 to bind the peanut shell, enter it directly here.
Fifth step: Log to use (Default/var/log/phddns.log):
This is prompting you to enter the location where the peanut shell software log is saved, use the absolute path to specify the log file name. If you enter directly, you will use/var/log/phddns.log to save the log.
Sixth step: Save to configuration file (/etc/phlinux.conf)? (Yes/no/other):
This is the save file name that prompts you to enter the above configuration.
If you enter yes or a direct carriage return,/etc/phlinux.conf will be used as the saved file name for the configuration.
If you enter other, you will be prompted to specify the file name yourself, using an absolute path to specify the profile name.
If you enter no, do not save the above configuration, the next time you re-use the peanut shell, you need to manually specify the configuration file or again through interactive mode settings.
After the sixth step is completed, the screen will appear in turn:
defonstatuschanged OK
Domainsregistered
Usertype
This means that the peanut shell software is registered and running successfully.
By adding the/etc/rc.local
/usr/bin/phddns-c/etc/phlinux.conf-d
Auto-run on boot
which
-c Specifies the configuration file, if not by default, it needs to be filled in by the actual
-D Run with daemon
You can use Ps-ef | grep Phddns to see if there is a process related to the peanut shell software.
After the first installation configuration, you need to modify the configuration later, you can edit the configuration file yourself, and then terminate the relevant process, using
/usr/bin/phddns-c/etc/phlinux.conf-d
Start again, and you can run the modified profile content.
Problem:
Not sure if the peanut shell needs to expose the port in the router, because I have other applications, I have exposed the Gitlab port (3131) on my own router.
3: Bind your own domain name to the host
In their own domain name resolution management, add CNAME resolution record, point to the peanut shell provided by the two-level domain name can be. Note that many domestic carriers block the 80 and 8080 ports of ADSL users, and if your domain name is inaccessible, modify the default port of Gitlab.
4: Private Cloud
is FTP, oneself in this machine to install a good, anytime and anywhere can access, FTP client will not need me to introduce it.
Set up your own private github+ data center and access via domain name (ADSL dynamic IP support)