1. 程式人生 > >centos7下gogs部署

centos7下gogs部署

erp 自己 cannot emc systemctl 0.11 star mys load

1.下載
cd /usr/local/src
wget  https://dl.gogs.io/0.11.86/gogs_0.11.86_linux_386.tar.gz
tar xf gogs_0.11.86_linux_386.tar.gz
mv gogs /usr/local/

2.部署數據庫

yum install mysql -y
yum install mysql-server -y
yum install mysql-devel -y

#但是mysql-server安裝不了,需要一下操作
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

3.啟動數據庫,設置密碼

systemctl start mysqld
mysql -uroot

>set password for ‘root‘@‘localhost‘ = password(‘123456‘);
>flush privileges;

#重進數據庫
mysql -u root -p

#用戶自己定義
>grant all privileges on gogs.* to ‘gogs‘@‘localhost‘ identified by ‘123456‘;
>flush privileges;

#導入gogs數據庫
mysql -u root -p < /usr/local/gogs/scripts/mysql.sql
passwd:

4.啟動gogs

#如果需要安裝go語言,自己去安裝一個
cd /usr/local/gogs
./gogs web

#很多人發現會出現錯誤
錯誤一:
     /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
錯誤二:
    while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory

    導致以上錯誤是缺失了數據包
         yum install glibc.i686 -y
         yum install  pam.i686 -y

    再次啟動
    ./gogs web &

centos7下gogs部署