通哥运维笔记之Linux系统管理问题总结(一)

问题一,

创建新用户xuetong,用该用户登陆报错如下:

[[email protected] ~]# su - xuetong

id: cannot find name for user ID 504

id: cannot find name for group ID 504

id: cannot find name for user ID 504

[I have no [email protected] ~]$

并且显示I have no name!

解决:由于/etc/passwd 和/etc/group两个文件的权限(600)不对造成的,

将passwd和group文件的权限改为644就可以了

chmod 644 /etc/passwd

chmod 644 /etc/group

问题二,

linux下命令行安装KVM虚拟机

#virt-install --name mem1 --hvm --ram 2048 --vcpus 2 --disk path=/opt/vms/os_11.img,size=10 --network network:default --accelerate  --vnc --vncport=5911 --vnclisten=0.0.0.0 --os-variant rhel6 --cdrom /root/CentOS-6.3-x86_64-minimal-EFI.iso -d

报错:qemu-kvm: -drive file=/root/CentOS-6.3-x86_64-minimal-EFI.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /root/CentOS-6.3-x86_64-minimal-EFI.iso: Permission denied

解决:解决:vim /etc/libvirt/qemu.conf

# Some examples of valid values are:

#

# user = "qemu" # A user named "qemu"

# user = "+0" # Super user (uid=0)

# user = "100" # A user named "100" or a user with uid=100

