当前位置: 首页 > 工具软件 > Agilefant > 使用案例 >

centos7下安装agilefant,alfresco,gitlab 和一些基础软件

费锋
2023-12-01

设置ip(这个是本虚拟机才需要的)
vi /etc/sysconfig/network-scripts/ifcfg-eth0

bootproto=static
onboot=yes
后面加上
IPADDR=192.168.137.21
NETMASK=255.255.255.0
GATEWAY=192.168.137.1
DNS1=192.168.137.1
DNS2=8.8.8.8

重启网络
systemctl restart network
(如果不是虚拟机就从这开始)
安装ssh

yum install openssh-server
systemctl restart sshd 重启SSH服务。

命令:systemctl start sshd 启动服务 | 命令:systemctl stop sshd 停止服务
  重启后可输入:netstat -antp | grep sshd 查看是否启动22端口

安装java
mkdir /usr/lib/jvm
tar zxvf /root/jdk-8u221-linux-x64.tar.gz -C /usr/lib/jvm/
vi /etc/profile

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_221
export JRE_HOME= J A V A H O M E / j r e e x p o r t C L A S S P A T H = . : {JAVA_HOME}/jre export CLASSPATH=.: JAVAHOME/jreexportCLASSPATH=.:{JAVA_HOME}/lib: J R E H O M E / l i b e x p o r t P A T H = {JRE_HOME}/lib export PATH= JREHOME/libexportPATH={JAVA_HOME}/bin:$PATH

source /etc/profile
 java -version

vi
Ctrl-f 向前滚动一页
Ctrl-b 向后滚动一页

先安装wget命令
yum -y install wget

安装mysql
cd /root
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum install mysql-server
启动
systemctl start mysqld
然后在 /var/log/mysqld.log 文件中会自动生成一个随机的密码,我们需要先取得这个随机密码,以用于登录 MySQL 服务端:

cat /var/log/mysqld.log | grep password
将会返回如下内容,末尾字符串就是密码,把它复制下来:

A temporary password is generated for root@localhost: cp)!osr-u7E>

登录到 MySQL 服务端并更新用户 root 的密码:

mysql -u root -p
cp)!osr-u7E>
然后更改密码
mysql> alter user ‘root’@‘localhost’ identified by ‘Zhu121215!!!’;
Query OK, 0 rows affected (0.00 sec)
mysql> ALTER USER ‘root’@‘localhost’ PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)

vi /etc/my.cnf
在 [mysqld] 前添加如下代码

[client]
default-character-set=utf8

在 [mysqld] 后添加如下代码:后面那个是大小写不敏感

character_set_server=utf8
lower_case_table_names =1

service mysqld restart
重启mysql后 再登录,看看字符集,6个utf8就算OK
mysql -u root -p
show variables like ‘%character%’;

安装nginx
yum install -y nginx
报错则添加源
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install -y nginx
启动
systemctl start nginx
or nginx
关闭nginx:
nginx -s stop >>>>快速停止nginx
nginx -s quit >>>>完整有序的停止nginx

ps -ef | grep nginx
防火墙开启端口访问
firewall-cmd --zone=public --add-port=80/tcp --permanent

agilefant 安装 到7080端口
https://jaist.dl.sourceforge.net/project/agilefant/Agilefant3/agilefant-3.5.4.zip

yum install -y unzip zip
unzip -o -d /mnt/server/apache-tomcat-9.0.22 /root/apache-tomcat-9.0.22.zip
把agilefant 下载好的war传到tomcat的webapps目录下,记得先改war里面 /WEB-INF/agilefant.conf 里的数据库配置信息
默认 admin secret

mysql 要关闭下面这个才能启动
vi /etc/selinux/config
找到

SELINUX=enforcing
改为
SELINUX=disabled

reboot

安装alfresco
下载安装包
https://sourceforge.net/projects/alfresco/files/Alfresco%20201707%20Community/
选择alfresco-community-installer-201707-linux-x64.bin

进入目录 启动在7090端口
授权
chmod +x alfresco-community-installer-201707-linux-x64.bin

