linux source installation manual LNMP (pro-test)

 

linux source installation manual lnmp notes (pro-test) <pre> install these two gccyum the install the install G ++ yum </ pre>
<pre>
first in the linux installation libiconv source compiler installed PHP Useful
#wget http: //ftp.gnu. org / pub / gnu / libiconv / libiconv-1.14.tar.gz # tar xvf libiconv-1.14.tar.gz # cd libiconv-1.14 # ./configure --prefix = / usr / local / libiconv # make # make install < / pre>

<pre> PHP official website. 1 go next php-5.6.29.tar.gz wget http://cn2.php.net/distributions/php-5.6.29.tar.gz2 ./configure --prefix = / usr / local / php --with -iconv = / usr / local / libiconv --enable-sysvsem --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd - --with the mhash-OpenSSL-the -with --enable-Sockets --with the xmlrpc---with-zlib --enable-FPM --with-config-File-path = / usr / local / PHP / etc 
 --with -iconv = / usr / local / libiconv libiconv installed above this path is the path to Kazakhstan --with-mcrypt not specify a path it is to explain PHP compile time back installation specified directly with the specified

3 make file generation o If you reconfigure ./configure ............ after undefined reference to `libiconv './configure --prefix that is not set up make clean appearance
4 make install installation

input php -v [root @ iZbp11xke8lva3xk8b3qtnZ ~] # php -vPHP 5.6.29 (cli) (built: Jan 5 2017 10:37:51) Copyright (c) 1997-2016 The PHP GroupZend Engine v2.6.0, Copyright (c) 1998 -2016 Zend Technologies
also go into the php.ini
the default at first under the urban date.timezone php.ini configuration settings = "Asia / on Shanghai"
cp /home/php-5.6.29/php.ini-production / usr /local/php/etc/php.ini
arranged below php-fpm <pre> into the / usr / local / php / etc directory cp php-fpm.conf.default php-fpm.conf < / pre>
and run php-fpm -t there is no error no error on the line
php-fpm started directly on the line to see whether the port netstat -ntlp start




</ pre>
Source installation mysql <pre> (1) install cmake (mysql5.5 later compiled by the cmake) [root @ rhel5 local] #tar -zxv -f cmake-2.8.4.tar.gz [root @ rhel5 local ] #cd CMake-2.8.4 [@ RHEL5 CMake the root-2.8.4] #. / Configure [@ RHEL5 the root-CMake 2.8.4] #make [@ RHEL5 the root-CMake 2.8.4] #make the install
/ usr / local / bin / cmake --version tests are not successfully installed


(2) create mysql installation directory and database storage directory [root @ rhel5 ~] #mkdir -p / usr / local / mysql // install mysql [root @ rhel5 ~ ] #mkdir -p / usr / local / mysql / data // store the database
(3) to create users and user groups mysql [root @ rhel5 ~] groupadd mysql [root @ rhel5 ~] useradd -r -g mysql mysql
(4) mounted mysql # wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.34.tar.gz#tar zxvf mysql-boost -5.7.17.tar.gz # cd mysql- 5.6.34 # / usr / local / bin / cmake -DCMAKE_INSTALL_PREFIX = / usr / local / mysql -DMYSQL_DATADIR = / usr / local / mysql / data -DDEFAULT_CHARSET = utf8 -DDEFAULT_COLLATION = utf8_general_ci -DEXTRA_CHARSETS = all -DENABLED_LOCAL_INFILE = 1 [root @ rhel5 mysql-5.5.10] #make [ root @ rhel5 mysql-5.5.10] #make install

set directory permissions # cd / usr / local / mysql # chown -R root:. mysql // all files in the current directory the owner of the owner to root, shared by a group mysql # chown -R mysql: mysql datacp support-files / my-medium.cnf /etc/my.cnf // add the service to start mysql service system
modifications my.cnf configuration file is added as a mysql command is a link connecting a client socket connection mysql because it is specified under the socket path <pre> [mysqld] socket = / tmp / mysql.sock [client] socket = / tmp / mysql.sock </ pre>


create the system database tables # cd / usr / local / mysql # scripts / mysql_install_db --user = mysql

Cd # / usr / local / MySQL
# ./bin/mysqld_safe --user = // & MySQL start MySQL, but can not stop
the boot log written in this document: /usr/local/mysql/data/localhost.err

set up the environment variable [root @ rhel5 ~] # vi /root/.bash_profile
in PATH = $ PATH: $ HOME / bin add parameters:
PATH = $ PATH: $ HOME / bin : / usr / local / MySQL / bin: / usr / local / MySQL / lib
#source /root/.bash_profile

shut down MySQL service # mysqladmin -u root -p root // here MySQL root user has not configured password, so a null value. When a password is required, directly point the Enter key.

[root @ rhel5 mysql] # cp support-files / mysql.server /etc/init.d/mysql // add the service to start mysql system services can use the following commands # service mysql start # service mysql stop # service mysql restart
modify the MySQL root user's password, and open a remote connection # mysql -u root mysql
mysql> use mysql; mysql> desc user;. mysql> GRANT ALL PRIVILEGES ON * * TO root @ "%" IDENTIFIED BY "root"; // add the ability to connect remotely to root. mysql> update user set Password = password ( 'xxxxxx') where User = 'root'; mysql> select Host, User, Password from user where User = 'root'; mysql> flush privileges; mysql> exit
sign back: mysql - u root -p
if not a remote connection, the firewall is closed [the root @ RHEL5 ~] the /etc/rc.d/init.d/iptables script. STOP #
</ pre>
installed under the following nginx install the software as long as there is no file directory on the line installation software installed openssl <pre> wget http://down1.chinaunix.net/distfiles/openssl-1.0.0c.tar.gztar zxvf-1.0.0c.tar.gzcd openssl openssl-1.0.0c
./config --prefix = / usr / local / openssl --openssldir = / usr / local / openssl / confmake && make install # verify the installation / usr / local / openssl / bin / openssl version -a </ pre>
Installing software then pcre <pre> wget https://ncu.dl.sourceforge.net/project/pcre/pcre2/10.22/pcre2-10.22.tar.gztar zxvf pcre2-10.22.tar.gzcd pcre2-10.22./configure --prefix = / usr / local / pcre / make & make install </ pre>
re-installation software zlib <pre> wget http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.10/ zlib-1.2.10.tar.gztar zxvf zlib-1.2.10.tar.gzcd zlib-1.2.10./configure --prefix = / usr / local / zlib / make && make install </ pre>



Next, install nginx <pre> # Add user and group www www www -g wwwuseradd groupadd

# create a site root -p mkdir / var / www / root / chmod -R 775 / var / www / root /
# download wget http: // nginx. org / download / nginx-1.10.2.tar.gz # unpack tar zxvf nginx-1.10.2.tar.gz # into the installation directory cd nginx-1.10.2
mkdir -p /home/pcre2-10.22/pcre210/.libscp /usr/local/lib/libpcre.a /home/pcre2-10.22/libpcre.acp //usr/local/lib/libpcre.a / home / pcre2- 10.22 / libpcre.lacp /usr/local/lib/libpcre.a /home/pcre2-10.22/.libs/libpcre.acp /usr/local/lib/libpcre.a /home/pcre2-10.22/.libs/libpcre. La
# configurations (openssl, pcre, zlib source path is not a path mounted remember!) ./ configure --user = www --group = www --prefix = / usr / local / nginx --with-http_ssl_module - = OpenSSL-the -with / Home / OpenSSL-1.0.0c --with-PCRE = / Home / pcre2-10.22 --with-zlib = / Home / zlib --with-1.2.10-http_stub_status_module Threads --with-

# compile and install (ps: installation error may pcre will continue to look at this document /home/pcre2-10.22/.libs/ there is no cp /usr/local/lib/libpcre.a /home/pcre2-10.22/.libs/libpcre the make install && /usr/local/lib/libpcre.a /home/pcre2-10.22/.libs/libpcre.la)make the .acp
# verify / usr / local / nginx / sbin / nginx -V
nginx version: nginx / 1.10.2built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.0.0c 2 Dec 2010TLS SNI support enabledconfigure arguments: --user = www --group = www --prefix = / usr / local / nginx --with-http_ssl_module --with-openssl = / home / openssl-1.0.0c --with-pcre = / home / pcre2-10.22 --with-zlib = / home / zlib-1.2.10 --with-http_stub_status_module --with- threads

modify the configuration file
vi /usr/local/nginx/conf/nginx.conf
change the default directory and the default home page with the location / {root / home / www ; index index. php index.html index.htm;}



in which the
        location / {root html; index index.php index.html index.htm;} changed
        location / {root / home / www ; index index.php index.html index. htm;}
This should be changed so that access PHP php-fpm $ DOCUMENT_ROOT port processing request represents the current value of the location specified in the instruction root ~ \ .php $ {root / home / www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; SCRIPT_FILENAME $ DOCUMENT_ROOT $ fastcgi_script_name fastcgi_param; the include fastcgi_params;}
 charset utf-8; we wanted to change and then restart nginx utf-8
remember / home / www directory must be set access permissions! ! !
Start, restart
# start: / usr / local / nginx / sbin / nginx 
# reboot / usr / local / nginx / sbin / nginx -s reload stop
kill -9 nginx process ID
Test # netstat -ntlp // look at the test port 80 there are no ports # browsers running test HTTP: // ip: 80
PS: principle nginx80 port receiving the file will be sent to php-fpm port to let him handle PHP to parse is not parsing the php nginx port

</ pre>
Look phpinfo Loaded Configuration File If none would give him perform the loading php.ini <pre> / usr / local / php / sbin / php-fpm -y /usr/local/php/etc/php-fpm.conf - c /usr/local/php/etc/php.ini </ pre>




then look no mysql mysqli extension modules and then directly into the source package php ext mounted inside in order to use the extended function php link mysqlps: first front loading mysql yum - y install mysql-devel

Next, install phpmyadminwget https://files.phpmyadmin.net/phpMyAdmin/3.5.8.2/phpMyAdmin-3.5.8.2-all-languages.zipunzip phpMyAdmin-3.5.8.2-all- languages.zipcd phpMyAdmin-3.5 .8.2-all-languages

Guess you like

Origin www.cnblogs.com/newmiracle/p/11872637.html