1,安装nginx:sudo apt-get install nginx
2, the installation is complete, input, service nginx start to open the service, type: netstat -ntulp | grep 80, is determined to open nginx
3, open a browser, enter 127.0.0.1, nginx default screen appears, confirm that the normal access
Two, php installation
1, the installation php: sudo apt install php php-fpm
2, input php -v determined php properly installed, the version information is determined php
3, enter nginx site file, cd / var / www / html, then vim index.php, create a php file, enter <php phpinfo ();??>, Save and exit, turn 127.0.0.1, encountered a problem and can not phpinfo access interface, query nginx default configuration does not support Php
4, modify the configuration file nginx, cd / etc / nginx / sites-available /
5, sudo vim default, modify the configuration file, modified after below
** a. Removing location ~ \ .php $ {comment line, while removing the paired lines} Note that
** b remove fastcgi_pass unix:. /Var/run/php/php7.2-fpm.sock; this line is a comment
** c Meanwhile, modified to the corresponding php-fpm version number of the file name (I installed Yes. php7.2)
6, find the root / var / www / html configure the default home page, add index.php
7, open the browser again, access to 127.0.0.1, appeared normal phpinfo
Third, install mysql
1,安装mysql:sudo apt install mysql-server
2, enter: netstat -ntulp | grep 3306, determined to install mysql normal start
3, enter: sudo mysql_secure_installation, initialize the security settings, see the detailed settings before the blog "ubuntu install LAMP"
Fourth, the installation Phpmyadmin, set up to support nginx phpmyadmin
1, enter the command: sudo apt install phpmyadmin, installation phpmyadmin
2, add connections, enter the command: sudo ln -s / usr / share / phpmyadmin / var / www / phpmyadmin, create a file in connection var / www / html
3, phpmyadmin default mysql management configuration for the apache used, nginx to use it, you need to modify the configuration file, enter the command: sudo vim / etc / nginx / sites-available / default, directly to the last line insert, add a listener 8100 node, As shown below
server {
listen 8100;
root /var/www/phpmyadmin;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
4, open the browser, enter 127.0.0.1/phpmyadmin, phpmyadmin login screen appears, enter your user name phpmyadmin, phpmyadmin installation password when setting password, the login is successful
Setting step during installation phpmyadmin detail, reference
xpwi blogger
PhpMyAdmin graphic tutorial to install Ubuntu
https://www.cnblogs.com/xpwi/p/9821371.html