首页 > 系统服务 > 详细

Use apt-get install lNMP env on Ubuntu

时间:2015-10-27 15:31:26      阅读:266      评论:0      收藏:0      [点我收藏+]

0x00, remove the default apache  and  mysql

#> apt-get remove apache2
#> apt-get autoremove apache2-bin
#> apt-get autoremove apache2

#> apt-get --purge remove apache-common

#> rm  -R  /var/lib/mysql/

#> rm  -R  /etc/mysql/

#> apt-get autoremove mysql* --purge

0x01, update the software source

#> apt-get update                     // update the system

#> apt-get upgrade                  //  update the software package

0x02, install chkconfig   Notice: this step is not must be!

#> apt-get install chkconfig

or use this command

#> apt-get install sysv-rc-conf

0x03, install Nginx

#> apt-get install nginx

#> service nginx start

0x04, install Mysql

#> apt-get install mysql-server-5.6  mysql-client-5.6

###---------- only do this if u want to change the data_dir ------------##

#> sudo service mysql stop

#> sudo vim /etc/mysql/my.cnf                // configure the mysql, set it‘s  data_dir  and base_dir  if  u need.  i  change the data_dir to /data0/mysql

#> cd /data0

#> sudo cp -R  /var/lib/mysql  ./      

#> sudo chown -R mysql:mysql mysql/

#> sudo chmod -R 700 mysql/

#> sudo service mysql start

#> vim  /etc/apparmor.d/usr.sbin.mysqld    // if start faild, please check the mysql.err.log and maybe u need to change this file

>>>> change like this:

#/var/lib/mysql/ r,
#/var/lib/mysql/** rwk,
/data0/mysql/ r,
/data0/mysql/** rwk,

#> sudo service mysql start

###---------- only do this if u want to change the data_dir ------------##

0x05, install php-fpm

#> apt-get install php5-fpm

0x06, install php extension

#> apt-get install php5-curl  php5-gd  php5-memcached  php5-mysql php5-xdebug  php5-mcrypt  php5-common  php5-json  php5-dev 


Use apt-get install lNMP env on Ubuntu

原文:http://my.oschina.net/u/1156660/blog/522651

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!