软件

参考:https://www.bt.cn/bbs/forum.php?mod=viewthread&tid=72329&highlight=sqlsrvcurlhttps://packages.microsoft.com/config/rhel/7/prod.repo>/etc/yum.repos.d/mssql-release.repoyumcleanallACCEPT_EULA=Yyuminstall-ymsodbcsqlmssql-toolsunixODBC-devel#安装sqlsrvcd/tmpwgethttps://pecl.php.net/get/sqlsrv-5.8.1.tgztar-zxvfsqlsrv-5.8.1.tgzcdsqlsrv-5.8.1/www/server/php/73/bin/phpize./configure--with-php-config=/www/server/php/73/bin/php-configmake&&makeinstallecho"extension=sqlsrv.so">>/www/server/php/73/etc/php.ini#安装pdo_sqlsrvcd/tmpwgethttps://pecl.php.net/get/pdo_sqlsrv-5.8.1.tgztar-zxvfpdo_sqlsrv-5.8.1.tgzcdpdo_sqlsrv-5.8.1/www/server/php/73/bin/phpize./configure--with-php-config=/www/server/php/73/bin/php-configmake&&makeinstallecho"extension=pdo_sqlsrv.so">>/www/server/php/73/etc/php.ini/etc/init.d/php-fpm-73reload#检查扩展是否安装成功/www/server/php/73/bin/php-m|grep-isqlsrv=================================php连接sqlserver1、安装必要的软件包:sudoyuminstallepel-releasesudoyuminstallunixODBC-devel2、下载并安装Microsoft提供的SQLServer驱动程序:curlhttps://packages.microsoft.com/config/rhel/7/prod.repo>/etc/yum.repos.d/mssql-release.repoyumremoveunixODBC-utf16unixODBC-utf16-develACCEPT_EULA=Yyuminstallmsodbcsql17ACCEPT_EULA=Yyuminstallmssql-toolsecho'exportPATH="$PATH:/opt/mssql-tools/bin"'>>~/.bash_profileecho'exportPATH="$PATH:/opt/mssql-tools/bin"'>>~/.bashrcsource~/.bashrcyuminstallunixODBC-develcat/etc/odbcinst.ini可以看到最后面有[ODBCDriver17forSQLServer]的配置,恭喜你,驱动安装完成参考:https://cloud.tencent.com/developer/article/2006009也可以使用下面命令验证是否成功:odbcinst-q-d-n"ODBCDriver17forSQLServer"如果成功安装,您应该能够看到有关驱动程序的详细信息。3、启用PHP的SQLServer扩展:sudoyuminstallphp-pdosudoyuminstallphp-sqlsrv4、编辑php.ini文件:打开PHP的配置文件php.ini,找到以下两行并确保它们未被注释:extension=pdo_sqlsrvextension=sqlsrv重启服务器,测试php连接SQLserver是否正常

2024-3-18 6 0
软件

