hushui@Hushui:/mnt/d/gogs$ scp gogs_0.11.91_linux_amd64.tar.gz [email protected]:/home/git/
[email protected]'s password:
gogs_0.11.91_linux_amd64.tar.gz 100% 25MB 1.2MB/s 00:21
hushui@Hushui:/mnt/d/git-yl/gogs$ ssh [email protected]
Last login: Mon Jun 15 14:26:31 2020 from 117.62.57.178
Welcome to Alibaba Cloud Elastic Compute Service !
## add user git
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ su - git
Password:
Last login: Mon Jun 15 15:00:45 CST 2020 on pts/0
[git@izuf6ad1jbc6ftdqtbuiquz ~]$ ls
gogs_0.11.91_linux_amd64.tar.gz
[git@izuf6ad1jbc6ftdqtbuiquz ~]$ tar zxf gogs_0.11.91_linux_amd64.tar.gz
[git@izuf6ad1jbc6ftdqtbuiquz ~]$ ls
gogs gogs_0.11.91_linux_amd64.tar.gz
[git@izuf6ad1jbc6ftdqtbuiquz ~]$ cd gogs
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ ls
gogs LICENSE public README.md README_ZH.md scripts templates
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.65-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select @@version; show databases
+----------------+
| @@version |
+----------------+
| 5.5.65-MariaDB |
+----------------+
1 row in set (0.00 sec)
->
MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> grant all privileges on gogs.* to 'gogs';
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> quit
Bye
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ mysql -u gogs -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.65-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> use gogs;
Database changed
MariaDB [gogs]> quit
Bye
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ mysql -u gogs -p
build_freebsd.sh build.sh launchd/ README systemd/
Enter password:
ERROR 1227 (42000) at line 1: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ mysql -u root -p
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ mysql -u gogs -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 5.5.65-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use gogs
Database changed
MariaDB [gogs]> select name from user;
ERROR 1146 (42S02): Table 'gogs.user' doesn't exist
MariaDB [gogs]> quit
Bye
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ cat scripts/mysql.sql
SET GLOBAL innodb_file_per_table = ON,
innodb_file_format = Barracuda,
innodb_large_prefix = ON;
DROP DATABASE IF EXISTS gogs;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ ls
gogs LICENSE public README.md README_ZH.md scripts templates
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ ./gogs -version
Gogs version 0.11.91.0811
[git@izuf6ad1jbc6ftdqtbuiquz gogs]$ ./gogs --help
NAME:
Gogs - A painless self-hosted Git service
USAGE:
gogs [global options] command [command options] [arguments...]
VERSION:
0.11.91.0811
COMMANDS:
web Start web server
serv This command should only be called by SSH shell
hook Delegate commands to corresponding Git hooks
cert Generate self-signed certificate
admin Perform admin operations on command line
import Import portable data as local Gogs data
backup Backup files and database
restore Restore files and database from backup
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
2020/06/15 15:21:13 [ WARN] Custom config '/home/git/gogs/custom/conf/app.ini' not found, ignore this if you're running first time
2020/06/15 15:21:13 [TRACE] Custom path: /home/git/gogs/custom
2020/06/15 15:21:13 [TRACE] Log path: /home/git/gogs/log
2020/06/15 15:21:13 [TRACE] Log Mode: Console (Trace)
2020/06/15 15:21:13 [ INFO] Gogs 0.11.91.0811
2020/06/15 15:21:13 [ INFO] Cache Service Enabled
2020/06/15 15:21:13 [ INFO] Session Service Enabled
2020/06/15 15:21:13 [ INFO] SQLite3 Supported
2020/06/15 15:21:13 [ INFO] Run Mode: Development
2020/06/15 15:21:13 [ INFO] Listen: http://0.0.0.0:3000
[Macaron] 2020-06-15 15:23:22: Started GET / for 127.0.0.1
[Macaron] 2020-06-15 15:23:22: Completed GET / 302 Found in 357.921µs
2020/06/15 15:23:22 [TRACE] Session ID: d1c8898fd4a223ab
2020/06/15 15:23:22 [TRACE] CSRF Token: k4WBU02VmQVa6k7lbScSCf9FJUA6MTU5MjIwNTgwMjkyNjUwNjQ4NQ==
[Macaron] 2020-06-15 15:23:22: Started GET /install for 127.0.0.1
2020/06/15 15:23:22 [TRACE] Session ID: d1c8898fd4a223ab
2020/06/15 15:23:22 [TRACE] CSRF Token: k4WBU02VmQVa6k7lbScSCf9FJUA6MTU5MjIwNTgwMjkyNjUwNjQ4NQ==
2020/06/15 15:23:22 [TRACE] Template: install
[Macaron] 2020-06-15 15:23:22: Completed GET /install 200 OK in 34.021315ms
1. https://ecs.console.aliyun.com/ 安全组规则 开发 3000端口
2. Centos7/firewall service setting
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo firewall-cmd --add-port=3000/tcp --permanent
FirewallD is not running
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo systemctl status firewall
Unit firewall.service could not be found.
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo systemctl start firewalld
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo firewall-cmd --list-ports
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo firewall-cmd --add-port=3000/tcp --permanent
success
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo firewall-cmd --reload
success
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo systemctl restart firewalld
[lake@izuf6ad1jbc6ftdqtbuiquz ~]$ sudo firewall-cmd --list-ports
3000/tcp
###################################
### visit Your Aliyun Public ip:3000