The installation and configuration process of Nginx+PHP+MySQL+Tomcat server environment
The installation steps are as follows: 1. Nginx 1.1 Add source and install 1.1.1 sudo add-apt-repository ppa:nginx/stable 1.1.2 sudo apt-get update 1.1.3 sudo apt-get install nginx 1.2 Testing 1.2.1 Start nginx: sudo /etc/init.d/nginx start 1.2.2 Access: http://localhost appears “Welcome to nginx!”, the installation is successful. 1.2.3 Close nginx: sudo /etc/init.d/nginx stop 2.PHP 2.1 Installation 2.1.1 sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5-mysql php5-fpm: One of the ways to cooperate with nginx, the other is: spawn-fcgi; php5-mysql: access mysql; 2.2 Modify nginx configuration 2.2.1 sudo vim /etc/nginx/sites-available/default 2.2.2 Change the line of index to: “index index.html index.htm index.php;” Uncomment the following to support php scripts: location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } 2.3 Testing 2.3.1 Create a new directory: sudo mkdir /var/www/ 2.3.2 Modify nginx directory: sudo vim /etc/nginx/sites-available/default Change the root line to “root /var/www;” 2.3.3 Create a new test file: sudo vim /var/www/test.php Input: “” 2.3.4 Start nginx: sudo /etc/init.d/nginx start 2.3.5 Access: http://localhost/test.php The php details appear and the configuration is successful. 2.3.6 Close nginx: sudo /etc/init.d/nginx stop 3. MySQL 3.1 Installation 3.1.1 sudo apt-get install mysql-server During the installation process, you will be asked to set a root password. 3.2 Testing 3.2.1…