Centos5.5+LAMP环境
Posted maisha
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos5.5+LAMP环境相关的知识,希望对你有一定的参考价值。
1.安装apache
[root@admin-pc mnt]# yum -y install httpd*
2.创建默认index.html页面(默认没有index.html页面)
[root@admin-pc mnt]# vi /var/www/html/index.html
<html>
<body>
this is a test a page for apache
</body>
</html>
3.enable ip访问在配置文件中
[root@admin-pc mnt]# vi /etc/httpd/conf/httpd.conf
ServerName www.example.com:80
4.重新启动 apache服务
[root@admin-pc mnt]# /etc/init.d/httpd stop
[root@admin-pc mnt]# /etc/init.d/httpd start
5.打开浏览器http://192.168.1.11/index.html
#安装mysql
1.[root@admin-pc mnt]# yum -y install mysql mysql-server
2.登录mysql(默认用户名和密码为空)
3.修改用户名和密码为root 123
[root@admin-pc mnt]# mysqladmin -u root -p password 123
4,重新登录mysql
[root@admin-pc mnt]# mysql -uroot -p123
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 67
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;‘ or ‘h‘ for help. Type ‘c‘ to clear the current input statement.
mysql>
#安装 php
1.yum安装php
[root@admin-pc mnt]# yum -y install php*
2.创建index.php页面
[root@admin-pc mnt]# vi /var/www/html/index.php
3.编辑index.php页面
<?php
phpinfo();
?>
4.打开浏览器http://192.168.1.11/index.php
以上是关于Centos5.5+LAMP环境的主要内容,如果未能解决你的问题,请参考以下文章