Just want to summarize a installation environment document, because many problems of the document is also many, summarize a copy of their own installation documentation!
First of all, environment centos7,linux environment!
1, network configuration, cloud Server No!
VI/ETC/SYSCONFIG/NETWORK-SCRIPTS/,CENTOS7 will automatically generate a configuration file, modify the configuration file
2, install the Nginx (12.0) (after the configuration can be a third-party tool link knocking command)
Download Nginx installation package, upload the host!
Install the dependency package required by Nginx
Yum install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel OpenSSL openssl-devel
Nginx configuration, parsing php:/usr/local/nginx/conf/nginx.conf, HTTP inside the file configuration
If the problem occurs: file is not found! Solve:
# Fastcgi_param Script_filename Script$fastcgi_script_name
Switch
Fastcgi_param script_filename /usr/local/nginx/html$fastcgi _script_name; #指定路径
Server {Listen80; server_name server_domain_name_or_ip; Location/{root/usr/share/nginx/html; Index index. PHP index.html Index.htm; } error_page404/404.html; #Redirect Server error pages to the static page/50x.htmlError_page 502 503 504/50x.html; Location=/50x.HTML {root/usr/share/nginx/html; } #Change nginx config file to identify PHPLocation ~ \.php$ {root/usr/share/nginx/html; Try_files$uri= 404; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index Index.PHP; Fastcgi_param Script_filename$document _root$fastcgi_script_name; includeFastcgi_params; } }
Problem 1:yum problem, environment is not the same as whether the Yum source is finished
11. First create a directory under the/media directory CDROM and attach the disc to the system/media/CDROM under2 mkdir/media/CDROM3mount/dev/cdrom/media/cdrom/4 52, enter into the/ETC/YUM.REPOS.D directory centos-base.repo Rename. 6 7Cd/etc/yum.repos.D8MV Centos-base.repo Centos-base.repo.Bak9 TenNew File VI Centos-media.Repo One A Add the following content - #Centos-media.repo - # the[c6-Media] -name=centos-$releasever-Media -Baseurl=file:///media/cdrom -Gpgcheck=0 +Enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 + A #If you don't need gpgcheck, you can have gpgcheck=0, and then comment out the last line. at3. Link all CentOS installation packages to/media/CentOS - -Ln-s/media/cdrom/centos//media/centos
Issue 2: Compiler C or GCC issues, FIX: Try a lot, the best solution is to install the compiler
Yum-y install gcc gcc-c++ autoconf automake make
3. PHP Installation
Dependent Package Installation:
Yum install-y php php-devel php-fpm php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc ph P-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel
Open PHP-FPM:
## boot auto start
4, install MARIADB (MySQL high version)
1, installing the MARIADB installation command Yum-Y Install mariadb mariadb-after the server installation is complete MARIADB, first start mariadbsystemctl start mariadb set boot start systemctl enable MARIADB the related simple configuration mariadb next Mysql_ Secure_installation the first is to set the password, you will be prompted to enter the password enter CurrentPassword forRoot (enter forNone):<– First run direct carriage return set password set root password? [y/n] <– whether to set the root user password, enter Y and return or direct enterNewPassword: <– Set password for root user re-enterNewPassword: <– Enter again the password you set other configuration remove anonymous users? [y/n] <– whether to delete anonymous users, enter disallow root login remotely? [y/n] <– whether root login is forbidden, enter,Remove test database and access to it? [y/n] <– whether to delete the test database, enter reload privilege tables now? [y/n] <– whether to reload the permissions table, enter initialization mariadb complete, and then test the loginMySQL-uroot-Ppassword completed. 2, configuring the mariadb character Set file/etc/my.Cnfvi/etc/my.CNF adds Init_connect under the [Mysqld] tab= ' SET collation_connection = Utf8_unicode_ci 'Init_connect= ' SET NAMES UTF8 'character-set-server=UTF8 Collation-server=utf8_unicode_ci Skip-character-set-client-Handshake File/etc/my.cnf.d/client.Cnfvi/etc/my.cnf.d/client.CNF added in [client]default-character-set=UTF8 file/etc/my.cnf.d/MySQL-clients.Cnfvi/etc/my.cnf.d/MySQL-clients.CNF in [MySQL], adddefault-character-set=UTF8 All configuration complete, restart Mariadbsystemctl restart mariadb after entering mariadb view character SetMySQL> Show variables like "%character%", show variables like "%collation%"; shown as+--------------------------+----------------------------+| variable_name | value |+--------------------------+---------- ------------------+| character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | Character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 &NBsp | | character_sets_dir | /usr/share/MySQL/charsets/|+--------------------------+----------------------------+8 rows in Set (0.00sec)+----------------------+-----------------+| variable_name | Value |+----------------------+-----------------+| collation_connection | Utf8_unicode_ci | | Collation_database | Utf8_unicode_ci | | Collation_server | Utf8_unicode_ci |+----------------------+-----------------+3 rows in Set (0.00sec) Character Set configuration is complete.
[PHP] [Linux] [Nginx] Installation Summary