Linux通过RPM安装搭建LAMP环境

LAMP就是Linux+Apache+MySQL+PHP搭建的动态网站环境,是目前互联网上非常流行的一个网页服务组合。

网上有很多教程搭建LAMP环境,基本上都是编译安装的,其实对新手来说只需要了解LAMP环境的一些特性,RMP安装相对来说容易上手点,只需要安装几个光盘上的安装包就可以顺利完成LAMP的搭建。

安装Apache

[root@ ~]# rpm -ivh /media/Server/httpd-2.2.3-6.el5.i386.rpm 
warning: /media/Server/httpd-2.2.3-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        libapr-1.so.0 is needed by httpd-2.2.3-6.el5.i386
        libaprutil-1.so.0 is needed by httpd-2.2.3-6.el5.i386
[root@ ~]#

提示需要libapr-1.so.0和libaprutil-1.so.0的支持

安装libapr-1.so.0

[root@ ~]# rpm -ivh /media/Server/apr-1.2.7-11.i386.rpm 
warning: /media/Server/apr-1.2.7-11.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:apr                    ########################################### [100%]

apr-util-1.2.7-6.i386.rpm 需要postgresql-libs的支持

安装libpq.so.4

[root@ ~]# rpm -ivh /media/Server/postgresql-libs-8.1.4-1.1.i386.rpm 
warning: /media/Server/postgresql-libs-8.1.4-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:postgresql-libs        ########################################### [100%]
[root@ ~]#

安装libaprutil-1.so.0

[root@ ~]# rpm -ivh /media/Server/apr-util-1.2.7-6.i386.rpm 
warning: /media/Server/apr-util-1.2.7-6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:apr-util               ########################################### [100%]
[root@ ~]#

安装Apache

[root@ ~]# rpm -ivh /media/Server/httpd-2.2.3-6.el5.i386.rpm 
warning: /media/Server/httpd-2.2.3-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:httpd                  ########################################### [100%]
[root@ ~]#

安装MySql

mysql需要perl(DBI)和perl-DBD-MySQL的支持,因此先安装perl-DBI及perl-DBD-MySQL

perl-DBI安装

[root@ ~]# rpm -ivh /media/Server/perl-DBI-1.52-1.fc6.i386.rpm 
warning: /media/Server/perl-DBI-1.52-1.fc6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:perl-DBI               ########################################### [100%]
[root@ ~]#

perl-DBD-MySQL安装

[root@ ~]# rpm -ivh /media/Server/perl-DBD-MySQL-3.0007-1.fc6.i386.rpm 
warning: /media/Server/perl-DBD-MySQL-3.0007-1.fc6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:perl-DBD-MySQL         ########################################### [100%]
[root@ ~]#

开始安装mysql

[root@ ~]# rpm -ivh /media/Server/mysql-5.0.22-2.1.i386.rpm 
warning: /media/Server/mysql-5.0.22-2.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:mysql                  ########################################### [100%]
[root@ ~]#

安装mysql server

[root@ ~]# rpm -ivh /media/Server/mysql-server-5.0.22-2.1.i386.rpm 
warning: /media/Server/mysql-server-5.0.22-2.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:mysql-server           ########################################### [100%]
[root@ ~]#

初始化MySql数据库

[root@ ~]# mysql_install_db 
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/wyyyxz.html