安装重装系统的前提组件Debian/Ubuntu:apt-getinstall-yxz-utilsopensslgawkfilewgetscreen&&screen-SosRedHat/CentOS:yuminstall-yxzopensslgawkfileglibc-commonwgetscreen&&screen-Sos如果出现异常,请刷新Mirrors缓存或更换镜像源。RedHat/CentOS:yummakecache&&yumupdate-yDebian/Ubuntu:aptupdate-y&&aptdist-upgrade-y一键智能安装脚本一键DD脚本,支持性好,更智能更全面,支持国内外各种VPS重装,特别是对国内各种访问国外资源慢的VPS安装有奇效。支持debian11.发现很多人不知道怎么DD甲骨文,使用支持uefi的镜像包即可.脚本已添加3个甲骨文专用选项23-25.wget--no-check-certificate-OAutoReinstall.shhttps://d.02es.com/AutoReinstall.sh&&chmoda+xAutoReinstall.sh&&bashAutoReinstall.sh输入Y确认DD后主机自动获取IP,N则自行设置IP输入N后会自动检测出主机现用IP,如果正确可以按Y确认使用,如不正确则按N自行按正确的输入。25合1的系统一键DD选择界面,输入99则使用自定义镜像。以上系统密码不为默认密码的均为网络收集,如有疑虑使用自己的自定义镜像。25合一系统密码:1、CentOS7.7(已关闭防火墙及SELinux,默认密码Pwd@CentOS)2、CentOS7(默认密码cxthhhhh.com)3、CentOS8(默认密码cxthhhhh.com)4、CentOS6(默认密码Minijer.com)5、Debian11(默认密码Minijer.com)6、Debian10(默认密码Minijer.com)7、Debian9(默认密码Minijer.com)8、Debian8(默认密码Minijer.com)9、Ubuntu20.04(默认密码Minijer.com)10、Ubuntu18.04(默认密码Minijer.com)11、Ubuntu16.04(默认密码Minijer.com)12、WindowsServer2019(默认密码cxthhhhh.com)13、WindowsServer2016(默认密码cxthhhhh.com)14、WindowsServer2012(默认密码cxthhhhh.com)15、WindowsServer2012Lite(默认密码nat.ee)16、WindowsServer2008(默认密码cxthhhhh.com)17、WindowsServer2008Lite(默认密码nat.ee)18、WindowsServer2003(默认密码cxthhhhh.com)19、WindowsServer2003Lite(默认密码WinSrv2003x86-Chinese)20、Windows10LTSCLite(默认密码www.nat.ee)21、Windows7x86Lite(默认密码Windows7x86-Chinese)22、Windows7EntLite(默认密码nat.ee)23、Windows7EntLite(UEFI支持甲骨文)(默认密码nat.ee)24、WindowsServer2008Lite(UEFI支持甲骨文)(默认密码nat.ee)25、WindowsServer2012Lite(UEFI支持甲骨文)(默认密码nat.ee)99、自定义镜像注意:经测试在谷歌云原版系统基础上DD会出现自动获取的子网掩码为255.255.255.255,如出现这种情况需要手工输入改正为正确的如255.255.255.0,否则会安装完成主机可能会离线。OracleCloud(甲骨文云)可选择23-25一键DD,注意基础系统最好选择Ubuntu,如原系统是CentOS可能无法成功。萌咖一键安装脚本实测支持virmach系统下直接dd系统.全自动安装默认root密码:MoeClub.org,安装完成后请立即更改密码.能够全自动重装Debian/Ubuntu/CentOS等系统.同时提供dd安装镜像功能,例如:全自动无救援dd安装windows系统全自动安装CentOS时默认提供VNC功能,可使用VNCViewer查看进度,VNC端口为1或者5901,可自行尝试连接.(成功后VNC功能会消失.)目前CentOS系统只支持任意版本重装为CentOS6.x及以下版本.特别注意:OpenVZ构架不适用.wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&chmod+xInstallNET.sh#bashInstallNET.sh+安装命令DDdebian10示例wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-d10-v64-p"自定义root密码"-port"自定义ssh端口"DDubuntu20.04示例wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-u20.04-v64-p"自定义root密码"-port"自定义ssh端口"下载及说明:Usage:bashInstallNET.sh-d/--debian[dist-name]-u/--ubuntu[dist-name]-c/--centos[dist-version]-v/--ver[32/i386|64/amd64]--ip-addr/--ip-gate/--ip-mask-apt/-yum/--mirror-dd/--image-a/-m#dist-name:发行版本代号#dist-version:发行版本号#-apt/-yum/--mirror:使用定义镜像#-a/-m:询问是否能进入VNC自行操作.-a为不提示(一般用于全自动安装),-m为提示.使用示例:#使用默认镜像全自动安装bashInstallNET.sh-d8-v64-abashInstallNET.sh-d9-v64-abashInstallNET.sh-d10-v64-a分别表示自动安装Debian8x649x6410x64#使用自定义镜像全自动安装bashInstallNET.sh-c6.9-v64-a--mirror'http://mirror.centos.org/centos'#以下示例中,将X.X.X.X替换为自己的网络参数.#--ip-addr:IPAddress/IP地址#--ip-gate:Gateway/网关#--ip-mask:Netmask/子网掩码#使用自定义镜像自定义网络参数全自动安装#bashInstallNET.sh-u16.04-v64-a--ip-addrx.x.x.x--ip-gatex.x.x.x--ip-maskx.x.x.x--mirror'http://archive.ubuntu.com/ubuntu'#使用自定义网络参数全自动dd方式安装#bashInstallNET.sh--ip-addrx.x.x.x--ip-gatex.x.x.x--ip-maskx.x.x.x-dd'https://moeclub.org/get-win7embx86-auto'#使用自定义网络参数全自动dd方式安装存储在谷歌网盘中的镜像(调用文件ID的方式)#bashInstallNET.sh--ip-addrx.x.x.x--ip-gatex.x.x.x--ip-maskx.x.x.x-dd"$(echo"1cqVl2wSGx92UTdhOxU9pW3wJgmvZMT_J"|xargs-n1bash<(wget--no-check-certificate-qO-'https://moeclub.org/get-gdlink'))"#使用自定义网络参数全自动dd方式安装存储在谷歌网盘中的镜像#bashInstallNET.sh--ip-addrx.x.x.x--ip-gatex.x.x.x--ip-maskx.x.x.x-dd"$(echo"https://drive.google.com/open?id=1cqVl2wSGx92UTdhOxU9pW3wJgmvZMT_J"|xargs-n1bash<(wget--no-check-certificate-qO-'https://moeclub.org/get-gdlink'))"自定义DD包地址示例脚本,补全DD包直连地址后运行即可;#DDWindowsServer2008R264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2008R2_sp1_64_Administrator_nat.ee.gz'#DDWindowsServer2012R264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2012R2_64_Administrator_nat.ee.gz'#DDWindowsServer201664位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2016_64_Administrator_nat.ee.gz'#DDWindowsServer201964位精简版[账户Administrator密码WinSrv2019dc-Chinese]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2019_64_Administrator_WinSrv2019dc-Chinese.gz'#DDWindowsServer202264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2022_64_Administrator_nat.ee.gz'#DDWindowsServer202264位DataCenter版[账户Administrator密码DataCenter]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Disk_Windows_Server_2022_DataCenter_CN_v2.12.vhd.gz'#DDWindows732位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win7_86_Administrator_nat.ee.gz'#DDWindows7sp164位企业精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win7_sp1_64_Administrator_nat.ee.gz'#DDWindows8.164位专业精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win8.1_64_Administrator_nat.ee.gz'#DDWindows102016LTSB64位企业深度精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win10_2016LTSB_64_Administrator_nat.ee.gz'#DDWindows102019LTSC64位企业适量精简版[账户Administrator密码Vicer]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win10_2019LTSC_64_Administrator_Vicer.gz'精简版DD包如果没有自己的DD包,可以使用博主提供的包,从以下版本中选择自己需要的系统,然后输入一键脚本即可;#DDWindowsServer2008R264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2008R2_sp1_64_Administrator_nat.ee.gz'#DDWindowsServer2012R264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2012R2_64_Administrator_nat.ee.gz'#DDWindowsServer201664位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2016_64_Administrator_nat.ee.gz'#DDWindowsServer201964位精简版[账户Administrator密码WinSrv2019dc-Chinese]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2019_64_Administrator_WinSrv2019dc-Chinese.gz'#DDWindowsServer202264位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win_Server2022_64_Administrator_nat.ee.gz'#DDWindowsServer202264位DataCenter版[账户Administrator密码DataCenter]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Disk_Windows_Server_2022_DataCenter_CN_v2.12.vhd.gz'#DDWindows732位精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win7_86_Administrator_nat.ee.gz'#DDWindows7sp164位企业精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win7_sp1_64_Administrator_nat.ee.gz'#DDWindows8.164位专业精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win8.1_64_Administrator_nat.ee.gz'#DDWindows102016LTSB64位企业深度精简版[账户Administrator密码nat.ee]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win10_2016LTSB_64_Administrator_nat.ee.gz'#DDWindows102019LTSC64位企业适量精简版[账户Administrator密码Vicer]wget--no-check-certificate-qOInstallNET.sh'https://d.02es.com/InstallNET.sh'&&bashInstallNET.sh-dd'https://d.02es.com/Windows/Win10_2019LTSC_64_Administrator_Vicer.gz'救援模式下直接DD系统镜像进入救援模式,连接救援模式下的服务器,首先执行以下命令:fdisk-l找到与系统硬盘容量匹配的盘位置名称,替换下方的“sda”,同时替换“DDISOURL”为DD镜像的地址wget-O-"DDISOURL"|gunzip|ddof=/dev/sda例如:wget-O-"http://d.02es.com/win/lite/win7-ent-sp1-x64-cn/win7-ent-sp1-x64-cn.vhd.gz"--no-check-certificate|gunzip|ddof=/dev/vda准备完毕,执行替换后的命令开始DD系统。注意在DD完成后,要再次返回后台,退出救援模式,等待DD后的系统启动即可。有些设备可能需要连接VNC,手动配置IP信息。精简版win2016、2019DD镜像(3.3GB~3.8GB)-FromTeddysun进入救援模式,连接救援模式下的服务器,首先执行以下命令:fdisk-l找到与系统硬盘容量匹配的盘位置名称,替换下方的“sda”,以下包含两种语言的win系统,可根据需要自主选择:wget-O-"https://d.02es.com/os/cn_win2016.xz"--no-check-certificate|xzcat|ddof=/dev/sdawget-O-"https://d.02es.com/os/cn_win2019.xz"--no-check-certificate|xzcat|ddof=/dev/sdawget-O-"https://d.02es.com/os/en_win2016.xz"--no-check-certificate|xzcat|ddof=/dev/sdawget-O-"https://d.02es.com/os/en_win2019.xz"--no-check-certificate|xzcat|ddof=/dev/sdaWindows服务器开启Ping功能打开系统运行服务Win+R输入命令##开启Pingnetshfirewallseticmpsetting8##关闭Pingnetshfirewallseticmpsetting8disable常用工具下载密码为根域名https://d.02es.com/tool.zip特别感谢:Vicer、cxt、hiCasper、Teddysun等各位技术大佬的脚本,站长只是脚本的"搬运工"。转自:https://d.02es.com/

