lnmp 环境搭建 源代码包安装 linux,nginx,mysql,php
程序员文章站
2022-04-26 18:27:33
...
环境:contos 6.5
安装php脚本:
安装nginx脚本(包含echo 和 realip 模块 ):
说明:
源代码目录:/data/software/soft
安装目录:/usr/local/webserver/
源代码包: http://pan.baidu.com/s/1kTy3UXh
准备:
yum -y install gcc automake autoconf libtool make yum -y install gcc gcc-c++ glibc yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-de vel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb 5 krb5-devel libidn libidn-devel openssl openssl-devel
安装php脚本:
spath=/data/software/soft cd ${spath} tar zvxf php-5.6.9.tar.gz cd php-5.6.9 webpath=/usr/local/webserver ./configure --prefix=${webpath}/php --enable-fpm --with-openssl --with-mcrypt --enable-mbstring --with-curl --disable-debug --disable-rpa th --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex -- with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir make all install
安装nginx准备,安装zlib,openssl,pcre 脚本:
spath=/data/software/soft cd ${spath} tar -xzvf pcre-8.34.tar.gz tar -xzvf openssl-1.0.1c.tar.gz tar -xzvf zlib-1.2.8.tar.gz cd ${spath}/zlib-1.2.8 ./configure make && make install cd ${spath}/openssl-1.0.1c ./config ./config -t make && make install cd ${spath}/pcre-8.34 ./configure make make install
安装nginx脚本(包含echo 和 realip 模块 ):
webpath=/usr/local/webserver spath=/data/software/soft cd ${spath} tar xzvf nginx-1.4.2.tar.gz tar xzvf echo-nginx-module-0.57.tar.gz cd nginx-1.4.2 ./configure --sbin-path=${webpath}/nginx/nginx --conf-path=${webpath}/nginx/nginx.conf --pid-path=${webpath}/nginx/nginx.pid --with-http_ssl_ module --with-pcre=${spath}/pcre-8.34 --with-zlib=${spath}/zlib-1.2.8 --with-openssl=${spath}/openssl-1.0.1c --add-module=/data/software/soft /echo-nginx-module-0.57 --with-http_realip_module make && make install安装mysql脚本
yum install ncurses-devel groupadd mysql useradd -r -g mysql mysql spath=/data/software/soft cd ${spath} tar zvxf mysql-5.6.16.tar.gz cd mysql-5.6.16 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql -DMYSQL_UNIX_ADDR=/usr/local/webserver/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFA ULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATA DIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 make && make install chown mysql.mysql -R /usr/local/webserver/mysql chown mysql.mysql -R /data/mysqldb /usr/local/webserver/mysql/scripts/mysql_install_db --user=mysql --datadir=/data/mysqldb cp /usr/local/webserver/mysql/support-files/my-default.cnf /etc/my.cnfmysql相关操作
cp support-files/mysql.server /etc/init.d/mysqld vim /etc/profile //加入到$PATH中 PATH=/usr/local/webserver/mysql/bin:/usr/local/webserver/mysql/lib:$PATH export PATH source /etc/profile //使生效 service mysqld start //启动mysql chkconfig --level 35 mysqld on //设置开机启动 netstat -tulnp | grep 3306 //查看端口 mysql -u root -p //登录 mysqladmin -u root password '123456' //设置密码
以上就介绍了lnmp 环境搭建 源代码包安装 linux,nginx,mysql,php,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
推荐阅读
-
通过虚拟机如何源码安装LNMP开发环境(virtualbox+ubuntu+nginx+mysql+php)???
-
linux下apache+mysql+php开发环境纯源代码编译搭建
-
LNMP小项目搭建,Centos7.6环境搭建Linux+nginx+mysql+php,wordpress个人博客的搭建(完整搭建步骤)
-
centos下yum搭建安装linux+apache+mysql+php环境教程
-
Centos 6.8编译安装LNMP环境(Nginx+MySQL+PHP)教程
-
centos7利用yum安装lnmp的教程(linux+nginx+php7.1+mysql5.7)
-
linux下安装nginx+php+mysql环境 详细教程
-
Linux系统下搭建MantisBT环境以及Apache+PHP+MySql的安装
-
LNMP服务器环境配置 (linux+nginx+mysql+php)
-
Ubuntu 18.04.1 下快速搭建 LNMP环境(PHP7.2.5+MySql5.7+Nginx1.14.0)