httpd安装以及在线包地址

http://mirror.centos.org/centos/6/os/x86_64/Packages/

安装apache
httpd-2.2.15-5.el6.centos.i686.rpm   F
提示:
error: Failed dependencies:

/etc/mime.types is needed by httpd-2.2.15-5.el6.centos.i686

apr-util-ldap is needed by httpd-2.2.15-5.el6.centos.i686

httpd-tools = 2.2.15-5.el6.centos is needed by httpd-2.2.15-5.el6.centos.i686

libapr-1.so.0 is needed by httpd-2.2.15-5.el6.centos.i686

libaprutil-1.so.0 is needed by httpd-2.2.15-5.el6.centos.i686
然后就安装提示的rpm
apr-util-ldap-1.3.9-3.el6.i686.rpm   C
提示错误
error: Failed dependencies:

apr-util = 1.3.9-3.el6 is needed by apr-util-ldap-1.3.9-3.el6.i686


然后就安装apr-util-1.3.9-3.el6.i686.rpm   B
提示:
error: Failed dependencies:

libapr-1.so.0 is needed by apr-util-1.3.9-3.el6.i686

然后安装(   libapr-1.so.0 属于 apr-1.3.9-3.el6.i686.rpm)
安装

apr-1.3.9-3.el6.i686.rpm   A
这个时候安装apache提示错误

error: Failed dependencies:

/etc/mime.types is needed by httpd-2.2.15-5.el6.centos.i686

httpd-tools = 2.2.15-5.el6.centos is needed by httpd-2.2.15-5.el6.centos.i686
其中需要先安装

mailcap-2.1.31-1.1.el6.noarch.rpm   D

安装
httpd-tools-2.2.15-5.el6.centos.i686.rpm   E

Apache安装到此结束

启动apache
service httpd start
提示
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for Centos

httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

这个时候需要修改配置文件
Vi /etc/httpd/conf/httpd.conf
搜索ServerName然后在下面加上
ServerName 192.168.81.133#其中这ip是你虚拟机中linux的ip

这个时候在物理机上输入192.168.81.133就可以看到你的虚拟机中的网站了(先关闭了防火墙,service iptables stop)

附注:其中rpm后面的字母表示安装序号

安装PHP

1. 安装php
php-5.3.2-6.el6.i686.rpm(第四个安装)
提示:
error: Failed dependencies:

php-cli = 5.3.2-6.el6 is needed by php-5.3.2-6.el6.i686

php-common = 5.3.2-6.el6 is needed by php-5.3.2-6.el6.i686

2. 安装
php-cli-5.3.2-6.el6.i686.rpm(第三个安装)
提示:
error: Failed dependencies:

libedit.so.0 is needed by php-cli-5.3.2-6.el6.i686

php-common = 5.3.2-6.el6 is needed by php-cli-5.3.2-6.el6.i686

3. 安装
libedit-2.11-4.20080712cvs.1.el6.i686.rpm (第一个安装)

4. 安装
php-common-5.3.2-6.el6.i686.rpm (第二个安装)

在var/www/html目录下放入index.php文件
index.php文件内容如下
<?php

echo phpinfo();

?>

安装mysql

安装MYSQL

1)先需要安装如下perl(使用rpm -ivh –nodeps 包名)
perl-Pod-Escapes-1.04-119.el6_1.1.i686

perl-Pod-Simple-3.13-119.el6_1.1.i686

perl-devel-5.10.1-119.el6_1.1.i686

perl-BSD-Resource-1.29.03-3.el6.i686

perl-DBD-MySQL-4.013-3.el6.i686

perl-libs-5.10.1-119.el6_1.1.i686

perl-Module-Pluggable-3.90-119.el6_1.1.i686

perl-5.10.1-119.el6_1.1.i686

perl-Test-Harness-3.17-119.el6_1.1.i686

perl-ExtUtils-ParseXS-2.2003.0-119.el6_1.1.i686

perl-Newt-1.08-26.el6.i686

mod_perl-2.0.4-10.el6.i686

perl-version-0.77-119.el6_1.1.i686

perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.i686

perl-DBI-1.609-4.el6.i686

2、安装
mysql-5.1.47-4.el6.i686.rpm

然后安装
mysql-server-5.1.47-4.el6.i686.rpm

你可能感兴趣的:(apache)