1. Installation of Nginx
wget https://github.com/nginx/nginx/archive/v1.7.11.zipunzip nginx-1.7.7.zip./configure --prefix=NGINX_INSTALL_PATHmake make -f objs/Makefile installnginx直接在objs下生成Makefile文件.
Nginx Module Installation
The biggest difference between Nginx module and Apache module is that the module needs to be recompiled. The following shows the installation of the Nginx-echo module.
wget https://github.com/openresty/echo-nginx-module/archive/v0.57.zipMkdir$NGINX _install_path/MODULESMV Echo-nginx-module-0.57.Zip$NGINX _install_path/modules&&Cd$NGINX _install_path/modulesunzip Echo-nginx-module-0.57.Zip CD$NGINX _install_path./configure--Prefix=Nginx_install_path--Add-module=$NGINX _install_path/modules/echo-nginx-module-0.5
2. mysql Installation
MySQL installation can download repo file directly to MySQL website.
wget http://repo.mysql.com/mysql-community-release-fc21-6.noarch.rpmsudo yum install community-mysql-server.x86_64 mysql-workbench-community.x86_64
3. PHP Installation
This is mainly used in php-fpm to execute PHP files, PHP kernel 5.3.3 or more, PHP source code comes with PHP-FPM
wget -c http://cn2.php.net/distributions/php-5.6.9.tar.gz (due to the large PHP file, it is best to open the breakpoint continued) /configure -- prefix= /usr/ local /php- 5.6 .9 -- Enable -fpm -- with -mysql make && make Installsudo ln -s /usr/local /php- 5.6 .9 /usr/ local /php
Then we'll install PHP and run PHP-FPM, but before we do, we need to
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
We will now use the default configuration inside, and then go to the Sbin directory to open the PHP-FPM service.
sudo sbin/php-fpm
4. Configure PHP under Nginx
location ~* \.php$ { 127.0.0.1:9000; SCRIPT_FILENAME$document_root$fastcgi_script_name; PATH_INFO$fastcgi_script_name; include fastcgi_params; }
Now start Nginx
Add the index.php file to the HTML directory.
<?phpphpinfo();?>
Visit http://localhost/index.php
Appear
This way, the installation configuration of Nginx and PHP is complete.
Installation of Nginx and PHP under Fedora