centos7 설치 php7.3의 mysql5.6의 nginx1.6

centos7 설치 php7.3의 mysql5.6의 nginx1.6


첫 번째 단계의 nginx를 설치합니다

냠 lrzsz 지퍼 압축 해제 wget과 나무 자식 dpkg를 PCRE PCRE-(STABLE)하려면 openssl하려면 openssl-(STABLE)의 GD-(STABLE) ZLIB-(STABLE) GCC EPEL 릴리스 설치 -y

wget을 -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo &>을 / dev / null

냠 repolist

얌 모든 청소

SED -I 'S / SELINUX = ^. * $ / SELINUX가 비활성화 = / g'은 / etc / SELinux에 / 설정 

wget을 http://nginx.org/download/nginx-1.16.0.tar.gz

nginx를 타르 -xf 1.16.0.tar.gz 

CD를 nginx를-1.16.0

은 useradd -s / sbin에 / nologin으로 -M의 nginx

./configure를 --prefix = / usr / 지방 / Nginx에 --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-PCRE --with-http_gzip_static_module --with-http_dav_module --with-http_addition_module - 와 - http_sub_module --with-http_flv_module --with-http_mp4_module

만들 && 설치하기

LN -sV / usr / 지방 / Nginx의 경우 / sbin / nginx를은 / usr / sbin에 / Nginx에

nginx를 

SS의 -ntl

nginx를 시작 스크립트

정력 /etc/init.d/nginx

#! / 빈 / bash는


#의 chkconfig를 : - 99 2


# 설명 : Nginx의 서비스 제어 스크립트


PROG = "/ usr / 지방 / Nginx의 경우 / sbin / nginx를"


PIDF = "/ usr / 지방 /의 nginx / 로그 / nginx.pid"


경우 "$ 1"에서


        스타트)


        $ PROG


        ;;


        중지)


        죽일 -3 $ (고양이 $ PIDF)


        ;;


        재시작)


        $ 0 정지 &>을 / dev / null


        [$ 경우? -ne 0]; 다음 계속; Fi를


        $ 0 시작


        ;;


        다시로드)


        죽일 -1 $ (고양이 $ PIDF)


        ;;


        *)

에코 "Userage을 : $ 0 번 다시로드 | 중지 | 시작 |를 다시 시작}"


        1 번 출구


ESAC


종료 0


chmod를 + X /etc/init.d/nginx 

chkconfig를 --add의 nginx

chkconfig를 --list

의 nginx에 chkconfig가




두 번째 단계는 설치 php7.3

냠의 bzip2의 bzip2-(STABLE) libcurl에-DEV libcurl에-DEV 컬-(STABLE) PostgreSQL의-(STABLE)의 libxslt를-(STABLE)을 설치

냠 libzip 제거

CD / usr / 지방 / src에

wget을 https://nih.at/libzip/libzip-1.2.0.tar.gz

타르 -xf libzip-1.2.0.tar.gz

CD를 libzip - 1.2.0

./configure를

만들 && 설치하기


# 구성 파일에 검색 경로를 추가


에코 '/ usr / 지방 / lib64에


를 / usr / local / lib로


는 / usr / lib 디렉토리


/usr/lib64'>>/etc/ld.so.conf


 그런 다음 구성 번호를 업데이트


ldconfig를 -v


wget을 https://www.php.net/distributions/php-7.3.8.tar.gz

타르 -xf PHP-7.3.8.tar.gz 

CD를 PHP-7.3.8

./configure를 --prefix = / usr / 지방 / PHP --sysconfdir = / usr / 지방 / PHP / 등 --with-구성 파일 경로 = / usr / 지방 / PHP은 / etc / --with-fpm- 사용자 = PHP-FPM --with-FPM 그룹 = PHP-FPM --enable-FPM --with-PDO-pgSQL의 --with-ZLIB-DIR-FreeType에서 --with-DIR --enable-mbstring --with -libxml-DIR = / USR --enable 비누 --enable 캘린더 --with 컬 --with-GD --disable-RPATH --enable 인라인 최적화 --with-BZ2---with ZLIB - -enable-소켓 --enable-SYSVSEM --enable-SYSVSHM --enable-pcntl --enable-mbregex --enable-EXIF --enable-bc 수학 --with-mhash --enable 지퍼 --with-pcre- 정규식 PDO --with - 투 - MySQL --with-mysqli --with-JPEG-DIR = / USR --with-PNG-DIR = / USR --with-의 openssl --with-LIBDIR = / LIB / x86_64에 리눅스 -gnu / --enable-FTP --with-gettext에 --with-XSL --enable-opcache --with-의 iconv --with-XPM-DIR = / USR-XMLRPC --with

만들 && 설치하기

CP /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

만들 && 설치하기

CP는 php.ini 생산 /usr/local/php/etc/php.ini

CP /usr/local/src/php-7.3.8/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

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

CP /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

chmod를 755 /etc/init.d/php-fpm

chkconfig를 --add PHP-FPM

에 chkconfig를 PHP는 - FPM

chkconfig를 --list

LN -s / usr / 지방 / PHP / 빈 / PHP는 / usr / sbin에 / php에

PHP는 -v

서비스 PHP-FPM 시작


PHP 최적화

문자를 코멘트 : 최신 버전 사용을 완전히되었습니다; 주석

# : 순수 주석

; 코멘트 지시어를 가능하게 할 수 있습니다


정력 /usr/local/php/etc/php.ini

max_execution_time이라는 = 30 최대 실행 시간 30

memory_limit를 128M 생산은 충분히 조절이 크지 않다

디버깅 오프 display_errors를가 열리지 않습니다, 또는 중요한 정보에 노출 될 수 있습니다

제안 된 폐쇄 해제 display_startup_errors

post_max_size을 8M 최대 업로드 데이터 크기는 생산은 다음 항목보다 큰, 일시적으로 전송 클 수 있습니다

2M 최대 업로드 파일이 upload_max_filesize, 당신은 큰 생산을 전환 할 수 있습니다

동시 업로드 파일 max_file_uploads = 20 최대 개수

date.timezone = 아시아 / 상하이 지역 지정하면

short_open_tag = 같은 오픈 짧은 태그에 <은 phpinfo ();?>



세 번째 단계는 mysql5.6를 설치하는 것

wget을 http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

 RPM -ivh MySQL의 - 커뮤니티 - 릴리스 el7-5.noarch.rpm

 냠 MySQL의 서버를 설치

 의 rpm -qa | 그렙 mysql을

 mysqld.service을 시작 systemctl 

 SS의 -ntl

 mysqld를 가능 ystemctl

 

암호를 설정합니다.


설치가 완료되면 Mysql5.6, 우리는 적시에 필요 루트 MySQL의의 (첫번째 직접 암호를 입력하지 않음), 변경 비밀번호로 로그인, 루트 암호는 기본적으로 비어 있습니다.


# mysql을 -u 루트

MySQL의> 사용 MySQL은,

MySQL의> 업데이트 사용자가 설정 한 암호 = PASSWORD ( '루트 암호를 여기에 입력 ") 여기서 사용자 ='루트 ';

MySQL의> 플러시 특권; 


원격 로그인 설정

MySQL의>에있는 모든 권한을 부여 * * '사용자 이름'@ '%'를 '비밀번호'로 식별합니다.;














추천

출처blog.51cto.com/13293070/2433215