ubuntu上安装apache2+mysql+php5-fpm(PHP5 - FastCGI Process Manager)
1: 安装mysql
apt-get install mysql-server mysql-client
安装过程中会被问到设置mysql root的密码
New password for the MySQL "root" user: <-- yourrootsqlpassword
Repeat password for the MySQL "root" user: <-- yourrootsqlpassword
2: 安装apache2
apt-get install apache2-mpm-worker
在ubuntu上,Apache的默认document root目录是/var/www,配置文件是/etc/apache2/apache2.conf. 一些附加的文件存在/etc/apache2的子目录中。就像/etc/apache2/mods-enabled是存储Apache modules配置信息的, /etc/apache2/sites-enabled 是存储站点配置信息的,/etc/apache2/conf.d是标准的存储扩展文件的目录,你可以只用这个目录存储附加配置文件。
3:安装php5
apt-get install libapache2-mod-fastcgi php5-fpm php5
php-fpm 是一个守护进程,自启动脚本是/etc/init.d/php5-fpm,它运行一个FastCGI server在9000端口上.
安装完毕后执行下列命令
a2enmod actions fastcgi alias
会看到诸如下列内容
Enabling module actions.
Module fastcgi already enabled
Module alias already enabled
To activate the new configuration, you need to run:
service apache2 restart
这时根据提示,可以运行service apache2 restart,或者 /etc/init.d/apache2 restart 当然你也可以等下面修改完配置文件后再进行重启。
4:配置Apache
vi /etc/apache2/conf.d/php5-fpm.conf
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
</IfModule>
这个是全局的配置,你还可以把这段信息只为你的特定站点进行配置,比如
vi /etc/apache2/sites-available/default,然后在某个你需要的
<VirtualHost></VirtualHost>之间加入它们。
关于这个配置更多的帮助信息参考
http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html#FastCgiExternalServer.
完成之后记得/etc/init.d/apache2 restart 重启使新的配置生效
5:测试你的站点
vi /var/www/info.php
加入如下信息
<?php
phpinfo();
现在我们可以访问下你的站点,就像我的测试站点http://192.168.0.100/info.php。
6:安装PHP对mysql的支持
你可以apt-cache search php5,在列表中查看你需要的支持包, 挑拣那些你需要的安装他们,如:
apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell
php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
安装好后,执行下
/etc/init.d/php5-fpm reload
/etc/init.d/apache2 reload
再访问下你的站点,就像我的测试站点http://192.168.0.100/info.php。新增加的这里应该都有了。
完毕!
ubuntu上安装apache2+mysql+php5-fpm(PHP5 - FastCGI Process Manager)的更多相关文章
- ubuntu上安装nginx+mysql+php5-fpm(PHP5 - FastCGI Process Manager)
题外话:由于近段时间测试环境ssh链路质量不大好,经常短线.故我把整个安装过程放到screen里去执行,以防止断线中断了安装过程.执行screen -S install,这样断线后,只要再执行scre ...
- 在Ubuntu上安装 nginx, MySQL, PHP (LEMP),phpmyadmin和WordPress
0)更新 Apt-Get 终端命令:sudo apt-get update 1) 安装php sudo apt-get install php5 2)安装MySql 终端命令: sudo apt-ge ...
- 在Ubuntu上安装Redis MySQL MongoDB memcached Nginx
1.安装Redis sudo apt-get install redis-server 2.安装MySQL sudo apt-get install mysql-server 3.安装MongoDB ...
- 使用PPA在Ubuntu上安装php5.4~5.6,7
使用PPA在Ubuntu上安装php5.4~5.6,7 sudo apt-get install software-properties-common sudo add-apt-repository ...
- ubuntu上安装mysql 编译安装
为什么要折腾?首先说明的是ubuntu上安装mysql等软件是非常容易简单的,其简单的程度盖过windows上的安装,一句sudo apt-get install就可以搞定.如果想用最简便的方法安装m ...
- Ubuntu上安装MySQL
Ubuntu上安装MySQL非常简单只需要几条命令就可以完成.`````` sudo apt-get update sudo apt-get install mysql-server 会弹出提示,让输 ...
- ubuntu上安装 MySQL 启动/停止 连接MySQL
1.Ubuntu上安装MySQL服务 1.安装服务端 sudo apt-get install mysql-server 2.安装客户端 sudo apt-get install m ...
- ubuntu上安装mysql及导入导出
ubuntu上安装mysql: 1. sudo apt-get install mysql-server 2. apt-get isntall mysql-client3. sudo apt-get ...
- LEMP--如何在Ubuntu上安装Linux、Nginx、MySQL和PHP
简介 LEMP是用来搭建动态网站的一组软件,首字母缩写分别表示Linux.Nginx(Engine-X).MySQL和PHP. 本文将讲述如何在Ubuntu安装LEMP套件.当然,首先要安装Ubunt ...
随机推荐
- [0] C#软件项目版本号的命名规则及格式介绍
版本控制比较普遍的 3 种命名格式 : 一.GNU 风格的版本号命名格式 : 主版本号 . 子版本号 [. 修正版本号 [. 编译版本号 ]] 英文对照 : Major_Version_Number. ...
- scrapy代理的设置
scrapy代理的设置 在我的上一篇文章介绍了scrapy下载器中间件的使用,这里的scrapyIP的代理就是用这个原理实现的,重写了下载器中间件的process_request(self,reque ...
- ecshop调用指定分类和个数的文章列表
举例如首页调用方法: 1.先打开index.php文件找到以下代码: $smarty->assign('new_articles', index_get_new_articles()); // ...
- SVG制作简单的图形
圆形 circle <svg width="200" height="200" > <circle cx="100" cy ...
- 【Android Developers Training】 14. 序言:管理Activity生命周期
注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...
- php生成Excel表格
//引用新建对象<br>require "../phpexcel/Classes/PHPExcel.php"; $excel = new PHPExcel(); 建表格 ...
- Mac之OS系统下搭建JavaEE环境 <三> 之Eclipse 与 IntelliJ IDEA 的安装配置
三.Eclipse 与 IntelliJ IDEA 的安装配置 1.Eclipse的安装配置 1 下载eclipse 到官网 https://www.eclipse.org/downloads/ecl ...
- 阿里云服务器 Windows连接不成功 提示“你的凭证不工作” 解决方法
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control ->Terminal Server -> Wds ...
- Jsp页面用table表格来让文字和文本框对齐
1, border="0" cellpadding="0" cellspacing="20", 第一个是页边距要设置0,第二个是用来指定单元 ...
- springmvc+jdbc连接数据库(第一个微商项目,代理注册)
String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");手动自动生成Uuid ...