Gitee is a popular code hosting and version control tool that is a web-based version of Git. If you want to set up a private code repository for your team or project, Gitee is a very good choice. Although you can use Gitee on its official website, in some cases you may need to install Gitee on your own server.
In this article, we will introduce the steps to install Gitee on the server and guide you on how to set up and use it.
Step 1: Install the required dependencies
Before installing Gitee, you need to install the following dependencies on your server:
If you have already installed the above dependencies, you can skip this step.
To install Git and MariaDB, you can use the following command on the command line:
sudo apt-get update sudo apt-get install git mariadb-server
Then, you need to set the root password for MariaDB:
sudo mysql_secure_installation
During the installation, You will be asked to enter a password and other security settings options. Just follow the wizard.
Now, you need to install Nginx:
sudo apt-get install nginx
Step 2: Download the Gitee installation package
On your server, you need to download the Gitee installation package. You can download it from Github or Gitee’s official website, but if you don’t want to go to these websites, you can download it using the following command on your CentOS system:
wget https://dl.gitee.com/gitee/gitee/releases/6.1.1/gitee-6.1.1-64bits.tar.gz
Step 3: Install Gitee
Unzip the downloaded Gitee installation package:
tar xvf gitee-6.1.1-64bits.tar.gz
Now, you will get a gitee folder. You need to move it to a directory where you want to install Gitee and change to that directory:
sudo cp -r gitee /opt/ cd /opt/gitee
Next, you need to run the Gitee installation script:
sudo ./install.sh
After running this script Before doing this, you need to make sure you have sudo permissions.
After running the script, you may need to enter some setting information, such as your database password and SMTP server information. After following the wizard, you will complete the Gitee installation.
Step 4: Configure Nginx
To make Gitee accessible through the web, you need to configure Nginx. Create a default configuration file in the Nginx configuration directory:
sudo nano /etc/nginx/sites-available/default
Then, add the following content to the file:
server { listen 80; server_name your_domain.com; # 你的域名 location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_pass http://127.0.0.1:8080; # 你的gitee端口 proxy_redirect off; } }
Replace "your_domain.com" with your domain name and " Replace "8080" with the port Gitee is listening on (default is "8081").
Save and close the file. Then test the configuration file:
sudo nginx -t
If there are no errors, restart Nginx:
sudo systemctl restart nginx
Step 5: Use Gitee
Now you can enter your domain name to access Gitee. Before your first visit, you need to install Gitee's SSL certificate in your browser.
After accessing Gitee, you need to enter the username and password of the Gitee administrator. By default, the username and password are "admin" and "123456".
Once you successfully log in, you can create a repository in Gitee and then use it in your teams and projects. You can also invite other users to join your Gitee community so they can work on your repository.
Summary
Gitee is a very powerful code hosting and version control tool that can help you better manage your projects. In this article, we show you how to install Gitee on your server, as well as how to set it up and use it. If you are a developer or a team leader, we highly recommend you consider using Gitee to manage your code base.
The above is the detailed content of Let's talk about the steps to install Gitee on the server. For more information, please follow other related articles on the PHP Chinese website!