./alfresco-community-installer-201707-linux-x64.bin
记得有选择的安装 域名要写一下

jdbc:mysql://localhost/alfresco?useUnicode=true&characterEncoding=UTF-8
com.mysql.jdbc.Driver
记得要把mysql的驱动放到/opt/alfresco-community/tomcat/lib 里面去
cd /opt/alfresco-community
./alfresco.sh stop

./alfresco.sh start
域名配置那些在这里改
修改$alfresco_HOME/tomcat/shared/calsses/alfresco-global.properties文件
如果修改端口不止改上面这文件还要改tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml里的

gitlab安装

安装一些依赖服务
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld

,安装Postfix以发送通知邮件,安装命令:sudo yum install postfix
将postfix服务设置成开机自启动,安装命令:sudo systemctl enable postfix

启动postfix,安装命令:sudo systemctl start postfix

下载gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.0.6-ce.0.el7.x86_64.rpm

安装gitlab 安装命令:rpm -i gitlab-ce-12.0.6-ce.0.el7.x86_64.rpm

打开/etc/gitlab/gitlab.rb,将external_url = ‘http://git.example.com’ 修改 http://192.168.137.201:8083。
执行配置
gitlab-ctl reconfigure

ps -ef | grep gitlab

查看开放防火墙端口
firewall-cmd --list-ports
新加一个开放端口
firewall-cmd --zone=public --add-port=8083/tcp --permanen
centos7重启防火墙
systemctl restart firewalld.service

sudo gitlab-ctl stop // 停止

sudo gitlab-ctl start // 开启
#删除防火墙端口
firewall-cmd --zone=public --remove-port=8080/tcp --permanent

已安装gitlab版本
head -1 /opt/gitlab/version-manifest.txt

汉化gitlab
mkdir /home/local/gitlab
cd /home/local/gitlab
yum install -y git
下载对应版本的汉化包:

git clone https://gitlab.com/xhang/gitlab.git -b v12.0.6-zh

unzip -o -d /home/local/gitlab /home/local/gitlab-12.zip

gitlab-ctl stop
vi ~/.bashrc
,在“alias cp=’cp-i’”前加#注释即可
source ~/.bashrc
如果上面不注释,会一直提示覆盖 要替换不然会少东西
先备份
cp /opt/gitlab/embedded/service/gitlab-rails/ /opt/gitlab/embedded/service/gitlab-railsbak/ -r

cp /home/local/gitlab/* /opt/gitlab/embedded/service/gitlab-rails/ -r

sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
刚重启完要等会才能正常访问
查看日志
gitlab-ctl tail

安装好这三个以后可以用nginx开在80端口做转发

server {
          listen 80;
          server_name 192.168.137.21;
          charset utf-8;	  
	  		index index.html;  
          
location /agilefant/{
			proxy_pass http://127.0.0.1:7080/agilefant/;
			proxy_http_version 1.1;
		    proxy_set_header Upgrade $http_upgrade;
		    proxy_set_header Connection "upgrade";
		    proxy_set_header Cookie $http_cookie;
		    proxy_set_header Host $host;
		    proxy_set_header Referer $http_referer;
		    proxy_set_header User-Agent $http_user_agent;
		}
	 location /alfresco/{
			proxy_pass http://127.0.0.1:7090/alfresco/;
			proxy_http_version 1.1;
		    proxy_set_header Upgrade $http_upgrade;
		    proxy_set_header Connection "upgrade";
		    proxy_set_header Cookie $http_cookie;
		    proxy_set_header Host $host;
		    proxy_set_header Referer $http_referer;
		    proxy_set_header User-Agent $http_user_agent;
		}
	 location /share/{
			proxy_pass http://127.0.0.1:8083/share/;
			proxy_http_version 1.1;
		    proxy_set_header Upgrade $http_upgrade;
		    proxy_set_header Connection "upgrade";
		    proxy_set_header Cookie $http_cookie;
		    proxy_set_header Host $host;
		    proxy_set_header Referer $http_referer;
		    proxy_set_header User-Agent $http_user_agent;
	 }
     
}
 类似资料: