在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso
安装步骤: 1.准备 1.0 查看硬件信息 查看物理cpu个数 查看核心数量 查看线程数 查看硬盘空间占用 du -h -x --max-depth=1 df -h 查看目录空间占用 du -msh /usr/local/src 查看物理内存,以及swap使用情况 free -h ****************************************** 把 /usr/local/src 目录,转到 /data 下 mkdir -p /data mv /usr/local/src /data ln -s /data/src /usr/local/src 远程复制目录(如需要) scp -P 22 -r [email protected]:/usr/local/src /usr/local ****************************************** 安装基本软件包 yum install vim wget lsof gcc gcc-c++ bzip2 firewalld openssl-devel mlocate -y
1.1 主机名设置 当前主机名查看 hostname 主机名设置 hostnamectl --static set-hostname tCentos systemctl restart network hostname tCentos
修改目录日期显示格式 vim ~/.bash_profile 最后添加以下内容 export TIME_STYLE='+%Y%m%d %H:%M' 保存退出
1.2 设置静态IP、DNS地址(网络设备名称有可能不一样,这里是eno16780032,如使用DHCP获取动态IP,可忽略) vi /etc/sysconfig/network-scripts/ifcfg-eno16780032 找到BOOTPROTO,并且修改(设为静态网址) BOOTPROTO="static" 在最后添加三行内容(添加本机IP,子网掩码,网关) IPADDR="192.168.1.10" :wq 保存退出 shutdown -r now 添加以下几个DNS地址
cat >> /etc/resolv.conf << EOF
nameserver 114.114.114.114
nameserver 192.168.1.1 nameserver 8.8.8.8 EOF
systemctl restart network ip addr|grep inet inet 127.0.0.1/8 scope host lo
1.3 更新时间,设置定时同步时间 yum install -y ntpdate cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 手动设置系统时间(测试用) date -s "2000-1-1" /usr/sbin/ntpdate us.pool.ntp.org ****************************************************************** 同步时间站点: us.pool.ntp.org time.nist.gov ****************************************************************** 查看当前系统时间 systemctl stop ntpd && systemctl disable ntpd date 设置定时任务,自动执行 mkdir -p /data/crond 添加以下内容 (或者crontab -e 打开后添加)
echo "00 02 * * * /usr/sbin/ntpdate us.pool.ntp.org 1>>/data/crond/ntpdate.log 2>&1" >> /var/spool/cron/root
每天 02:00同步一次,并且日志记录到 /data/crond/ntpdate.log ------------------------------------------------------------------------------------------------------------------------------------------------ 更新系统,显示系统版本(使用阿里云源) mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum clean all && yum makecache yum update -y 更新完成后重启,查看内核版本 shutdown -r now cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) ------------------------------------------------------------------------------------------------------------------------------------------------ 1.4 配置Vim显示格式 vim /etc/vimrc 在末尾添加以下内容 set nocompatible :wq 保存退出 VIM格式化使用方法(打开文件后,输入以下命令,第二个G是shift+g) gg=G
打开selinux ( centos 7.3某个版本设置为enforcing会导致没法重启) vim /etc/selinux/config 找到这一行,去掉前面的#注释 SELINUX=enforcing 保存,退出
shutdown -r now getenforce Enforcing
1.5 升级 gcc 1..1 下载 gcc,解压 cd /usr/local/src wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-9.2.0/gcc-9.2.0.tar.gz tar zvxf gcc-9.2.0.tar.gz && cd gcc-9.2.0 1.5.2 下载依赖文件,并且刷新 (可以事先下载复制进去) ************************************************************************************************************** cp ../isl-0.18.tar.bz2 ./ ************************************************************************************************************** ./contrib/download_prerequisites && ldconfig 1.5.3 创建编辑目录 mkdir gcc-build && cd gcc-build
# --prefix=/opt/gcc 指定安装目录(如指定/usr,则覆盖原默认目录,编译后不需要重建软连接)
如提示“ldconfig: /opt/gcc/lib64/libstdc++.so.6.0.27-gdb.py is not an ELF file” mv /opt/gcc/lib64/libstdc++.so.6.0.27-gdb.py /opt/gcc/lib64/bak.libstdc++.so.6.0.27-gdb.py echo '/opt/gcc/lib64' > /etc/ld.so.conf.d/local-lib64.conf ldconfig -v mv /usr/bin/gcc /usr/bin/gcc.bak mv /usr/bin/g++ /usr/bin/g++.bak ln -s /opt/gcc/bin/gcc /usr/bin/gcc ln -s /opt/gcc/bin/g++ /usr/bin/g++ update-alternatives --install /usr/bin/gcc gcc /opt/gcc/bin/gcc 999
1.5.6 重启,查看版本,检查是否成功更新 gcc --version g++ --version
1.6 更新内核 (4.9 版本及以上的内核均支持全新的 Google BBR TCP 拥塞控制算法) 1.6.1 源码编译内核 cd /usr/local/src/ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.6.tar.xz --no-check-certificate tar -vxf linux-5.3.6.tar.xz && cd linux-5.3.6 uname -r 3.10.0-1062.1.2.el7.x86_64 cp /boot/config-3.10.0-1062.1.2.el7.x86_64 .config make menuconfig 打开菜单后,加入 BBR 模块 保存后,退出 sudo sh -c 'yes "" | make oldconfig' make && make modules_install install 查看可用内核,设置默认启动内核 [root@centos ~] cat /boot/grub2/grub.cfg |grep menuentry [root@centos ~] grub2-set-default 'CentOS Linux (5.3.6) 7 (Core)' [root@centos ~] grub2-editenv list shutdown -r now 开启 TCP BBR [root@centos ~] echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf [root@centos ~] cat /etc/sysctl.conf 查看是否开成功 [root@centos ~] sysctl net.ipv4.tcp_available_congestion_control 有类似的输出,表未成功开启BBR 1.6.2 删除旧内核 yum -y remove kernel kernel-devel kernel-tools kernel-tools-libs 1.6.3 手工清理及卸载内核 删除/lib/modules/目录下不需要的内核库文件 1.6.4 如果不想升级内核及系统版本,则在执行 yum update之前 在 /etc/yum.conf 的 [main] 后面添加以下配置
1.7 设置PUTTY远程登录时,不使用密码,使用密钥文件登录(如不需要,可忽略) 1.7.1 服务器上创建目录 mkdir -p /root/.ssh
1.7.2 在"客户机"生成对称密钥,把客户机上的公钥复制到服务器(公钥文件:id_rsa.pub) [root@centos ~] ssh-keygen -m PEM -t rsa -b 4096 根据提示操作,生成公钥 上传到服务器指定目录(*** 或使用软件远程复制id_rsa.pub到服务器/root/.ssh中。) [root@centos ~] scp id_rsa.pub [email protected]/root/.ssh
1.7.3 查看服务器上,公钥是否已经存在 cd /root/.ssh ll 导入密钥到authorized_keys cat id_rsa.pub >> authorized_keys ll /root/.ssh 导入后,删除公钥文件 rm id_rsa.pub 设置目录和文件读取权限 chmod 700 /root/.ssh chmod 600 /root/.ssh/authorized_keys
vim /etc/ssh/sshd_config 找到GSSAPICleanupCredentials,并且修改为以下内容 GSSAPICleanupCredentials yes :wq 保存退出
systemctl restart sshd
打开软件 PuTTYgen 点击load 选择之前客户机生成私钥文件id_rsa, 点击save private key 生成 pKey.ppk文件 打开软件 PuTTY 点击Session,在HostName(or IP address)输入服务器地址 点击Connection下的DATA,在Auto-login username中输入登录账号(当前账号为root) 点击Connection下的SSH下的Auth,点击Browse 选择之前生成 pKeyppk文件 点击Session,在Saved Sessions中,输入需要保存的Session名称,点击保存
打开软件 PuTTY 点击Session,在"Default Settings"下,找到之前已经保存的Session,双击打开连接 如果显示 Authenticating with public key "xxxxx-xxxx"时,即表未成功
1.8.1 root登录后,修改root密码 (安全建议:密码为15位,大小字母+数字+特殊字符) passwd
1.8.2 添加新用户,并且设置密码 adduser vicowong passwd vicowong
1.8.3 创建目录,复制密钥相关文件到用户目录,并且设置权限 mkdir /home/vicowong/.ssh -p cp /root/.ssh/authorized_keys /home/vicowong/.ssh chmod 700 /home/vicowong/.ssh chmod 600 /home/vicowong/.ssh/authorized_keys chown vicowong:vicowong /home/vicowong/.ssh -R
1.8.4 设置防火墙,设置远程连接端口(这里是26322) systemctl enable firewalld && systemctl start firewalld firewall-cmd --zone=public --add-port=26322/tcp --permanent firewall-cmd --reload && iptables -L --line-numbers|grep ACCEPT
1.8.5 安装semanage(用于设置selinux策略) yum install -y policycoreutils-python selinux-policy selinux-policy-targeted 查看当前 selinux 是否启用 即 Enforcing 状态 (否则有可能设置 selinux 策略不成功) getenforce 查看当前 selinux 关于远程ssh连接端口的设置 semanage port -l | grep ssh ssh_port_t tcp 22 添加新端口 -------------------------------------------------------------------------------------------- 移除端口 ------------------------------------------------------------------------------------------- 1.8.6 设置sshd配置文件 vim /etc/ssh/sshd_config 以下三个搜索,查看是否有重复设置 #PermitRootLogin yes 添加 Port 26322 Protocol 2 ServerKeyBits 1024 PermitRootLogin no AllowUsers vicowong StrictModes yes RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PermitEmptyPasswords no PasswordAuthentication yes AuthenticationMethods publickey,password X11Forwarding no MaxStartups 10:30:60 :wq 保存退出
重启sshd服务,让其生效 systemctl restart sshd
1.8.7 使用新用户登录(重新打开一个新终端,原来的终端先不关,避免因设置不当导致没法连接远程) 打开软件 PuTTY,点击之前保存的Sessions,点击Load读取之前的配置 在Port框输入端口(当前账号为26322) 点击Connection下的DATA,在Auto-login username中输入登录账号(当前账号为vicowong) 点击Session 点击Save。保存当前修改。 点击Open,打开终端。
1.8.8 设置后,必须远程将进行密码和证书双重认证。 远程登录会以vicowong这个账号进行登录。安装维护需要root权限时,可以使用su实现 su root
1.9 开机自动禁止被ping (设置为 1:禁止,0:允许) chmod +x /etc/rc.d/rc.local vim /etc/rc.d/rc.local 打开后,在最后增加一行 echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all :wq 保存退出 cat /proc/sys/net/ipv4/icmp_echo_ignore_all 1
1.10 更新安装openssl (依赖zlib库) cd /usr/local/src/ wget http://zlib.net/zlib-1.2.11.tar.gz tar zvxf zlib-1.2.11.tar.gz && cd zlib-1.2.11 ./configure && make && make install
cd /usr/local/src/ wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz tar zvxf openssl-1.1.1d.tar.gz && cd openssl-1.1.1d ./config shared zlib --prefix=/usr && make && make install ***************************************************************************************************************** mv /usr/bin/openssl /usr/bin/openssl_bak mv /usr/include/openssl/ /usr/include/openssl_bak ln -s /opt/openssl/bin/openssl /usr/bin/openssl ln -s /opt/openssl/include/openssl/ /usr/include/openssl echo "/opt/openssl/lib" >> /etc/ld.so.conf ***************************************************************************************************************** #查看最新版本 ldconfig -v | grep ssl openssl version
1.11 安装jemalloc(需要 bzip2 库解压) cd /usr/local/src/ wget https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 tar xjf jemalloc-5.2.1.tar.bz2 && cd jemalloc-5.2.1 ./configure && make && make install echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf ldconfig
2.1 安装依赖 yum install ncurses-devel zlib-devel openssl-devel bzip2 m4 -y
2.2 安装cmake cd /usr/local/src/ wget https://cmake.org/files/v3.15/cmake-3.15.3.tar.gz tar zvxf cmake-3.15.3.tar.gz && cd cmake-3.15.3 ./bootstrap && make && make install
2.2 安装bison(需要 m4 库) cd /usr/local/src/ wget http://ftp.gnu.org/gnu/bison/bison-3.4.tar.gz tar zvxf bison-3.4.tar.gz && cd bison-3.4 ./configure && make && make install
2.3 安装libevent(依赖openssl库) *********************************** yum reinstall openssl-devel -y ldconfig cd /usr/local/src wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz tar zvxf libevent-2.1.8-stable.tar.gz && cd libevent-2.1.8-stable ./configure --prefix=/usr && make && make install ll /usr/lib | grep libevent updatedb && locate libevent 如果libevent的lib目录不在LD_LIBRARY_PATH里,可以使用以下命令加入 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr
2.4 创建 需要的目录、配置用户和用户组 groupadd mysql useradd -g mysql mysql -s /sbin/nologin -M mkdir -p /data/mysql chown -R mysql:mysql /data/mysql
cd /usr/local/src/ wget https://mirrors.shu.edu.cn/mariadb//mariadb-10.3.17/source/mariadb-10.3.17.tar.gz tar zvxf mariadb-10.3.17.tar.gz && cd mariadb-10.3.17 cmake \ make && make install ************************************************************** 如果提示 Could NOT find Boost (missing: Boost_INCLUDE_DIR system filesystem thread regex date_time chrono atomic) (Required is at least version "1.53.0") yum install boost-devel
如果编译不带 -DCMAKE_EXE_LINKER_FLAGS="-ljemalloc" -DWITH_SAFEMALLOC=OFF 参数 也可以编辑 /opt/mysql/bin/mysqld_saf 文件,来实现加载 jemalloc sed -i 's@executing mysqld_safe@executing mysqld_safe\n export LD_PRELOAD=/usr/local/lib/libjemalloc.so@' /opt/mysql/bin/mysqld_safe ************************************************************** 2.6 创建软连接 ln -s /opt/mysql/lib/lib* /usr/lib/ ln -s /opt/mysql/bin/mysql /bin ln -s /opt/mysql/bin/mysqldump /bin ln -s /opt/mysql/bin/mysqlbinlog /bin
2.7 修改配置文件 vim /etc/my.cnf 删除原来的内容,直接替换掉以下代码 [client] [mysqld] log-bin=mysql-bin binlog_format=mixed server-id = 1 [mysqldump] [mysql] [myisamchk] [mysqlhotcopy] :wq 保存退出
cd /opt/mysql ./bin/mysql_install_db --basedir=/opt/mysql --datadir=/data/mysql --user=mysql ./bin/mysqld_safe --datadir=/data/mysql 确认运行后,按可以按CTRL+Z结束 ps -ef|grep mysqld lsof -n | grep jemalloc
./bin/mysql_secure_installation 输入当前密码。(默认为空,回车即可) Enter current password for root (enter for none): 是否设置root密码,输入Y,后,输入两次密码 Set root password? [Y/n] y New password: Re-enter new password: 是否移除匿名用户,输入Y Remove anonymous users? [Y/n] y 是否禁止root远程登录,输入Y Disallow root login remotely? [Y/n] y 是否删除测试数据库,输入Y Remove test database and access to it? [Y/n] y 是否重新读取权限表数据 Reload privilege tables now? [Y/n] y
2.10 登录数据库,查看数据库状态 mysql -u root -p MariaDB [(none)]> status; MariaDB [(none)]> show engines; MariaDB [(none)]> SHOW VARIABLES LIKE '%have%ssl%'; MariaDB [(none)]> exit;
vim /etc/systemd/system/mysqld.service 录入以下内容 [Unit] [Install] [Service] # Execute pre and post scripts as root # Needed to create system tables etc. # Start main service # Don't signal startup success before a ping works # Give up if ping don't get an answer Restart=always
systemctl enable mysqld.service systemctl list-unit-files|grep enabled|grep mysql systemctl daemon-reload
shutdown -r now
mysql -u root -p MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit; (root是用户名,%是主机名或IP地址,这里的%代表任意主机或IP地址,也可指定唯一的IP地址;密码是MyPassword )
******* 本地账号,没需密码就可以登录问题 use mysq; select Host,User,Password from user; 仅保留需要的账号,其它删除 Host User Password ***********************************************************************
firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload && iptables -L --line-numbers|grep ACCEPT --------------------------------------------------------------------------------------------------------------------------------------- 最大连接数 MariaDB启动后的累计连接数 mariaDB启动后的最大同时连接数 MariaDB线程信息 MariaDB备用的线程信息 Threads_cached:备用的线程数(线程是可以再利用的) 理想的状态: ---------------------------------------------------------------------------------------------------------------------------------------
3.编译安装Nginx 3.1安装依赖 yum install zlib-devel openssl-devel -y
cd /usr/local/src/ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.43.tar.gz tar zvxf pcre-8.43.tar.gz && cd pcre-8.43 ./configure && make && make install
3.3 创建www用户和组,创建www虚拟主机使用的目录,以及Nginx使用的日志目录,并且赋予他们适当的权限 groupadd www useradd -g www www -s /sbin/nologin -M mkdir -p /data/www/web chmod +w /data/www/web chown -R www:www /data/www/web
3.4 安装nginx cd /usr/local/src/ wget http://nginx.org/download/nginx-1.16.1.tar.gz tar zvxf nginx-1.16.1.tar.gz && cd nginx-1.16.1 ************************************************************** 可以修改 nginx.h 中的这两行,达到 自定义显示 nginx 版本的目白 vim src/core/nginx.h #define nginx_version 1007008 #define NGINX_VERSION "1.7.8" #define NGINX_VER "Power_nginx" *************************************************************** ./configure --prefix=/opt/nginx \ make && make install
vim /opt/nginx/conf/nginx.conf 打开配置文件,删除原所有内容,添加以下新内容: user www www; fastcgi_buffers 8 16k; include mime.types; sendfile on; include /opt/nginx/conf/vhosts/*.conf; :wq 保存退出 ( 保存前先 gg=G 格式化)
************************************************************************************* 如果需要支持http2,参考以下设置(需要https证书,并且 server { listen 443 ssl http2; ssl_certificate server.crt; ssl_certificate_key server.key; ... } * HTTPS性能评估:https://www.ssllabs.com/ssltest/ ************************************************************************************* 创建网站配置文件目录 mkdir -p /opt/nginx/conf/vhosts
创建网站配置文件 vim /opt/nginx/conf/vhosts/web.conf
添加以下内容
3.6 建立测试首页 vim /data/www/web/index.html <html> 保存,退出
cd /opt/nginx ldconfig ./sbin/nginx -c /opt/nginx/conf/nginx.conf -t 如果显示下面信息,即表示配置没问题 nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
./sbin/nginx -c /opt/nginx/conf/nginx.conf lsof -n | grep jemalloc ginx 2346 root mem REG 253,1 1824470 51571788 /usr/local/lib/libjemalloc.so.1
firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --reload && iptables -L --line-numbers|grep ACCEPT
3.9 浏览器打开 http://192.168.1.10 显示出欢迎内容,则表示成功
3.10 作为服务,开机后启动 vim /etc/systemd/system/nginx.service 增加以下内容 [Unit] [Service] [Install] :wq 保存退出
systemctl list-unit-files|grep enabled|grep nginx
./sbin/nginx -s stop systemctl daemon-reload systemctl start nginx.service systemctl status nginx.service -l ps -ef|grep nginx lsof -n | grep jemalloc
4.编译安装 Asp.net Core2 4.1安装依赖 rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm yum update -y yum install libunwind libicu -y yum install dotnet-sdk* shutdown -r now dotnet --info
4.2生成测试网站 mkdir -p /data/www/Core2 cd /data/www/Core2 dotnet new mvc dotnet restore dotnet run
显示以下内容即表示成功 Hosting environment: Production
4.3 浏览器打开测试 http://localhost:5000
4.4 配置 nginx,以支持 core 网站 vim /opt/nginx/conf/vhosts/web.conf 替换成如下内容 server { :wq 保存退出 systemctl restart nginx systemctl status nginx
4.5 安装 Supervisor (低于 3.3.3 会有安全漏洞) cd /usr/local/src yum install unzip -y wget https://files.pythonhosted.org/packages/6e/9c/6a003320b00ef237f94aa74e4ad66c57a7618f6c79d67527136e2544b728/setuptools-41.0.0.zip unzip setuptools-41.0.0.zip && cd setuptools-41.0.0 python setup.py build && python setup.py install
cd /usr/local/src wget https://files.pythonhosted.org/packages/44/60/698e54b4a4a9b956b2d709b4b7b676119c833d811d53ee2500f1b5e96dc3/supervisor-4.0.0.tar.gz tar zvxf supervisor-4.0.0.tar.gz && cd supervisor-4.0.0 python setup.py install --------------------------------------------------------------------------------------- 如提示 pkg_resources.DistributionNotFound: The 'meld3>=1.0.0' distribution was not found and is required by supervisor wget https://files.pythonhosted.org/packages/00/3b/023446ddc1bf0b519c369cbe88269c30c6a64bd10af4817c73f560c302f7/meld3-2.0.0.tar.gz tar zvxf meld3-2.0.0.tar.gz && cd meld3-2.0.0 python setup.py install && ldconfig ----------------------------------------------------------------------------------------- 配置Supervisor mkdir -p /etc/supervisor/conf.d echo_supervisord_conf > /etc/supervisor/supervisord.conf vim /etc/supervisor/supervisord.conf 查找 修改为 查找 [unix_http_server] 下账号和密码设置,设置密码 (使用 supervisorctl 强制输入密码,增强安全性) username=supervisor_user :wq 保存退出
假设有一个 asp.net core mvc项目 Core2。编译发布后目录包含Core2.dll 并且运行dotnet Core2.dll 能够正常运行网站项目 cd /data/www/Core2 ll -rw-r--r--. 1 root root 146 11月 12 10:30 appsettings.Development.json ---------------必须是发布过程序-------------------- dotnet Core2.dll 显示以下内容,则表示成功
浏览器打开测试 http://localhost
vim /etc/supervisor/conf.d/Core2.conf 输入以下内容 [program:Core2] :wq 保存退出 运行supervisord,查看是否生效 supervisord -c /etc/supervisor/supervisord.conf
vim /etc/systemd/system/supervisord.service [Unit] [Service] [Install] :wq 保存退出
systemctl enable supervisord && systemctl restart supervisord systemctl status supervisord supervisorctl > version # 查看当前版本
***************************************************************** 4.6 浏览器打开测试 http://localhost *********************************** 如果由于SELinux保护机制所导致没法打不开,则要将nginx添加至SELinux的白名单。 yum install policycoreutils-python cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M mynginx semodule -i mynginx.pp ***********************************
4.7 安装组件,支持 core 图片生成 yum install autoconf automake libtool freetype-devel fontconfig libXft-devel libjpeg-turbo-devel libpng-devel giflib-devel libtiff-devel libexif-devel glib2-devel cairo-devel -y cd /usr/local/src wget https://github.com/mono/libgdiplus/archive/6.0.5.tar.gz tar zvxf libgdiplus-6.0.5.tar.gz && cd libgdiplus-6.0.5 ./autogen.sh && make && make install ln -s /usr/local/lib/libgdiplus.so /usr/lib64/gdiplus.dll ************************************************************* 把windows下font目录的相应字体上传到服务器 /usr/share/fonts/chinese yum install mkfontscale fontconfig -y mkdir -p /usr/share/fonts/chinese cd /usr/share/fonts/chinese mkfontscale && mkfontdir && fc-cache -fv fc-list | grep times.ttf fc-list :lang=zh ************************************************************* shutdown -r now
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论