CentOS 5.5 下面搭建基于LAMP的web环境

来源:岁月联盟 编辑:exp 时间:2011-12-21

 

  因为的买的VPS的,所以系统什么的都已经OK了,只是安装后的东西。基本没有什么软件,所以,要放我的bo-blog博客就要靠自己手工搭建了。

      基本信息:

OS:

[root@localhost ~]# lsb_release -a

LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch

Distributor ID: CentOS

Description:    CentOS release 5.5 (Final)

Release:        5.5

Codename:       Final

     我首先用putty链接上去,注意在Window下的Translation中的Remote charater set的下来菜单中选择UTF-8,然后在链接,否者的话,出现中文的时候,会是乱码。

 

安装LAMP可以采用简单的自动安装:

1. [root@localhost ~]# vi /bin/lamp1.sh

2.在打开的vi里面输入,或者复制如下的安装文件:

yum -y install httpd httpd-devel

yum -y install mysql mysql-server mysql-devel

yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

yum -y install perl

yum -y install mod_python

之后wq保存退出

3.[root@localhost ~]#/bin/sh lamp1.sh

之后开始自动下载安装。。。

 

等全部完成之后:

1.[root@localhost ~]# chkconfig --levels 235 mysqld on    //设置mysql的开机启动

   [root@localhost ~]# chkconfig --levels 235 httpd on       //设置apache的开机启动

2.[root@localhost ~]#/etc/init.d/mysqld start                //启动mysql

[root@localhost ~]#/etc/init.d/httpd start                    //启动apache

    现在启动打开VPS的地址,就可以看到apache的页面了,此时apache已经启动成功了。网页存放的地址是/var/www/html.

摘自 YesCK's Blog