Ubuntu14.04安装apt-get方法Lnmp环境
1.使用root登陸主機(阿里云),執行如下命令:
????sudo apt-get install nginx
????sudo apt-get install php5
????sudo apt-get install php5-fpm
????sudo apt-get install mysql-server ? ? 設置root密碼
????sudo apt-get install phpmyadmin ? ?選擇lighttp這里nginx不是apache2
2.在安裝MySQL時會出現錯誤:
1.1按照阿里官方給的解決辦法如下:
https://help.aliyun.com/knowledge_detail/41124.html?問題依然無法解決
1.2更改ubuntu14.04源升級
vim /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
1.4執行升級命令
apt-get update
3.設置MySQL密碼登陸MySQL查看
4.配置nginx支持php拷貝nginx的vhost模板
1.1:cp /etc/nginx/sites-enabled/default打開如下內容 在root位置添加index.php
1.2:fastcgi_pass 127.0.0.1:9000;方式連接不在使用sock連接
1.3:修改php.ini配置?vim /etc/php5/fpm/php.ini
1.4:使用TCP連接?vim /etc/php5/fpm/pool.d/www.conf?
注釋掉sock
5.從新啟動服務
/etc/init.d/php5-fpm restart
/etc/init.d/nginx restart
6.在nginx的vhost目錄下寫一個phpinfo文件
<?php
phpinfo();
?>
7.還可以通過如下命令查看PHP5支持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
加速器也是一樣
apt-get install php5-XCache
從新啟動服務器
/etc/init.d/php5-fpm restart
/etc/init.d/nginx restart
php5-fpm在使用service調用的時候從新reload和restart會出現不能裝載情況產考如下文章
http://www.tuicool.com/articles/eUzmQv2
Lnmp安裝查考如下文章
http://blog.csdn.net/black_ox/article/details/38232315
轉載于:https://blog.51cto.com/zhangchengjie/1830833
總結
以上是生活随笔為你收集整理的Ubuntu14.04安装apt-get方法Lnmp环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 线程间通讯
- 下一篇: Spring中AOP的两种代理方式(Ja