ubuntu lnmp环境搭建

安装依赖

apt-get install gcc libpcre3 libpcre3-dev libxml2 libxml2-dev build-essential openssl libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev libgd-dev libxslt-dev autoconf

mysql数据库(1,2,3可忽略)

1 wget http://repo.mysql.com//mysql-apt-config_0.7.3-1_all.deb
2 dpkg -i mysql-apt-config_0.7.3-1_all.deb
3 apt-get update
4 apt-get install mysql-server
5 service mysql status
6 service mysql start / stop /restart
note:修改配置
         my.cnf bind-address
     修改密码 
         mysqladmin -u root -p password hufeng
     查询用户 
         SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user; 
     添加用户
         CREATE USER 'username' IDENTIFIED BY 'password';     
     远程访问
         GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
         FLUSH PRIVILEGES;
          

nginx

1 wget http://nginx.org/download/nginx-1.11.1.tar.gz
2 ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module
3 make && make install
4 cp /usr/local/nginx/sbin/nginx /usr/local/bin/
5 nginx  , nginx -s reload / stop

php

1 wget http://php.net/distributions/php-7.0.7.tar.gz
2 tar -zxvf php-7.0.7.tar.gz
3 ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc  --with-pear  --with-pdo-mysql --with-mysqli --enable-libxml --enable-soap --enable-zip --enable-shmop --enable-mbstring --enable-sockets --with-mcrypt --with-gd --with-jpeg-dir --with-png-dir --enable-fpm --with-curl --with-freetype-dir --with-openssl --enable-pcntl --with-zlib --enable-bcmath
4 make && make install
5 cp php.ini-development /usr/local/php7/etc/php.ini
6 cp /usr/local/php7/etc/php-fpm.conf.default php-fpm.conf
7 cp /usr/local/php7/sbin/php-fpm /usr/local/bin/ ; cp /usr/local/php7/bin/php /usr/local/bin/; cp /usr/local/php7/bin/php-config /usr/local/bin/; cp /usr/local/php7/bin/phpize /usr/local/bin/
8 打开 php.ini:  定位到 cgi.fix_pathinfo= 并将其修改为:cgi.fix_pathinfo=0
9 修改 php-fpm.conf 配置文件,确保 php-fpm 模块使用 www-data 用户和 www-data 用户组的身份运行
vim /usr/local/etc/php-fpm.conf
user = www-data
group = www-data
常用命令 php --ini,php -m,php-fpm,kill -USR2 xxxx(重启php-fpm)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值