Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

TeamCity: installing Server

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article describes the installation of TeamCity Server 10.0.1 in Ubuntu Server 14.04. The user tcuser has been created on Ubuntu Server. The installation package for TeamCity is TeamCity-10.0.1.tar.gz, which uses Postgresql 9.4 instead of the database that comes with TeamCity.

Install the Postgresql database

Please refer to the author's previous blog post "Ubuntu14.04 installation postgresql9.4" to install Postgresql 9.4, and refer to the description in the article to create the database tcdb and the role dbuser. Note that set the password for tcuser so that you are ready to configure TeamCity later.

Install JDK

Please refer to the author's previous blog post "Ubuntu14.04 install JDK" to install JDK.

Extract the TeamCity Server installation package

Log in to Ubuntu Server using tcuser and use the following command to extract the text to the home directory:

$tar-xf TeamCity-10.0.1.tar.gz-C ~ / set the Postgresql JDBC driver

Create the .BuildServer / lib/jdbc directory under the tcuer user's home directory.

Go to postgresql's website to download the 9.4 jdbc driver postgresql-9.4-*.jar (please download the corresponding driver version according to your JDK version).

Put the downloaded postgresql driver in the directory ~ / .BuildServer/lib/jdbc.

Initialize TeamCity Server

Go to the / home/tcuser/TeamCity/bin directory and execute the following command:

$. / teamcity-server.sh start

Start initializing TeamCity Server by accessing xxx.xxx.xxx.xxx:8111/, through IP in the browser.

Straight to the next step

Select PostgreSQL database

Set up the database and database users. Then agree to the license agreement and you can create an administrator account:

After the administrator account is created, the initialization process of TeamCity Server is completed. After login, it looks like this:

This is not the end, there are a lot of tasks ahead!

Configure teamcity service boot

Set linux to boot and start teamcity service automatically.

Create the file / etc/init.d/tcserver, add the following, and note that the path of jdk should be updated to the actual path:

#! / bin/sh# / etc/init.d/teamcity-startup script for teamcityexport JAVA_HOME=/usr/lib/jdk1.8.0_91export JRE_HOME=$ {JAVA_HOME} / jreexport CLASSPATH=.:$ {JAVA_HOME} / lib:$ {JRE_HOME} / libexport PATH=$ {JAVA_HOME} / bin:$PATHexport TEAMCITY_DATA_PATH= "/ home/tcuser/.BuildServer" export TEAMCITY_SERVER_OPTS=-Djava.awt.headless=true# Configure TeamCity for use on a headless OS.case $1 instart) start- Stop-daemon-- start-c tcuser-- exec / home/tcuser/TeamCity/bin/teamcity-server.sh start ; stop) start-stop-daemon-- start- c tcuser-- exec / home/tcuser/TeamCity/bin/teamcity-server.sh stop;;esacexit 0

Then execute the following command to set up the boot service:

$sudo chmod 755 tcserver$ sudo update-rc.d tcserver defaults configuration port 80

Let's use nginx to allow users to access TeamCity Server through port 80.

Install nginx:

$sudo apt-get install nginx$ sudo touch / etc/nginx/sites-available/teamcity$ sudo vim / etc/nginx/sites-available/teamcity

Add the following to the teamcity file:

Map $http_upgrade $connection_upgrade {default upgrade;'';} server {listen 80; server_name localhost; proxy_read_timeout 1200; proxy_connect_timeout 240; client_max_body_size 0; location / {proxy_pass http://localhost:8111; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $remote_addr Proxy_set_header Host $server_name:$server_port; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;}}

Create a link file and remove the default site configuration:

$sudo ln-s / etc/nginx/sites-available/teamcity / etc/nginx/sites-enabled/teamcity$ sudo rm / etc/nginx/sites-enabled/default

Reload the configuration of nginx:

$sudo / etc/init.d/nginx reload

OK, now you can visit the website through the IP address of TeamCity Server!

Access by name

Now we can only access TeamCity server by entering the IP address in the browser, which is too inconvenient. The fundamental way to solve this problem is to let DNS resolve domain names. As a demo, we can set up the local hosts file, which is simple and convenient:

Open the file C:\ Windows\ System32\ drivers\ etc\ hosts with administrator privileges, and add a line at the end of the file, as follows:

Xxx.xxx.xxx.xxx tcserver

Save, and then type tcserver/ in the browser to try, you can already visit the TeamCity Server website through tcserver!

Author: sparkdev

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report