使用rpm包搭建LAMP(需要LAMP环境时候快速搭建)
来源:互联网 发布:库里20142015数据 编辑:程序博客网 时间:2024/06/03 02:27
(.删除系统中原有的http,mysql,php软件以及默认程序用户然后新建;//开源包最好做此步)
1安装http,mysql,php
[root@localhost.localdomain ~]
# yum install httpd* mysql* php*
Complete!
2启动httpd服务(如有需要可以配置域名)
# /etc/init.d/httpd start
正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[确定]
3启动mysqld服务(有一个初始化数据库的过程,如有需要可以设置密码)
[root@localhost.localdomain ~]
# /etc/init.d/mysqld start
初始化 MySQL 数据库: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[确定]
正在启动 mysqld: [确定]
4将index.php后台首页写入httpd的配置文件中并且重新启动httpd
[root@localhost.localdomain ~]
# vim /etc/httpd/conf/httpd.conf
DirectoryIndex index.html index.html.var index.php
[root@localhost.localdomain /usr]
# /etc/init.d/httpd restart
停止 httpd: [确定]
正在启动 httpd: [确定]
5测试httpd与php协同工作(编写test.php文件)
[root@localhost.localdomain /usr]
# vim /var/www/html/test.php //在网页根目录下创建
<?php
phpinfo();
?>
# vim /etc/httpd/conf/httpd.conf
访问http://SRV/test.php
6测试httpd,mysqld与php协同工作(编写testsql.php文件)
[root@localhost.localdomain /usr]
# vim /var/www/html/test.php
<?php
$link= mysql_connect('localhost','root','');
if($link) echo "connect successfully";
mysql_close();
?>
[root@localhost.localdomain /usr]
# /etc/init.d/httpd restart
停止 httpd: [确定]
正在启动 httpd: [确定]
[root@localhost.localdomain /usr]
# /etc/init.d/mysqld restart
停止 mysqld: [确定]
正在启动 mysqld: [确定]
访问http://SRV/testsql.php
- 使用rpm包搭建LAMP(需要LAMP环境时候快速搭建)
- LAMP LAMP环境搭建【rpm】+ 实例应用
- Lamp环境快速搭建
- lamp环境快速搭建
- 使用yum快速搭建LAMP环境
- Linux通过RPM安装搭建LAMP环境
- 使用rpm包安装lamp环境
- centos6.3(6.5)系统使用yum快速搭建lamp环境
- centos系统使用yum快速搭建lamp环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- CentOS 6.5使用yum快速搭建LAMP环境
- LAMP环境搭建(ubuntu)
- LAMP(ftp)环境搭建
- 平时开发搜集的一些网址
- 一次谷歌面试趣事
- lambda表达式
- 我是怎样做出夜撩的效果??
- @RequestMapping 用法详解之地址映射
- 使用rpm包搭建LAMP(需要LAMP环境时候快速搭建)
- Java引用类型
- python学习之---mutable and immutable
- Failed to sync Gradle project '项目名称(module)' Error:failed to find Build Tools revision 20.1.2
- Kindeditor文本编辑器基本配置
- UITableView的一些操作
- [开发笔记]-分享一些励志的话
- android WebView全面总结
- 网卡MAC地址相关信息大全