CentOS7ϵͳÖÐÔõÑù´î½¨GiteeÂëÔÆƽ̨
giteeÂëÔÆÊÇÒ»¿îº£ÄڵĻùÓÚgitµÄ¿ªÔ´´úÂëÍйÜƽ̨£¬ËüÌṩÁË´úÂëÍйܡ¢°æ±¾ÖÎÀí¡¢ÎĵµÖÎÀí¡¢´úÂë review¡¢bug ÖÎÀíµÈ¹¦Ð§£¬²¢ÇÒ»¹Ö§³Ö ci/cd¡¢´úÂëËÑË÷¡¢Éç½»»¥¶¯µÈ¸ß¼¶¹¦Ð§¡£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃǽ«ÏÈÈÝÔÚ centos 7 ϵͳÖÐÔõÑù´î½¨ gitee ÂëÔÆƽ̨¡£
Ò»¡¢ÇéÐÎÒªÇó
´î½¨ Gitee ÂëÔÆƽ̨ÐèÒªÖª×ãÒÔÏÂϵͳҪÇó£º
CentOS 7 ϵͳ
MySQL »ò MariaDB Êý¾Ý¿â
Nginx ÇáÁ¿¼¶ Web ЧÀÍÆ÷
JDK 8 ¼°ÒÔÉÏ°æ±¾
ÔÚ¾ÙÐÐ×°ÖÃÇ°ÐèҪȷÈÏÊÇ·ñÒѾװÖÃÁËÒÔÉÏËùÓÐÈí¼þ¡£
¶þ¡¢×°ÖÃÐëÒªÈí¼þ
1.Éý¼¶ÏµÍ³Èí¼þ°ü
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÉý¼¶ÏµÍ³ÄÚµÄËùÓÐÈí¼þ°ü£¬Ö´ÐÐÒÔÏÂÏÂÁ
yum update -y
µÇ¼ºó¸´ÖÆ
2.×°ÖÃ MariaDB
MariaDB ÊÇ MySQL Êý¾Ý¿âµÄÒ»¸ö·ÖÖ§£¬×°Öü°ÉèÖþùºÍ MySQL ¿¿½ü¡£Ö´ÐÐÒÔÏÂÏÂÁîÒÔ×°Öà MariaDB£º
yum install mariadb mariadb-server -y
µÇ¼ºó¸´ÖÆ
Æô¶¯²¢ÉèÖÿª»úÆô¶¯£º
systemctl start mariadb.service systemctl enable mariadb.service
µÇ¼ºó¸´ÖÆ
½ÓÏÂÀ´£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¶Ô MariaDB ¾ÙÐÐÆðÔ´µÄÇå¾²ÐÔÉèÖãº
mysql_secure_installation
µÇ¼ºó¸´ÖÆ
ƾ֤ÏÂÁîÌáÐÑ£¬ÒÀ´ÎÊäÈëÐÂÃÜÂ롢ȷÈÏÐÂÃÜÂ롢ɾ³ýÄäÃûÓû§¡¢Õ¥È¡ root Ô¶³ÌµÇ¼¡¢É¾³ý test Êý¾Ý¿â²¢Ë¢ÐÂȨÏÞ¼´¿É¡£
3.×°ÖÃ nginx
Ö´ÐÐÒÔÏÂÏÂÁî×°Öà nginx£º
yum install nginx -y
µÇ¼ºó¸´ÖÆ
Æô¶¯²¢ÉèÖÿª»úÆô¶¯£º
systemctl start nginx.service systemctl enable nginx.service
µÇ¼ºó¸´ÖÆ
´Ëʱ£¬ÔÚä¯ÀÀÆ÷Öлá¼ûЧÀÍÆ÷µØµã£¬½«¿´µ½ Nginx µÄĬÈϽӴýÒ³Ãæ¡£
4.×°ÖÃ JDK
Gitee ÂëÔÆƽ̨ÐèÒª Java ÇéÐΣ¬Ö´ÐÐÒÔÏÂÏÂÁî×°Öà JDK£º
yum install java-1.8.0-openjdk-devel -y
µÇ¼ºó¸´ÖÆ
Èý¡¢×°ÖÃ Gitee ÂëÔÆ
1.ÏÂÔØ Gitee ÂëÔÆ
´Ó Gitee ÂëÔƹÙÍøÏÂÔØÂëÔÆ×°Öðü£¬½«ÏÂÔغõİü½âѹµ½Ð§ÀÍÆ÷µÄÄ¿µÄĿ¼Ï£º
wget https://gitee.com/oschina/git-osc/raw/master/doc/installation/source/gitee-official-%{version}.tar.gz tar zxvf gitee-official-%{version}.tar.gz -C /data/
µÇ¼ºó¸´ÖÆ
2.×°ÖÃ MySQL
½« Gitee ÂëÔÆÌṩµÄ SQL Îļþµ¼Èëµ½Êý¾Ý¿âÖУº
mysql -u root -p <p>3.ÉèÖà Gitee ÂëÔÆ</p><p>±à¼ /data/gitee/srv/gitee/config/application.yml Îļþ£¬ÉèÖÃÆäÖеÄÒÔÏÂÄÚÈÝ£º</p><pre class="brush:php;toolbar:false">server: port: 8080 # Gitee ÂëÔƼàÌýµÄ¶Ë¿Ú context-path: / # Gitee ÂëÔƵÄÉÏÏÂÎÄ·¾¶ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource username: gitee # Êý¾Ý¿âµÄÓû§Ãû password: gitee123 # Êý¾Ý¿âÃÜÂë url: jdbc:mysql://localhost:3306/gitee_prod?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull mybatis: mapper-locations: classpath:gitee/mapper/*.xml # MyBatis µÄÉèÖÃÎļþ redis: host: 127.0.0.1 # Redis ЧÀÍ¶ËµÄ IP µØµã port: 6379 # Redis ЧÀͶ˵ļàÌý¶Ë¿Ú password: # Redis µÄÅþÁ¬ÃÜÂë database-index: 0 # Redis µÄÊý¾Ý¿â±àºÅ
µÇ¼ºó¸´ÖÆ
4.¹¹½¨ Gitee ÂëÔÆ
Ö´ÐÐÒÔÏÂÏÂÁîÀ´¹¹½¨ Gitee ÂëÔÆƽ̨£º
cd /data/gitee/ ./build.sh
µÇ¼ºó¸´ÖÆ
¹¹½¨Íê³Éºó£¬ÔÚ /data/gitee/srv/gitee Ͻ«ÌìÉúÒ»¸ö gitee.war Îļþ£¬½«Æ俽±´ÖÁ /data/gitee/tomcat-8.5.40/webapps ÖС£
5.Æô¶¯ Gitee ÂëÔÆ
½ÓÏÂÀ´Ö´ÐÐÒÔÏÂÏÂÁîÀ´Æô¶¯ Gitee ÂëÔÆ£º
cd /data/gitee/tomcat-8.5.40/bin/ ./startup.sh
µÇ¼ºó¸´ÖÆ
´Ëʱ£¬¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐÊäÈëIPµØµã»òÕßÓòÃû£¬¼ÓÉÏ×Ô½ç˵µÄÉÏÏÂÎÄ·¾¶À´»á¼û Gitee ÂëÔÆƽ̨¡£
Íê³ÉÒÔÉÏ°ì·¨Ö®ºó£¬Äã¾ÍÒѾÀֳɵشÁË Gitee ÂëÔÆƽ̨£¬²¢¿ÉÒÔÓÃËü³ÐÔØ×Ô¼ºµÄ¿ª·¢ÏîÄ¿¡£
ÒÔÉϾÍÊÇCentOS7ϵͳÖÐÔõÑù´î½¨GiteeÂëÔÆƽ̨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