软件

远程连接WindowsServer2003实例时,使用VNC登录服务器正常,但是使用其他远程连接方式登录服务器时,打开程序和浏览网站速度缓慢,本文介绍该场景下的解决方案。问题描述远程连接WindowsServer2003实例时,使用VNC登录服务器正常,但是使用其他远程连接方式登录服务器时,打开程序和浏览网站速度缓慢。问题原因网卡的Offload.Tx.LSO参数为开启状态导致该问题。解决方案您可以根据实际情况选择如下任意一种方案处理该问题,具体如下:方案一:更换操作系统阿里云不再支持WindowsServer2003系统镜像。因此,建议您使用WindowsServer2012及以上版本的Windows操作系统,避免出现该问题。更换实例操作系统的具体操作,请参见更换操作系统(系统盘)。警告更换操作系统的本质是更换系统盘。更换操作系统后,原来旧的系统盘会被释放,会清除系统盘上的所有数据,请在更换操作系统前为系统盘创建快照备份数据,再执行操作,创建快照的更多信息,请参见快照概述。方案二:将网卡的Offload.Tx.LSO参数更改为Disabled您需要将网卡的Offload.Tx.LSO参数更改为Disabled,操作步骤如下:远程连接ECS实例。具体操作,请参见连接方式概述。打开控制面板,然后选择网络和lnternet。单击查看网络状态和任务,然后在左侧导航栏单击更改适配器设置。选择对应的网卡,单击鼠标右键,然后选择属性>配置。单击高级页签,配置Offload.Tx.LSO参数。您需要先在属性列表中选择Offload.Tx.LS,然后将值选择为Disabled。单击确定,保存配置。转自:https://help.aliyun.com/zh/ecs/support/what-do-i-do-if-operations-are-slow-on-a-windows-server-2003-instance-after-i-connect-to-the-instance?spm=a2c4g.11186623.0.i27

