centos6.6安装web版GIT
时间:2015-09-18 07:37 来源:51cto.com 作者:蒲公英的秘密
[root@yy ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
[root@yy ~]# cat /etc/issue
CentOS release 6.6 (Final)
Kernel \r on an \m
[root@yy ~]# uname -a
Linux yy 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@yy ~]# uname -r
2.6.32-504.el6.x86_64
[root@yy ~]# rpm --import https://rpm.packager.io/key
[root@yy ~]# echo "[gogs]
> name=Repository for pkgr/gogs application.
> baseurl=https://rpm.packager.io/gh/pkgr/gogs/centos6/pkgr
> enabled=1" | sudo tee /etc/yum.repos.d/gogs.repo
[gogs]
name=Repository for pkgr/gogs application.
baseurl=https://rpm.packager.io/gh/pkgr/gogs/centos6/pkgr
enabled=1
[root@yy ~]#
[root@yy ~]# cat /etc/yum.repos.d/gogs.repo
[gogs]
name=Repository for pkgr/gogs application.
baseurl=https://rpm.packager.io/gh/pkgr/gogs/centos6/pkgr
enabled=1
[root@yy ~]# yum install gogs -y
APP_NAME=”gogs”
MYSQL_PASSWORD=”123456789”
HOSTNAME=”www.yuanyang.com”
[root@yy ~]# yum install mysql-server -y
[root@yy ~]# service mysqld restart
[root@yy ~]# chkconfig mysqld
[root@yy ~]# chkconfig --list mysqld
mysqld 0:关闭1:关闭2:关闭3:关闭4:关闭5:关闭6:关闭
[root@yy ~]# mysqladmin -u root password "ABCabc123"
[root@yy ~]# mysql -u root -pABCabc123
mysql> CREATE DATABASE IF NOT EXISTS gogs;
Query OK, 1 row affected (0.00 sec)
mysql> use gogs;
Database changed
mysql> set global storage_engine=INNODB;
Query OK, 0 rows affected (0.00 sec)
<VirtualHost *:80>
ServerAdmin yuanyang@yuanyang.com
ServerAlias www.abc.com
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
AddDefaultCharset off
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ErrorLog /etc/httpd/logs/error.log
CustomLog /etc/httpd/logs/access.log combined
</VirtualHost>
[root@yy logs]# service httpd restart
[root@yy logs]# lsof -i tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gogs 2886 gogs 4u IPv6 20047 0t0 TCP *:hbci (LISTEN)
[root@yy logs]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 3545 root 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3547 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3548 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3549 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3550 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3551 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3552 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3553 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3554 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
httpd 3555 apache 4u IPv6 25412 0t0 TCP *:http (LISTEN)
[root@yy logs]# service iptablers stop
[root@yy logs]# setenforce 0
[root@yy logs]# yum install openssl mod_ssl -y
[root@yy conf.d]# ls /etc/pki/tls/certs/localhost.crt
/etc/pki/tls/certs/localhost.crt
[root@yy conf.d]# ls /etc/pki/tls/private/localhost.key
/etc/pki/tls/private/localhost.key
[root@yy conf.d]# ls /etc/httpd/conf.d/ssl.conf
/etc/httpd/conf.d/ssl.conf
[root@yy conf.d]# vim /etc/httpd/conf.d/ssl.conf
ProxyPass /git http://127.0.0.1:3000
ProxyPassReverse /git http://127.0.0.1:3000
<Location /git>
Order allow,deny
Allow from all
</Location>
[root@yy conf.d]# cd /opt/gogs/custom/conf/
[root@yy conf]# ls
app.ini
[root@yy conf]# cp app.ini app.ini.back
[root@yy conf]# vim app.ini
[root@yy conf]# /etc/init.d/gogs restart
This job runs via upstart, invoking upstart now...
gogs start/running
[root@yy conf]# service httpd restart
停止 httpd: [确定]
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for yy
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[确定]
(责任编辑:IT)
(责任编辑:IT) |
