CentOS修改IP地址 # ifconfig eth0 192.168.1.80 这样就把IP地址修改为192.168.1.80(如果发现上不了网了,那么你可能需要把网关和DNS也改一下,后面会提到),但是当你重新启动系统或网卡之后,还是会变回原来的地址,这种修改方式只适用于需要临时做IP修改。要想永久性修改,就要修改/etc/sysconfig/network-scripts/ifcfg-eth0这个文件,这个文件的主要内容如下(你的文件中没有的项,你可以手动添加): # vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #描述网卡对应的设备别名 BOOTPROTO=static #设置网卡获得ip地址的方式,选项可以为为static,dhcp或bootp BROADCAST=192.168.44.255 #对应的子网广播地址 HWADDR="00:0C:29:6B:2E:7B"#对应的网卡物理地址 IPADDR=192.168.44.137 #只有网卡设置成static时,才需要此字段 NETMASK=255.255.255.0 #网卡对应的网络掩码 NETWORK=192.168.44.0 #网卡对应的网络地址,也就是所属的网段 ONBOOT=yes #系统启动时是否设置此网络接口,设置为yes时,系统启动时激活此设备 CentOS修改网关 # route add default gw 192.168.1.1 dev eth0 这样就把网关修改为192.168.1.1了,这种修改只是临时的,当你重新启动系统或网卡之后,还是会变回原来的网关。要想永久性修改,就要修改/etc/sysconfig/network 这个文件,这个文件的主要内容如下(你的文件中没有的项,你可以手动添加): # vi /etc/sysconfig/network NETWORKING=yes #表示系统是否使用网络,一般设置为yes。如果设为no,则不能使用网络。 HOSTNAME=centos #设置本机的主机名,这里设置的主机名要和/etc/hosts中设置的主机名对应 GATEWAY=192.168.1.1 #设置本机连接的网关的IP地址。 **********上面的文件修改完要重新启动一下网卡才会生效:# service network restart ******** CentOS修改DNS 上面的都修改完之后,当你ping一个域名是肯能不通,但ping对应的IP地址是同的,这时我们需要修改一下DNS。修改DNS要通过修改/etc/resolv.conf这个文件: # vi /etc/resolv.conf nameserver 8.8.8.8 #google域名服务器 nameserver 8.8.4.4 #google域名服务器 通过上面的所有设置,系统应该可以上网了。 如果centos系统建立在虚拟机之上,那么在设置虚拟机的网络时请选择‘网桥适配器’连接。 from:https://www.cnblogs.com/liuys635/p/11335594.html
View Details有以下命令可以查看: rpm -q centos-release # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: CentOS Description: CentOS release 5.4 (Final) Release: 5.4 Codename: Final 这个命令适用于所有的linux,包括Redhat、SuSE、Debian、Centos等发行版。 root@MyMail ~ # uname Linux root@MyMail ~ # uname -r 2.6.18-164.el5 [root@localhost ~]# uname -a Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux 以下二种方法适用于RedHat,CentOS root@MyMail ~ # cat /etc/redhat-release CentOS release 5.4 (Final) 登录到linux执行rpm -q redhat-release #rpm -q redhat-release 或CentOS root@MyMail ~ # rpm -q centos-release centos-release-5-4.el5.centos.1 当前centos 版本与redhat对应的版本的命令 # cat /proc/version Linux version 2.6.9-78.ELsmp (mockbuild@builder16.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Fri […]
View Details
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
2019-05-09 10:27:01,330 线程ID:[80] 日志级别:ERROR 出错类:WebApp.HttpGlobalExceptionFilter property:[(null)] - 错误描述:System.TypeInitializationException: The type initializer for 'System.DrawingCore.GDIPlus' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdiplus: cannot open shared object file: No such file or directory at System.DrawingCore.GDIPlus.GdiplusStartup(UInt64& token, GdiplusStartupInput& input, GdiplusStartupOutput& output) at System.DrawingCore.GDIPlus..cctor() --- End of inner exception stack trace --- at System.DrawingCore.GDIPlus.GdipGetGenericFontFamilySansSerif(IntPtr& fontFamily) at System.DrawingCore.FontFamily..ctor(GenericFontFamilies genericFamily) at System.DrawingCore.FontFamily.get_GenericSansSerif() at System.DrawingCore.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical) at Common.VerifyCodeHelper.CreateByteByImgVerifyCode(String verifyCode, Int32 width, Int32 height) in F:\src\WebApp\Common\VerifyCodeHelper.cs:line 206 at WebApp.Controllers.VerifyCodeController.NumberVerifyCode() in F:\src\WebApp\Controllers\VerifyCodeController.cs:line 27 at lambda_method(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() |
解决方法 Centos 7 yum install libgdiplus-devel from:https://www.cnblogs.com/asd14828/p/10837140.html?utm_source=tuicool
View Details
1 2 3 4 |
cd /etc/yum.repos.d/ #删除所有 rpm -Uvh --force https://vault.centos.org/7.7.1908/os/x86_64/Packages/centos-release-7-7.1908.0.el7.centos.x86_64.rpm yum clean all yum makecache |
from:https://www.jianshu.com/p/cd1dfca70e85 CentOS8 http://mirror.centos.org/centos-8/8.5.2111/extras/x86_64/os/Packages/centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm
View Details通过 Opw.HttpExceptions.AspNetCore 搞定了。 1)安装 nuget 包 Opw.HttpExceptions.AspNetCore
1 |
<PackageReference Include="Opw.HttpExceptions.AspNetCore" Version="2.3.0" /> |
2)Startup.ConfigureServices 中添加 AddHttpExceptions
1 |
services.AddControllers().AddHttpExceptions(); |
3)Startup.Configure 中添加 UseHttpExceptions
1 |
app.UseHttpExceptions(); |
示例响应输出
1 |
{"type":"error:invalid-cast","title":"InvalidCast","status":500,"detail":"Invalid cast from \u0027System.Int32\u0027 to \u0027Cnblogs.Infrastructure.Primitives.PostConfig\u0027.","instance":"/zzkdocuments"} |
from:https://q.cnblogs.com/q/121590/
View Details