centos lnmp 安装笔记

 
 
   

sudo apt-get install nginx mysql-server build-essential libxml2-dev libreadline6 libreadline6-dev openssl libssl-dev curl libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev

 

 


[root@host]# chkconfig nginx on [root@host]# service nginx start [root@host]# service nginx stop [root@host]# service nginx restart [root@host]# service nginx status
[root@host]# service nginx reload

Cenos 7.0

yum -y install mariadb-server mariadb
systemctl start mariadb

yum -y install mariadb-server mariadb

systemctl start mariadb

 

sudo yum install epel-release

sudo yum install nginx

sudo systemctl start nginx

 

 

//修改密码

UPDATE user SET password=PASSWORD('123456') WHERE user='root';

FLUSH PRIVILEGES;

 

 

  1. yum install wget gcc gcc-c++ make re2c curl curl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel libmcrypt libmcrypt-devel zlib zlib-devel openssl openssl-devel freetype freetype-devel gd gd-devel perl perl-devel ncurses ncurses-devel bison bison-devel libtool gettext gettext-devel cmake bzip2 bzip2-devel pcre pcre-devel
 
./configure --prefix=/usr/local/php  --enable-fpm --enable-sockets --with-mcrypt --enable-mbstring --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex  --with-mhash --enable-zip --with-pcre-regex --with-png-dir=/extra_disk/pkg/libpng-1.6.21 --with-gd --with-pdo-mysql --enable-pdo --with-openssl --with-freetype-dir=/usr/include/freetype2/freetype/ --with-zlib-dir=/extra_disk/pkg/zlib-1.2.8 --with-jpeg-dir=/extra_disk/pkg/jpeg-6b


PHP Setup

./configure --prefix=/usr/local/php  --enable-fpm --enable-sockets --enable-mbstring --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex  --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-gd --with-pdo-mysql --enable-pdo --with-openssl --with-freetype-dir=/usr/include/freetype2/freetype/ --with-zlib-dir=/extra_disk/package/zlib-1.2.8 --with-jpeg-dir=/extra_disk/package/jpeg-6b --with-pdo-oci=instantclient,/usr,11.2.0.3.0

 

[root@host]# make

[root@host]# make install

 

 

 

 

 

 

ubuntu

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --enable-sockets --with-mcrypt --enable-mbstring --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2 --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex  --with-mhash --enable-zip --with-pcre-regex --with-gd --with-pdo-mysql --enable-pdo --with-openssl

groupadd www
useradd -g www www

 

vi /usr/local/php/etc/php-fpm.conf

user = www

group = www

 

 

sudo apt-get install sysv-rc-conf

sysv-rc-conf php-fpm on

sysv-rc-conf nginx on

sysv-rc-conf mysql on

 

 

 

解决办法

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

 

cd php 7.0 sapi/fpm/

cp www.conf /usr/local/php/etc/php-fpm.conf

cp php.ini-production /usr/local/php/lib/php.ini 

 

/usr/local/php/bin/php -i | grep "Loaded Configuration File"

[root@host]# cd sapi/fpm/
[root@host]# cp init.d.php-fpm /etc/init.d/php-fpm

[root@host]# chmod 755 /etc/init.d/php-fpm

[root@host]# /etc/init.d/php-fpm start

[root@host]# /sbin/chkconfig --add /etc/init.d/php-fpm --(添加到开机服务列表)

[root@host]# /sbin/chkconfig php-fpm on

php-fpm的启动、停止和重启:

[root@host]# /etc/init.d/php-fpm start

[root@host]# /etc/init.d/php-fpm stop


打开80端口必须输入以下

[root@host]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

[root@host]# service iptables save

[root@host]# service iptables restart

 

insert into user(Host,User,Password)values("localhost","test",password("123456"));

flush privileges;


grant all privileges on hsker.* to 'test'@'%' identified by '123456';


flush privileges;

update user set host = '%' where user = 'test';

 

MySQL Daemon failed to start  

chmod 777 -R /var/lib/mysql;

yum install ibus-table-wubi.noarch

 

 

 

#显示当前网络连接
#nmcli connection show
NAME UUID TYPE DEVICE
eno1 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet eno1

#修改当前网络连接对应的DNS服务器,这里的网络连接可以用名称或者UUID来标识
#nmcli con mod eno1 ipv4.dns "114.114.114.114 8.8.8.8"

#将dns配置生效
#nmcli con up eno1

转载于:https://www.cnblogs.com/ytjjyy/p/3755275.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值