2023-1-7 399 0
软件

图片的大小直接影响到网站打开的速度,同时有一些超级大的图片,不断加载慢,动辄几m十几m,这种图片本身在网站上显示的话本身没有起到任何作用,反而拉慢了网站的打开速度,使用图片压缩的时候,我们往往是把图片下载下来,然后手动批量压缩,如果用linux服务器,那么我们可以使用jpegoptim、optipng、ImageMagick等软件在服务器上直接对图片进行批量压缩。这样就大大方便了我们,有必要的话,我们还可以让压缩定时执行,这样就不断的优化了网站的打开速度,同时也降低了硬盘的占用。jpegoptim:用于压缩jpg,命令如下:1.查看哪个文件夹比较大du-h--max-depth=1#查找当前目录下文件大小2.安装jpegoptim压缩(用于压缩jpg)yuminstalljpegoptim3.执行进行压缩find/tptest-name'*.jpg'|xargsjpegoptim--strip-all--max=50%optipng:用于压缩png,命令如下:1.安装optipngyuminstalloptipng2.执行进行压缩find/tptest-name'*.png'|xargsoptipng但optipng经过我的使用,发现压缩的效果并不是很好,压缩率不高imagemagick:很多格式都可以压,效果也不咋的,可能没有设置好,有时间再研究1.安装imagemagick依赖的库yuminstall-ylibjpeglibjpeg-devellibpnglibpng-devellibtifflibtiff-devellibungiflibungif-develfreetypezlib2.如果以前安装过,卸载掉ImageMagick:yumremoveImageMagick3.然后yum命令安装yuminstallImageMagick4.查看是否安装成功(成功会显示版本号)convert--version5.85%质量进行压缩find/tptest-iname'*.png'-execconvert-strip+profile'*'-quality85{}{}\;总结:上面的3个软件,使用都还算简单,jpegoptim效果是最好的,我们常见的图片格式也是jpg的,所以使用的最多。其他两个软件效果不是很好,没有具体需要,需要的时候可以再仔细研究研究。

2022-6-23 465 0