全部 文章 问答 分享 共找到92个相关内容
[文章] Linux基础的学习
写在前面一方面,为了阿里云服务器的续费,开始学习Linux。另一方面,近期学的很多东西都需要装到Linux服务器上,那么一些基本命令的学习显然是必要的。最近就抽了个时间来学习一下基本的Linux命令。
2020-07-27 23:47 · Linux / 基础
[文章] Linux主机时间同步
Linux时间有两种在Linux下,默认情况下,系统时间和硬件时间并不会自动同步。在Linux运行过程中,系统时间和硬件时间以异步的方式运行,互不干扰。
2021-03-28 13:03 · Linux / 运维
[文章] linux防火墙查看状态firewall
我经常会遇到本地浏览器访问Linux虚拟机中搭建的环境,访问失败。原因很简单,一台新的虚拟机,很多窗口是没有打开的。我们需要在防火墙中打开对应的端口。
2021-03-30 20:13 · linux
[文章] Linux基础学习2
写在前面本文紧接上文:Linux基础学习1声明:本人允许任何形式的转载(虽然不一定有人会转)Linux文件目录命令显示当前shellCWD(currentworkdirectory当前工作目录)的绝对路径
2020-07-29 14:54 · Linux / 基础
[文章] linux系统查看命令(常用)
工具三:SecureCRT软件比较专业,一般是英文界面;经常使用linux,使用这款软件是不错的选择。
2021-08-10 22:07 · linux / 运维
[文章] Linux挂载空闲数据盘
/最佳):512字节/512字节磁盘标签类型:dos磁盘标识符:0x000eb8c5设备BootStartEndBlocksIdSystem/dev/sda1*20482099199104857683Linux
2021-02-05 17:43 · Linux
[文章] Linux的常用命令
格式:ls[参数][路径或文件名]常用:在linux中以.开头的文件都是隐藏的文件*ls*ls-a显示所有文件或目录(包含隐藏的文件)*ls-l缩写成ll2.切换目录命令cd:使用cdapp切换到app
2020-11-19 16:25 · Linux / Linux命令 / Linux打包 / vim / Linux网络配置
[文章] Linux标准输出字符集
Linux标准输出字符集新建文件mybash.shvim/etc/profile.d/mybash.shmybash.sh内容####标准输出字符集###########################
1970-01-01 00:00 · Linux / shell
[文章] Linux上安装软件安装(JDK,mysql,tomcat,redis)
1.Linux上的软件安装有以下几种常见方式介绍二进制发布包软件已经针对具体平台编译打包发布,只要解压,修改配置即可RPM包软件已经按照redhat的包管理工具规范RPM进行打包发布,需要获取到相应的软件
2020-11-19 16:53 · Linux下软件安装 / jdk / tomcat / redis / 项目部署
[文章] 优雅的查看Linux进程
三、glances工具glances是一款用于Linux、BSD的开源命令行系统监视工具,它使用Python语言开发,能够监视CPU、负载、内存、磁盘I/O、网络流量、文件系统、系统温度等信息。
1970-01-01 00:00 · Linux小工具
[文章] SVN的备份(linux版)
linux中SVN备份有多种方式1、svnadmindump是官方推荐的备份方式,优点是比较灵活,可以全量备份也可以增量备份,并提供版本恢复机制。
2021-07-29 00:31 · svn / linux
[文章] 安装redis-6.2.5(linux版)
src'redis.conf配置文件修改配置文件redis.conf这个很重要哦#1.1NETWORK设置:bind192.168.127.128//绑定IP地址,可以通过ifconfig获取Ip地址(在Linux
2021-08-09 23:15 · redis / linux运维
[文章] Linux诊断原因
结合Linux和JDK命令一起分析,步骤如下使用top命令找出CPU占比最高的ps-ef或者jps进一步定位,得知是一个怎么样的后台程序出的问题定位到具体线程或者代码ps-mp进程 -oTHREAD,tid
2020-11-02 13:33 · Linux
[文章] Linux,jdk11 图灵验证码,java.io.IOException:Problem reading font data
Linux,jdk11打jar包运行,使用图灵验证码Captcha,出现错误java.io.IOException:Problemreadingfontdata报错原因:没有读取到Captcha的字体publicstaticfinalint
2021-09-18 09:57 · 图灵验证码
[文章] Linux或者云服务器下如何运行长时间运行war包和jar包
Linux或者云服务器下如何运行长时间运行war包和jar包准备自行在系统中安装JDK、mysql、Tomcat。
2020-06-18 19:26 · linux / java / jar / war
[文章] Linux安装编译nginx精简版
安装必要的包yuminstallgccgcc-c++pcrepcre-develzlibzlib-developenssl*openssl-devel如果必要的包不能通过yum源安装,请检查Linux网络配置创建
1970-01-01 00:00 · nginx / Linux
[文章] Linux下 vi/vim的使用
概述vi编辑器是所有Unix及Linux系统下标准的编辑器,功能强大。这里只是简单地介绍一下它的用法和一小部分命令。
2020-09-07 09:22 · Linux / vi / vim
[文章] AOSP-android必备基础知识 Linux Shell
什么是Shell如果你接触计算机多年,可能有人跟你说过黑乎乎的命令行窗口就是shell,Windows有命令行窗口,而Linux各个发行版本也有命令行窗口。我们先不管这个。
2019-10-11 00:05 · shell / 操作系统 / 运维 / aosp / android
[文章] 搭建简单的监控系统(Grafana)
原因是Linux服务器没有开通9090端口,我们只需要开通9090端口就可以访问啦这个就是一个坑啦;一开始我也不知道为什么,后来想了一下,是Linux防火墙的原因。
2021-02-18 21:10 · Prometheus
[文章] Centos 启动级别
关机操作在DOS下和Linux下截然不同。在DOS提示符下,可以很放心地直接关闭电源。但是,在Linux下不能这么做。Linux的文件系统在启动时被装入,在关闭时要被卸载。
2020-07-16 01:28 · centos
[文章] CentOS系统信息查看与防火墙操作
本案例命令均亲测可用Linux系统基本信息命令Linuxuname(英文全拼:unixname)命令用于显示系统信息,uname可显示电脑以及操作系统的相关信息。
2021-02-23 15:43 · Linux / CentOS / 运维
[问答] AOSP - android-9.0.0_r8 源码整编时出错
HOST_OS_EXTRA=Linux-5.4.0-26-generic-x86_64-Ubuntu-20.04-LTS HOST_CROSS_OS=windows HOST_CROSS_ARCH=x86
2021-09-15 12:58 · AOSP / Unbuntu编译AOSP出错 / Android9
[问答] 我在GitHub上有个开源项目,需要各位帮助
我正在搜集各种Linux发行版开启kvm的方法,以加快AndroidStudio的安卓VM的速度。
2020-03-13 16:26 · kvm / linux / 安卓 / 开发 / 开源
[文章] Linux学习---awk命令
1、AWK简介AWK是一种处理文本文件的语言,是一个强大的文本分析工具。2、AWK语法awk[选项参数]'script'var=valuefile(s)或awk[选项参数]-fscriptfilevar=valuefile(s)123选项参数的说明:-Ffsor–field-separatorfs指定输入文件折分隔符,fs是一个字符串或者是一个正则表达式,如-F:-vvar=valueor–asignvar=value赋值一个用户定义变量。-fscripfileor–filescriptfile从脚本文件中读取awk命令。-mfnnnand-mrnnn对nnn值设置内在限制,-mf选项限制分配给nnn的最大块数目;-mr选项限制记录的最大数目。这两个功能是Bell实验室版awk的扩展功能,在标准awk中不适用。-Wcompactor–compat,-Wtraditionalor–traditional在兼容模式下运行awk。所以gawk的行为和标准的awk完全一样,所有的awk扩展都被忽略。-Wcopyleftor–copyleft,-Wcopyrightor–copyright打印简短的版权信息。-Whelpor–help,-Wusageor–usage打印全部awk选项和每个选项的简短说明。-Wlintor–lint打印不能向传统unix平台移植的结构的警告。-Wlint-oldor–lint-old打印关于不能向传统unix平台移植的结构的警告。-Wposix打开兼容模式。但有以下限制,不识别:/x、函数关键字、func、换码序列以及当fs是一个空格时,将新行作为一个域分隔符;操作符和=不能代替和=;fflush无效。-Wre-intervalor–re-inerval允许间隔正则表达式的使用,参考(grep中的Posix字符类),如括号表达式[[:alpha:]]。-Wsourceprogram-textor–sourceprogram-text使用program-text作为源代码,可与-f命令混用。-Wversionor–version打印bug报告信息的版本。3、基本用法一段文本:cion.txtgold11986USAAmericanEaglegold11908Austria-HungaryFranzjosef100Koronasilver101981USAingotgold11984Switzerlandingotgold11979RSAKrugerrandgold0.51981RSAKrugerrandgold0.11986PRCPandasilver11986USALibertydollargold0.251986USALiberty5-dollarpiecesilver11986USALiberty50-centpiecesilver11987USAConstitutiondollargold0.251987USAConstitution5-dollarpiecegold11988CanadaMapleleaf打印cion.txt文本[root@Pengfeitest02]#awk'{print}'cions.txtgold11986USAAmericanEaglegold11908Austria-HungaryFranzjosef100Koronasilver101981USAingotgold11984Switzerlandingotgold11979RSAKrugerrandgold0.51981RSAKrugerrandgold0.11986PRCPandasilver11986USALibertydollargold0.251986USALiberty5-dollarpiecesilver11986USALiberty50-centpiecesilver11987USAConstitutiondollargold0.251987USAConstitution5-dollarpiecegold11988CanadaMapleleaf打印1,2,3行的数据[root@Pengfeitest02]#awk'{print$1,$2,$3}'cions.txtgold11986gold11908silver101981gold11984gold11979gold0.51981gold0.11986silver11986gold0.251986silver11986silver11987gold0.251987gold11988record:横行field:竖行NRNFN表示number[root@Pengfeitest02]#awk'{printNR"\t"$0}'cions.txt1gold11986USAAmericanEagle2gold11908Austria-HungaryFranzjosef100Korona3silver101981USAingot4gold11984Switzerlandingot5gold11979RSAKrugerrand6gold0.51981RSAKrugerrand7gold0.11986PRCPanda8silver11986USALibertydollar9gold0.251986USALiberty5-dollarpiece10silver11986USALiberty50-centpiece11silver11987USAConstitutiondollar12gold0.251987USAConstitution5-dollarpiece13gold11988CanadaMapleleaf[root@Pengfeitest02]#awk'{printNF"\t"$0}'cions.txt6gold11986USAAmericanEagle8gold11908Austria-HungaryFranzjosef100Korona5silver101981USAingot5gold11984Switzerlandingot5gold11979RSAKrugerrand5gold0.51981RSAKrugerrand5gold0.11986PRCPanda6silver11986USALibertydollar7gold0.251986USALiberty5-dollarpiece7silver11986USALiberty50-centpiece6silver11987USAConstitutiondollar7gold0.251987USAConstitution5-dollarpiece6gold11988CanadaMapleleaf年份是1986的就会输出[root@Pengfeitest02]#awk'$3==1986{print$0}'cions.txt#年份是1986的就会输出gold11986USAAmericanEaglegold0.11986PRCPandasilver11986USALibertydollargold0.251986USALiberty5-dollarpiecesilver11986USALiberty50-centpiece[root@Pengfeitest02]#awk'$1=="gold"{print$0}'cions.txt#gold是字符串,需要加上""gold11986USAAmericanEaglegold11908Austria-HungaryFranzjosef100Koronagold11984Switzerlandingotgold11979RSAKrugerrandgold0.51981RSAKrugerrandgold0.11986PRCPandagold0.251986USALiberty5-dollarpiecegold0.251987USAConstitution5-dollarpiecegold11988CanadaMapleleafawk输入输出[root@Pengfeitest02]#awk'{print$1,$2}'helloworldhelloworldabcdefab[root@Pengfeitest02]#awk'{print$2,$1}'helloworldworldhelloabcdba[root@Pengfeitest02]#awk'BEGIN{FS=","}{print$1,$2}'#输入分隔符,通过分隔符来判断是第几段helloworld123456helloworld123456hello,wrold123,456hellowrold123hello,wrold,123,456hellowrold[root@Pengfeitest02]#awk'BEGIN{OFS=","}{print$1,$2}'#输出分隔符hellowrold123456hello,wrold[root@Pengfeitest02]#awk'BEGIN{FS=",";OFS=","}{print$1,$2}'#输入分隔符输出分隔符都为","hello,world,123,456hello,world[root@Pengfeitest02]#awk'BEGIN{FS="1234";OFS="\t****"}{print$1,$2}'#输入时为1234,输出时为****helloworld12345678helohelloworld****5678helohelloworld123445678helohelloworld****45678helo打印九九乘法表:seq9|sed'H;g'|awk-vRS='''{for(i=1;i<=NF;i++)printf("%dx%d=%d%s",i,NR,i*NR,i==NR?"\n":"\t")}'[root@Pengfeitest02]#seq9|sed'H;g'|awk-vRS='''{for(i=1;i<=NF;i++)printf("%dx%d=%d%s",i,NR,i*NR,i==NR?"\n":"\t")}'1x1=11x2=22x2=41x3=32x3=63x3=91x4=42x4=83x4=124x4=161x5=52x5=103x5=154x5=205x5=251x6=62x6=123x6=184x6=245x6=306x6=361x7=72x7=143x7=214x7=285x7=356x7=427x7=491x8=82x8=163x8=244x8=325x8=406x8=487x8=568x8=641x9=92x9=183x9=274x9=365x9=456x9=547x9=638x9=729x9=81
2020-12-27 19:17 · Linux学习
[文章] 13、Android开发基础之数据存储-查看保存的数据
前面我们说到了,Android呢是基于Linux系统的,而Linux系统对权限的管理是非常严格的。
2019-10-21 22:49 · 安卓开发 / 数据存储 / 安卓应用 / app / android
[文章] Linux必会的基本命令
#进入根目录cd/#创建文件夹testmkdirtest#创建test.txt文件touchtest.txt#解压v2.26.2.tar.gztar-zxvfv2.26.2.tar.gz#解压解压v2.26.2.tar.gz到当前目录tar-zxvfv2.26.2.tar.gz./#解压解压v2.26.2.tar.gz到/usr/local/tar-zxvfv2.26.2.tar.gz./usr/local#查看ipipaddr#分配一个ip地址dhclient#解压ruoyi-ui.zipunzipruoyi-ui.zip#删除压缩文件ruoyi-ui.ziprm-rfruoyi-ui.zip#查看所有文件,包括隐藏文件ls-al#移动文件或目录mv#返回上一级目录cd..#当前目录./#显示当前所在目录pwd#创建多级目录mkdir-ptest1/test2/test3#删除目录,只能删除空文件夹rmdirtest1#删除目录,不为空也能删除nrmdir-ptest2#复制文件cp#tab键自动补全#查看网络配置ifconfig#查看剩余内存free-h
2020-10-16 14:32 · Linux
[文章] 12、Android开发基础之数据存储
android系统的目录android系统是基于Linux系统的,它不像windows系统一样,有C盘,D盘之类的。
[问答] 源码编译出现问题
TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=generic HOST_ARCH=x86_64 HOST_2ND_ARCH=x86 HOST_OS=linux
2021-06-10 23:13 · aosp / android / ubuntu / error
[文章] 查看Linux系统状态脚本
脚本名称system.sh#!/bin/bashset-e#iP地址IP=`ifconfig|grepinet|grep-vE'inet6|127.0.0.1'|awk'{print$2}'`echo"IP地址:"$IP#获取cpu总核数cpu_num=`grep-c"modelname"/proc/cpuinfo`echo"cpu总核数:"$cpu_num#1、获取CPU利用率#################################################us用户空间占用CPU百分比#sy内核空间占用CPU百分比#ni用户进程空间内改变过优先级的进程占用CPU百分比#id空闲CPU百分比#wa等待输入输出的CPU时间百分比#hi硬件中断#si软件中断##################################################获取用户空间占用CPU百分比cpu_user=`top-b-n1|grepCpu|awk'{print$2}'|cut-f1-d"%"`echo"用户空间占用CPU百分比:"$cpu_user#获取内核空间占用CPU百分比cpu_system=`top-b-n1|grepCpu|awk'{print$4}'|cut-f1-d"%"`echo"内核空间占用CPU百分比:"$cpu_system#获取空闲CPU百分比cpu_idle=`top-b-n1|grepCpu|awk'{print$8}'|cut-f1-d"%"`echo"空闲CPU百分比:"$cpu_idle#获取等待输入输出占CPU百分比cpu_iowait=`top-b-n1|grepCpu|awk'{print$10}'|cut-f1-d"%"`echo"等待输入输出占CPU百分比:"$cpu_iowait#2、获取CPU上下文切换和中断次数#获取CPU中断次数cpu_interrupt=`vmstat-n11|sed-n3p|awk'{print$11}'`echo"CPU中断次数:"$cpu_interrupt#获取CPU上下文切换次数cpu_context_switch=`vmstat-n11|sed-n3p|awk'{print$12}'`echo"CPU上下文切换次数:"$cpu_context_switch#3、获取CPU负载信息#获取CPU15分钟前到现在的负载平均值cpu_load_15min=`uptime|awk'{print$11}'|cut-f1-d','`echo"CPU15分钟前到现在的负载平均值:"$cpu_load_15min#获取CPU5分钟前到现在的负载平均值cpu_load_5min=`uptime|awk'{print$10}'|cut-f1-d','`echo"CPU5分钟前到现在的负载平均值:"$cpu_load_5min#获取CPU1分钟前到现在的负载平均值cpu_load_1min=`uptime|awk'{print$9}'|cut-f1-d','`echo"CPU1分钟前到现在的负载平均值:"$cpu_load_1min#获取任务队列(就绪状态等待的进程数)cpu_task_length=`vmstat-n11|sed-n3p|awk'{print$1}'`echo"CPU任务队列长度:"$cpu_task_length#4、获取内存信息#获取物理内存总量mem_total=`free|grepMem|awk'{print$2}'`echo"物理内存总量:"$mem_total#获取操作系统已使用内存总量mem_sys_used=`free|grepMem|awk'{print$3}'`echo"已使用内存总量(操作系统):"$mem_sys_used#获取操作系统未使用内存总量mem_sys_free=`free|grepMem|awk'{print$4}'`echo"剩余内存总量(操作系统):"$mem_sys_free#获取应用程序已使用的内存总量mem_user_used=`free|sed-n3p|awk'{print$3}'`echo"已使用内存总量(应用程序):"$mem_user_used#获取应用程序未使用内存总量mem_user_free=`free|sed-n3p|awk'{print$4}'`echo"剩余内存总量(应用程序):"$mem_user_free#获取交换分区总大小mem_swap_total=`free|grepSwap|awk'{print$2}'`echo"交换分区总大小:"$mem_swap_total#获取已使用交换分区大小mem_swap_used=`free|grepSwap|awk'{print$3}'`echo"已使用交换分区大小:"$mem_swap_used#获取剩余交换分区大小mem_swap_free=`free|grepSwap|awk'{print$4}'`echo"剩余交换分区大小:"$mem_swap_free#5、获取磁盘I/O统计信息#使用iostat命令需要安装sysstat包echo"指定设备(/dev/sda)的统计信息"#每秒向设备发起的读请求次数disk_sda_rs=`iostat-kx|grepsda|awk'{print$4}'`echo"每秒向设备发起的读请求次数:"$disk_sda_rs#每秒向设备发起的写请求次数disk_sda_ws=`iostat-kx|grepsda|awk'{print$5}'`echo"每秒向设备发起的写请求次数:"$disk_sda_ws#向设备发起的I/O请求队列长度平均值disk_sda_avgqu_sz=`iostat-kx|grepsda|awk'{print$9}'`echo"向设备发起的I/O请求队列长度平均值"$disk_sda_avgqu_sz#每次向设备发起的I/O请求平均时间disk_sda_await=`iostat-kx|grepsda|awk'{print$10}'`echo"每次向设备发起的I/O请求平均时间:"$disk_sda_await#向设备发起的I/O服务时间均值disk_sda_svctm=`iostat-kx|grepsda|awk'{print$11}'`echo"向设备发起的I/O服务时间均值:"$disk_sda_svctm#向设备发起I/O请求的CPU时间百分占比disk_sda_util=`iostat-kx|grepsda|awk'{print$12}'`echo"向设备发起I/O请求的CPU时间百分占比:"$disk_sda_utilLinux中测试[root@ncayu618data]#./system.sh./system.sh:行1:#!/bin/bash:没有那个文件或目录IP地址:172.18.55.8cpu总核数:1用户空间占用CPU百分比:0.4内核空间占用CPU百分比:0.3空闲CPU百分比:99.3等待输入输出占CPU百分比:0.0CPU中断次数:15CPU上下文切换次数:4CPU15分钟前到现在的负载平均值:0.12CPU5分钟前到现在的负载平均值:0.26CPU1分钟前到现在的负载平均值:average:CPU任务队列长度:3物理内存总量:1883724已使用内存总量(操作系统):294652剩余内存总量(操作系统):333768已使用内存总量(应用程序):0剩余内存总量(应用程序):0交换分区总大小:0已使用交换分区大小:0剩余交换分区大小:0指定设备(/dev/sda)的统计信息每秒向设备发起的读请求次数:每秒向设备发起的写请求次数:向设备发起的I/O请求队列长度平均值每次向设备发起的I/O请求平均时间:向设备发起的I/O服务时间均值:向设备发起I/O请求的CPU时间百分占比:还有很多需要优化的地方,嘿嘿
2021-03-24 01:45 · Linux / 运维
[文章] Linux(CentOS发行版)LAMP配置
背景:电脑是mac,服务器是CentOS6.5==================================这样用起来也方便,mac自带的SSH,FTP都不用安装了,直接使用SSH的sFtp就可以了。连接上会提示欢迎信息的哈!windows可以使用powershell或者ppty之类的支持ssh连接的即可。安装apache直接输入指令:yuminstallhttpdLoadedplugins:securitybase|3.7kB00:00base/primary_db|4.7MB00:04epel|4.3kB00:00epel/primary_db|5.9MB00:05extras|3.4kB00:00extras/primary_db|37kB00:00updates|3.4kB00:00updates/primary_db|3.1MB00:02SettingupInstallProcessResolvingDependencies-->Runningtransactioncheck--->Packagehttpd.x86_640:2.2.15-54.el6.centoswillbeinstalled-->ProcessingDependency:httpd-tools=2.2.15-54.el6.centosforpackage:httpd-2.2.15-54.el6.centos.x86_64-->ProcessingDependency:apr-util-ldapforpackage:httpd-2.2.15-54.el6.centos.x86_64-->Runningtransactioncheck--->Packageapr-util-ldap.x86_640:1.3.9-3.el6_0.1willbeinstalled--->Packagehttpd-tools.x86_640:2.2.15-54.el6.centoswillbeinstalled-->FinishedDependencyResolutionDependenciesResolved================================================================================PackageArchVersionRepositorySize================================================================================Installing:httpdx86_642.2.15-54.el6.centosupdates833kInstallingfordependencies:apr-util-ldapx86_641.3.9-3.el6_0.1base15khttpd-toolsx86_642.2.15-54.el6.centosupdates79kTransactionSummary================================================================================Install3Package(s)Totaldownloadsize:927kInstalledsize:3.1MIsthisok[y/N]:yO不Ok,必须的嘛—>Isthisok[y/N]:y然后又哗啦哗啦地跑了!DownloadingPackages:(1/3):apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm|15kB00:00(2/3):httpd-2.2.15-54.el6.centos.x86_64.rpm|833kB00:00(3/3):httpd-tools-2.2.15-54.el6.centos.x86_64.rpm|79kB00:00--------------------------------------------------------------------------------Total971kB/s|927kB00:00Runningrpm_check_debugRunningTransactionTestTransactionTestSucceededRunningTransactionInstalling:apr-util-ldap-1.3.9-3.el6_0.1.x86_641/3Installing:httpd-tools-2.2.15-54.el6.centos.x86_642/3Installing:httpd-2.2.15-54.el6.centos.x86_643/3Verifying:httpd-tools-2.2.15-54.el6.centos.x86_641/3Verifying:httpd-2.2.15-54.el6.centos.x86_642/3Verifying:apr-util-ldap-1.3.9-3.el6_0.1.x86_643/3Installed:httpd.x86_640:2.2.15-54.el6.centosDependencyInstalled:apr-util-ldap.x86_640:1.3.9-3.el6_0.1httpd-tools.x86_640:2.2.15-54.el6.centosComplete!看到上面这个单词出现,乐坏了,是吧!哈哈,这应该是初中学的吧!完成了!接下来,我们是不是要爽一把呀,启动apache服务器呗!怎么启动呢,看码:servicehttpdstart这种是比较简单的方式,还有一种就是进入配置目录启动,贫僧不喜欢这种:/etc/init.d/httpdstart好吧,不管黑猫白猫,会抓老鼠的就是猫。但是,注意了,哈哈,提示这个,有不有?(可能显示不完,意思一下得了)Startinghttpd:httpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,using【ip地址】forServerName[OK]什么意思呀?我也不知道,嘻嘻。毕竟我是做完英语听力就交卷的人。可能的意思是:开启httpd,然后呢,这玩意思不可以确切地生命域名,所以就用这个Ip地址作为域名。那问题来了,咋整呢?好说,是吧!打开配置文件:cd/etc/httpd/conf切换到上面这个目录,可以ls一下看到如下:httpd.confmagic对,就是这货了,httpd.conf。然后用编辑器打开,用vi就可以了。vihttpd.conf但是一看,太多内容了是吧,上下移动都看不完。那么就进入命令模式查找一下吧::/ServerName按n往下找,找到这一个:#ServerNamewww.example.com:80把前面的#去掉(进入编辑模式删除即可,然后wq保存退出,如果怕自己操作失败的,那么就备份一下吧。),那么你的服务器名称,就是这域名啦,自己起啦!一般来说,我们的apache要随关开机而启动的,所以我们还要做一件事,就是开机启动apachechkconfighttpdon执行完,没消息是吧,没消息就是好消息哈!那么,到这里的话,就安装完了Apache服务器了。Mysql数据库的安装mysql的安装也很简单,安装命令如下:yuminstallmysqlmysql-server提示:Loadedplugins:securitySettingupInstallProcessResolvingDependencies-->Runningtransactioncheck--->Packagemysql.x86_640:5.1.73-7.el6willbeinstalled-->ProcessingDependency:mysql-libs=5.1.73-7.el6forpackage:mysql-5.1.73-7.el6.x86_64--->Packagemysql-server.x86_640:5.1.73-7.el6willbeinstalled-->ProcessingDependency:perl-DBIforpackage:mysql-server-5.1.73-7.el6.x86_64-->ProcessingDependency:perl-DBD-MySQLforpackage:mysql-server-5.1.73-7.el6.x86_64-->ProcessingDependency:perl(DBI)forpackage:mysql-server-5.1.73-7.el6.x86_64-->Runningtransactioncheck--->Packagemysql-libs.x86_640:5.1.73-3.el6_5willbeupdated--->Packagemysql-libs.x86_640:5.1.73-7.el6willbeanupdate--->Packageperl-DBD-MySQL.x86_640:4.013-3.el6willbeinstalled--->Packageperl-DBI.x86_640:1.609-4.el6willbeinstalled-->FinishedDependencyResolutionDependenciesResolved========================================================================================PackageArchVersionRepositorySize========================================================================================Installing:mysqlx86_645.1.73-7.el6base894kmysql-serverx86_645.1.73-7.el6base8.6MInstallingfordependencies:perl-DBD-MySQLx86_644.013-3.el6base134kperl-DBIx86_641.609-4.el6base705kUpdatingfordependencies:mysql-libsx86_645.1.73-7.el6base1.2MTransactionSummary========================================================================================Install4Package(s)Upgrade1Package(s)Totaldownloadsize:12MIsthisok[y/N]:y还是y即可进行下载安装:DownloadingPackages:(1/5):mysql-5.1.73-7.el6.x86_64.rpm|894kB00:00(2/5):mysql-libs-5.1.73-7.el6.x86_64.rpm|1.2MB00:00(3/5):mysql-server-5.1.73-7.el6.x86_64.rpm|8.6MB00:08(4/5):perl-DBD-MySQL-4.013-3.el6.x86_64.rpm|134kB00:00(5/5):perl-DBI-1.609-4.el6.x86_64.rpm|705kB00:00----------------------------------------------------------------------------------------Total1.1MB/s|12MB00:10Runningrpm_check_debugRunningTransactionTestTransactionTestSucceededRunningTransactionUpdating:mysql-libs-5.1.73-7.el6.x86_641/6Installing:perl-DBI-1.609-4.el6.x86_642/6Installing:perl-DBD-MySQL-4.013-3.el6.x86_643/6Installing:mysql-5.1.73-7.el6.x86_644/6Installing:mysql-server-5.1.73-7.el6.x86_645/6Cleanup:mysql-libs-5.1.73-3.el6_5.x86_646/6Verifying:mysql-5.1.73-7.el6.x86_641/6Verifying:mysql-libs-5.1.73-7.el6.x86_642/6Verifying:perl-DBD-MySQL-4.013-3.el6.x86_643/6Verifying:perl-DBI-1.609-4.el6.x86_644/6Verifying:mysql-server-5.1.73-7.el6.x86_645/6Verifying:mysql-libs-5.1.73-3.el6_5.x86_646/6Installed:mysql.x86_640:5.1.73-7.el6mysql-server.x86_640:5.1.73-7.el6DependencyInstalled:perl-DBD-MySQL.x86_640:4.013-3.el6perl-DBI.x86_640:1.609-4.el6DependencyUpdated:mysql-libs.x86_640:5.1.73-7.el6Complete!嗯,安装完成了!欧耶!再爽一把,启动Mysql服务,我只说一种就够了哈,嘻嘻!servicemysqldstart提示:InitializingMySQLdatabase:InstallingMySQLsystemtables...OKFillinghelptables...OKTostartmysqldatboottimeyouhavetocopysupport-files/mysql.servertotherightplaceforyoursystemPLEASEREMEMBERTOSETAPASSWORDFORTHEMySQLrootUSER!Todoso,starttheserver,thenissuethefollowingcommands:/usr/bin/mysqladmin-urootpassword'new-password'/usr/bin/mysqladmin-uroot-hiZuf6innyuqc4mbvq0oycgZpassword'new-password'Alternativelyyoucanrun:/usr/bin/mysql_secure_installationwhichwillalsogiveyoutheoptionofremovingthetestdatabasesandanonymoususercreatedbydefault.Thisisstronglyrecommendedforproductionservers.Seethemanualformoreinstructions.YoucanstarttheMySQLdaemonwith:cd/usr;/usr/bin/mysqld_safe&YoucantesttheMySQLdaemonwithmysql-test-run.plcd/usr/mysql-test;perlmysql-test-run.plPleasereportanyproblemswiththe/usr/bin/mysqlbugscript![OK]Startingmysqld:[OK]另外我们还有一件事,就是这个MySQL的服务,也要在开机的时候启动。所以和前面我们配置Apache的时候,一样设置即可:chkconfigmysqldon不对,是不是差点什么呢?哈哈,密码没有设置,对吧!怎么设置呢,也很简单:mysql_secure_installation提示曰(yue):NOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMySQLSERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY!InordertologintoMySQLtosecureit,we'llneedthecurrentpasswordfortherootuser.Ifyou'vejustinstalledMySQL,andyouhaven'tsettherootpasswordyet,thepasswordwillbeblank,soyoushouldjustpressenterhere.Entercurrentpasswordforroot(enterfornone):意思大概就是说:这个安全设置是为的有的服务设置的,请你认真阅读每一个步骤。为了确保安全,我们需要为root用户录入密码,如果你仅仅安装了MySQL,但是你并没有设置密码,那么,这个密码默认为空的。也就是说,我们直接回车,就可以进入了。直接回车以后提示说:Setrootpassword?[Y/n]yNewpassword:让我们设置新的密码。我们输入密码一次,再确定一次,回车。就可以了。后面还有一些配置,大同小异。直到这里,就完成了:Alldone!Ifyou'vecompletedalloftheabovesteps,yourMySQLinstallationshouldnowbesecure.ThanksforusingMySQL!我们可以测试一下,直接登陆一下mysql数据库:#mysql-uroot-p回车,如下,也就是进入了mysql数据库了。Enterpassword:WelcometotheMySQLmonitor.Commandsendwith;or\g.YourMySQLconnectionidis11Serverversion:5.1.73SourcedistributionCopyright(c)2000,2013,Oracleand/oritsaffiliates.Allrightsreserved.OracleisaregisteredtrademarkofOracleCorporationand/oritsaffiliates.Othernamesmaybetrademarksoftheirrespectiveowners.Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.PHP及相关模块的安装话不多说,直接上:yuminstallphp提示:Loadedplugins:securitySettingupInstallProcessResolvingDependencies-->Runningtransactioncheck--->Packagephp.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:php-common(x86-64)=5.3.3-48.el6_8forpackage:php-5.3.3-48.el6_8.x86_64-->ProcessingDependency:php-cli(x86-64)=5.3.3-48.el6_8forpackage:php-5.3.3-48.el6_8.x86_64-->Runningtransactioncheck--->Packagephp-cli.x86_640:5.3.3-48.el6_8willbeinstalled--->Packagephp-common.x86_640:5.3.3-48.el6_8willbeinstalled-->FinishedDependencyResolutionDependenciesResolved================================================================================PackageArchVersionRepositorySize================================================================================Installing:phpx86_645.3.3-48.el6_8updates1.1MInstallingfordependencies:php-clix86_645.3.3-48.el6_8updates2.2Mphp-commonx86_645.3.3-48.el6_8updates530kTransactionSummary================================================================================Install3Package(s)Totaldownloadsize:3.8MInstalledsize:13MIsthisok[y/N]:直接y即可下载安装:Isthisok[y/N]:yDownloadingPackages:(1/3):php-5.3.3-48.el6_8.x86_64.rpm|1.1MB00:00(2/3):php-cli-5.3.3-48.el6_8.x86_64.rpm|2.2MB00:01(3/3):php-common-5.3.3-48.el6_8.x86_64.rpm|530kB00:00--------------------------------------------------------------------------------Total1.2MB/s|3.8MB00:03Runningrpm_check_debugRunningTransactionTestTransactionTestSucceededRunningTransactionInstalling:php-common-5.3.3-48.el6_8.x86_641/3Installing:php-cli-5.3.3-48.el6_8.x86_642/3Installing:php-5.3.3-48.el6_8.x86_643/3Verifying:php-common-5.3.3-48.el6_8.x86_641/3Verifying:php-cli-5.3.3-48.el6_8.x86_642/3Verifying:php-5.3.3-48.el6_8.x86_643/3Installed:php.x86_640:5.3.3-48.el6_8DependencyInstalled:php-cli.x86_640:5.3.3-48.el6_8php-common.x86_640:5.3.3-48.el6_8Complete!安装相关的模块,这里的话,一次性安装完啦:yuminstallphp-mysqlphp-gdlibjpeg*php-imapphp-ldapphp-odbcphp-pearphp-xmlphp-xmlrpcphp-mbstringphp-mcryptphp-bcmathphp-mhashlibmcrypt提示后直接y就可以往下安装了:Loadedplugins:securitySettingupInstallProcessPackagelibjpeg-turbo-1.2.1-3.el6_5.x86_64alreadyinstalledandlatestversionNopackagephp-mhashavailable.ResolvingDependencies-->Runningtransactioncheck--->Packagelibjpeg-turbo-devel.x86_640:1.2.1-3.el6_5willbeinstalled--->Packagelibjpeg-turbo-static.x86_640:1.2.1-3.el6_5willbeinstalled--->Packagelibmcrypt.x86_640:2.5.8-9.el6willbeinstalled--->Packagephp-bcmath.x86_640:5.3.3-48.el6_8willbeinstalled--->Packagephp-gd.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:libXpm.so.4()(64bit)forpackage:php-gd-5.3.3-48.el6_8.x86_64--->Packagephp-imap.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:libc-client.so.2007()(64bit)forpackage:php-imap-5.3.3-48.el6_8.x86_64--->Packagephp-ldap.x86_640:5.3.3-48.el6_8willbeinstalled--->Packagephp-mbstring.x86_640:5.3.3-48.el6_8willbeinstalled--->Packagephp-mcrypt.x86_640:5.3.3-5.el6willbeinstalled--->Packagephp-mysql.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:php-pdo(x86-64)forpackage:php-mysql-5.3.3-48.el6_8.x86_64--->Packagephp-odbc.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:libodbc.so.2()(64bit)forpackage:php-odbc-5.3.3-48.el6_8.x86_64--->Packagephp-pear.noarch1:1.9.4-5.el6willbeinstalled--->Packagephp-xml.x86_640:5.3.3-48.el6_8willbeinstalled-->ProcessingDependency:libxslt.so.1(LIBXML2_1.0.24)(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libxslt.so.1(LIBXML2_1.0.22)(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libxslt.so.1(LIBXML2_1.0.18)(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libxslt.so.1(LIBXML2_1.0.13)(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libxslt.so.1(LIBXML2_1.0.11)(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libxslt.so.1()(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64-->ProcessingDependency:libexslt.so.0()(64bit)forpackage:php-xml-5.3.3-48.el6_8.x86_64--->Packagephp-xmlrpc.x86_640:5.3.3-48.el6_8willbeinstalled-->Runningtransactioncheck--->PackagelibXpm.x86_640:3.5.10-2.el6willbeinstalled--->Packagelibc-client.x86_640:2007e-11.el6willbeinstalled--->Packagelibxslt.x86_640:1.1.26-2.el6_3.1willbeinstalled--->Packagephp-pdo.x86_640:5.3.3-48.el6_8willbeinstalled--->PackageunixODBC.x86_640:2.2.14-14.el6willbeinstalled-->ProcessingDependency:libltdl.so.7()(64bit)forpackage:unixODBC-2.2.14-14.el6.x86_64-->Runningtransactioncheck--->Packagelibtool-ltdl.x86_640:2.2.6-15.5.el6willbeinstalled-->FinishedDependencyResolutionDependenciesResolved================================================================================PackageArchVersionRepositorySize================================================================================Installing:libjpeg-turbo-develx86_641.2.1-3.el6_5base96klibjpeg-turbo-staticx86_641.2.1-3.el6_5base108klibmcryptx86_642.5.8-9.el6epel96kphp-bcmathx86_645.3.3-48.el6_8updates39kphp-gdx86_645.3.3-48.el6_8updates111kphp-imapx86_645.3.3-48.el6_8updates55kphp-ldapx86_645.3.3-48.el6_8updates43kphp-mbstringx86_645.3.3-48.el6_8updates460kphp-mcryptx86_645.3.3-5.el6epel19kphp-mysqlx86_645.3.3-48.el6_8updates86kphp-odbcx86_645.3.3-48.el6_8updates56kphp-pearnoarch1:1.9.4-5.el6base393kphp-xmlx86_645.3.3-48.el6_8updates108kphp-xmlrpcx86_645.3.3-48.el6_8updates57kInstallingfordependencies:libXpmx86_643.5.10-2.el6base51klibc-clientx86_642007e-11.el6base515klibtool-ltdlx86_642.2.6-15.5.el6base44klibxsltx86_641.1.26-2.el6_3.1base452kphp-pdox86_645.3.3-48.el6_8updates80kunixODBCx86_642.2.14-14.el6base378kTransactionSummary================================================================================Install20Package(s)Totaldownloadsize:3.2MInstalledsize:11MIsthisok[y/N]:yDownloadingPackages:(1/20):libXpm-3.5.10-2.el6.x86_64.rpm|51kB00:00(2/20):libc-client-2007e-11.el6.x86_64.rpm|515kB00:00(3/20):libjpeg-turbo-devel-1.2.1-3.el6_5.x86_64.rpm|96kB00:00(4/20):libjpeg-turbo-static-1.2.1-3.el6_5.x86_64.rpm|108kB00:00(5/20):libmcrypt-2.5.8-9.el6.x86_64.rpm|96kB00:00(6/20):libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm|44kB00:00(7/20):libxslt-1.1.26-2.el6_3.1.x86_64.rpm|452kB00:00(8/20):php-bcmath-5.3.3-48.el6_8.x86_64.rpm|39kB00:00(9/20):php-gd-5.3.3-48.el6_8.x86_64.rpm|111kB00:00(10/20):php-imap-5.3.3-48.el6_8.x86_64.rpm|55kB00:00(11/20):php-ldap-5.3.3-48.el6_8.x86_64.rpm|43kB00:00(12/20):php-mbstring-5.3.3-48.el6_8.x86_64.rpm|460kB00:00(13/20):php-mcrypt-5.3.3-5.el6.x86_64.rpm|19kB00:00(14/20):php-mysql-5.3.3-48.el6_8.x86_64.rpm|86kB00:00(15/20):php-odbc-5.3.3-48.el6_8.x86_64.rpm|56kB00:00(16/20):php-pdo-5.3.3-48.el6_8.x86_64.rpm|80kB00:00(17/20):php-pear-1.9.4-5.el6.noarch.rpm|393kB00:00(18/20):php-xml-5.3.3-48.el6_8.x86_64.rpm|108kB00:00(19/20):php-xmlrpc-5.3.3-48.el6_8.x86_64.rpm|57kB00:00(20/20):unixODBC-2.2.14-14.el6.x86_64.rpm|378kB00:00--------------------------------------------------------------------------------Total2.0MB/s|3.2MB00:01Runningrpm_check_debugRunningTransactionTestTransactionTestSucceededRunningTransactionInstalling:php-pdo-5.3.3-48.el6_8.x86_641/20Installing:libjpeg-turbo-devel-1.2.1-3.el6_5.x86_642/20Installing:libtool-ltdl-2.2.6-15.5.el6.x86_643/20Installing:unixODBC-2.2.14-14.el6.x86_644/20Installing:libc-client-2007e-11.el6.x86_645/20Installing:libmcrypt-2.5.8-9.el6.x86_646/20Installing:libXpm-3.5.10-2.el6.x86_647/20Installing:libxslt-1.1.26-2.el6_3.1.x86_648/20Installing:php-xml-5.3.3-48.el6_8.x86_649/20Installing:php-gd-5.3.3-48.el6_8.x86_6410/20Installing:php-mcrypt-5.3.3-5.el6.x86_6411/20Installing:php-imap-5.3.3-48.el6_8.x86_6412/20Installing:php-odbc-5.3.3-48.el6_8.x86_6413/20Installing:libjpeg-turbo-static-1.2.1-3.el6_5.x86_6414/20Installing:php-mysql-5.3.3-48.el6_8.x86_6415/20Installing:php-bcmath-5.3.3-48.el6_8.x86_6416/20Installing:php-xmlrpc-5.3.3-48.el6_8.x86_6417/20Installing:php-ldap-5.3.3-48.el6_8.x86_6418/20Installing:php-mbstring-5.3.3-48.el6_8.x86_6419/20Installing:1:php-pear-1.9.4-5.el6.noarch20/20Verifying:libjpeg-turbo-static-1.2.1-3.el6_5.x86_641/20Verifying:php-gd-5.3.3-48.el6_8.x86_642/20Verifying:libxslt-1.1.26-2.el6_3.1.x86_643/20Verifying:libXpm-3.5.10-2.el6.x86_644/20Verifying:1:php-pear-1.9.4-5.el6.noarch5/20Verifying:php-mcrypt-5.3.3-5.el6.x86_646/20Verifying:php-imap-5.3.3-48.el6_8.x86_647/20Verifying:php-mbstring-5.3.3-48.el6_8.x86_648/20Verifying:libmcrypt-2.5.8-9.el6.x86_649/20Verifying:libc-client-2007e-11.el6.x86_6410/20Verifying:php-mysql-5.3.3-48.el6_8.x86_6411/20Verifying:libtool-ltdl-2.2.6-15.5.el6.x86_6412/20Verifying:php-ldap-5.3.3-48.el6_8.x86_6413/20Verifying:php-odbc-5.3.3-48.el6_8.x86_6414/20Verifying:unixODBC-2.2.14-14.el6.x86_6415/20Verifying:php-xmlrpc-5.3.3-48.el6_8.x86_6416/20Verifying:php-pdo-5.3.3-48.el6_8.x86_6417/20Verifying:libjpeg-turbo-devel-1.2.1-3.el6_5.x86_6418/20Verifying:php-xml-5.3.3-48.el6_8.x86_6419/20Verifying:php-bcmath-5.3.3-48.el6_8.x86_6420/20Installed:libjpeg-turbo-devel.x86_640:1.2.1-3.el6_5libjpeg-turbo-static.x86_640:1.2.1-3.el6_5libmcrypt.x86_640:2.5.8-9.el6php-bcmath.x86_640:5.3.3-48.el6_8php-gd.x86_640:5.3.3-48.el6_8php-imap.x86_640:5.3.3-48.el6_8php-ldap.x86_640:5.3.3-48.el6_8php-mbstring.x86_640:5.3.3-48.el6_8php-mcrypt.x86_640:5.3.3-5.el6php-mysql.x86_640:5.3.3-48.el6_8php-odbc.x86_640:5.3.3-48.el6_8php-pear.noarch1:1.9.4-5.el6php-xml.x86_640:5.3.3-48.el6_8php-xmlrpc.x86_640:5.3.3-48.el6_8DependencyInstalled:libXpm.x86_640:3.5.10-2.el6libc-client.x86_640:2007e-11.el6libtool-ltdl.x86_640:2.2.6-15.5.el6libxslt.x86_640:1.1.26-2.el6_3.1php-pdo.x86_640:5.3.3-48.el6_8unixODBC.x86_640:2.2.14-14.el6Complete!如果你漏装了,或者没有安装成功个别,可以这样子安装:yuminstallphp-mysql插件的名称好啦,搞定之后重启一下Apache吧!servicehttpdrestart提示:Stoppinghttpd:[OK]Startinghttpd:[OK]cd/var/www/html创建一个文件(touchinfo.php)插入内容(viinfo.php)如下:<?phpechophpinfo();?>访问一下:https://服务器的公网ip/info.php到这里的话,就安装成功了,其他需要的插件,请行脑补哈!
2019-10-21 11:40 · php / lamp / contOS / 后台
  • 1
  • 2
  • 3
  • 4