user = "root" (将user前#去掉)

# The group for QEMU processes run by the system instance. It can be

# specified in a similar way to user.

group = "root"(将group前#去掉)

# Whether libvirt should dynamically change file ownership

# to match the configured user/group above. Defaults to 1.

# Set to 0 to disable file ownership changes.

dynamic_ownership = 0(将dynamic_ownership前#去掉)

问题三,通过xshell远程连接linux宿主机安装kvm虚拟机

报错:Cannot open display:

Run ‘virt-viewer --help‘ to see a full list of available command line options

Fri, 05 Sep 2014 18:24:50 DEBUG    Domain state after install: 1

Domain installation still in progress. You can reconnect to

the console to complete the installation process.

解决:通过vnc连接linux宿主机,IP地址+VNC端口号(虚拟机开通的vnc端口号),登录虚拟机安装linux操作系统即可。

问题四,安装apache

报错:configure: error: Cannot use an external APR with the bundled APR-util

报错:checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.

解决:需要安装APR及APR-UTIL

安装APR

# cd srclib/apr

# ./configure --prefix=/usr/local/apr

报错:onfigure: error: in `/usr/local/httpd-2.2.27/srclib/apr‘:

configure: error: no acceptable C compiler found in $PATH

See `config.log‘ for more details

解决:安装gcc依赖包  yum -y install gcc

make && make install 时,报错:

-bash: make: command not found

解决:安装make软件包 yum -y install make

安装apr-util

# cd ../apr-util/

# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

# make

# make install

安装apache

./configure --prefix=/usr/local/apache --enable-deflate --enable-headers --enable-mime-magic --enable-proxy --enable-ssl=static --enable-so --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-mpm=prefork --with-ssl=/usr/local/ssl/include --enable-mods-shared=all

报错:

checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

解决:安装zlib-devel

yum install zlib-devel

报错:no SSL-C headers found

configure: error: ...No recognized SSL/TLS toolkit detected

解决:安装openssl-devel yum install openssl-devel

启动apache /usr/local/apache/bin/apachectl start

报错:httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain for ServerName

解决:更改/usr/local/apache/bin/http.conf中ServerName及/etc/hosts文件中的主机名

安装apr

# cd srclib/apr

# ./configure --prefix=/usr/local/apr

# make

# make install

安装apr-util

# cd ../apr-util/

# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

# make

# make install

# cd ../../

加载全局变量:

echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib " >>/etc/profile

source /etc/profile

安装APACHE

#cd httpd-2.2.21

yum install zlib-devel

./configure --prefix=/usr/local/apache --enable-deflate --enable-headers --enable-mime-magic --enable-proxy --enable-ssl=static --enable-so --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-mpm=prefork --with-ssl=/usr/local/ssl/include --enable-mods-shared=all

#make && make install

#netstat -an | grep :80    //查看linux80端口是否开启

问题五

安装hudson报错:打开http://192.168.1.81:8081/hudson/ 报错ERROR

解决:必须保证java版本和hudson版本对应一致。若Java版本低则会报错。

#ServerName www.example.com:@@[email protected]@

Listen @@[email protected]@

问题六

安装Java报错:

[[email protected] java]# java -version

java version "1.5.0"

gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-4)

Copyright (C) 2007 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

解决:

[[email protected] bin]# rm -f java

[[email protected] usr]# ln -s /usr/java/jdk1.6.0_26/bin/java /usr/bin/java

[[email protected] usr]# java -version

Error occurred during initialization of VM

java/lang/NoClassDefFoundError: java/lang/Object

解决方法:

进入目录:/usr/java/jdk/lib

将tools.pack解压为tools.jar:

unpack200 tools.pack tools.jar

进入目录:/usr/java/jdk/jre/lib

将rt.pack解压为rt.jar:

unpack200 rt.pack rt.jar

问题七

yum的时候报错:

[[email protected] local]# yum -y install wget

Loaded plugins: fastestmirror, presto

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 6 - "Couldn‘t resolve host ‘mirrorlist.centos.org‘"

Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

Error: Cannot find a valid baseurl for repo: base错误

解决方法如下(修改dns配置)

vi /etc/resolv.conf

在此文件中最后加入nameserver 8.8.8.8

如果没有vi编辑器可用

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

更改主机名:

vi /etc/sysconfig/network 修改hostname

HOSTNAME=vm85.bc.com

vi /etc/hosts

127.0.0.1  vm85.bc.com

reboot(必须重启电脑)

时间: 2024-10-01 13:03:58

通哥运维笔记之Linux系统管理问题总结(一)的相关文章

通哥运维笔记之Linux系统管理问题总结(二)

问题八 启动Apache报错: [Sun Dec 27 11:28:26 2009] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "vm85.bc.com″ Configuration Failed 在/etc/hosts中添加: 127.0.0.1 vm85.bc.com 问题九 启动tomcat报错: [[email protected] conf]# serv

通哥运维笔记之Linux下安装JDK

java安装: linux中java的安装步骤: 1,下载jdk1.6.0 链接:wget http://down1.chinaunix.net/distfiles/jdk-6u18-dlj-linux-i586.bin 2,安装jdk: 将jdk下载到相关目录,如:usr/local/ 执行安装:./jdk-6u18-dlj-linux-i586.bin 进入jdk目录:cd /usr/local/jdk1.6.0_18 3,配置java环境变量:vi /etc/profile 在profil

通哥运维笔记之批量刷思科交换机配置模板

hostname PUBLIC-WAN logging buffered 65536 service timestamps debug datetime localtime service timestamps log datetime localtime service password-encryption no ip domain-lookup vtp mode transparent enable secret public errdisable recovery cause pagp-

通哥运维笔记之思科、华为交换机的一些命令

华为交换机配置snmp: snmp-agent community read public snmp-agent sys-info version all 思科交换机配置snmp: snmp-server community snailgame RO 华为交换机配置远程登录: service Telnet enable user-interface vty 0 4 user privilege level 3 set authentication password simple snailgam

运维笔记之Linux系统管理(一)

1,账户管理: 账户的添加: 添加用户名,设置密码(useradd,passwd):添加组(groupadd):将某用户加入某组(usermod -G): 创建用户,并指定主目录(useradd -d ) 将某用户同时添加到两个组(usermod -G group1,group2 user);查看某用户属于某组(groups); 查看group.passwd.shadow.gshadow使用命令:例:cat /etc/grouop或者tail -1(2.3.4...) /etc/group 或者

Linux系统运维笔记(二),Linux文件编辑命令

Linux系统运维笔记 Linux文件编辑命令 首先我们使用命令 vi filename 打开一个文件,这个时候进入到的是命令模式 接下来我们按i,然后键盘随便输入写内容. 然后按ESC重新进入到命令模式. 在命令模式的情况下,我们按:,进入到了末行模式. 输入wq!,然后回车,强行保存退出. q! [强制退出不保存]q[退出不保存]wq[退出并保存后面也可以加个!] vi /etc/centos-release 查看centos系统版本 原文地址:https://www.cnblogs.com

51CTO持续更新《通哥的运维笔记》

<通哥的运维笔记>将持续在51CTO网站更新,希望大家多多关注.互相学习,后期,我将会退出<通哥的运维笔记>系列视频教程,希望带给大家最大的收获,帮助大家更好的学习.进步.<通哥的运维笔记>主要从linux系统管理.虚拟化.cloudstack云平台以及网络管理之CCNA.CCNP.CCIE,等等方面深入讲解.

[转帖]运维必读:Linux 的内存分页管理

运维必读:Linux 的内存分页管理 https://cloud.tencent.com/developer/article/1356431 内存是计算机的主存储器.内存为进程开辟出进程空间,让进程在其中保存数据.我将从内存的物理特性出发,深入到内存管理的细节,特别是了解虚拟内存和内存分页的概念. ▉内存 简单地说,内存就是一个数据货架.内存有一个最小的存储单位,大多数都是一个字节.内存用内存地址(memory address)来为每个字节的数据顺序编号.因此,内存地址说明了数据在内存中的位置.

运维笔记{网络改造}来个照虎画猫!

运维笔记{网络改造}之疯言疯语 话说现有网络环境大概是这样的 ---.100MB联通光纤总带宽---. 连接Cisco 2960交换机--.. -.连接H3C5100路由器x4台----.1/2层各两台(ˇˇ) 想-{每台独立的公网IP做NAT转换} -连接Cisco3560三层交换机x4台-..对应每台路由器-..{交换机之间使用Trunk口连接} -.连接接入层杂牌交换机x8台-.每台3560接两台接入层交换机到桌面交换机-工位. 描述完毕!!! 改造完成环境是那样的呢?   Look看吧