1.安装 nginx
sudo apt-get update sudo apt-get install nginx
2.安装 MySQL
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb sudo dpkg -i mysql-apt-config* sudo apt-get update sudo apt-get install mysql-server sudo systemctl status mysql sudo mysql_secure_installation sudo mysqladmin -u root -p version
3.安装 PHP
sudo apt-get install php-fpm php-mysql sudo mkdir /var/www/html/your_domain
修改 nginx 配置文件
sudo vim /etc/nginx/sites-available/your_domain server { listen 80; listen [::]:80; root /var/www/html/your_domain; index index.php index.html index.htm; server_name your_domain; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } }
更新 nginx 配置文件
sudo nginx -t sudo nginx -s reload sudo systemctl reload nginx
如果 nginx 出现下面的提示:
[error]: invalid PID number "" in "/var/run/nginx.pid" sudo service nginx start
4.MySQL 数据库的导入导出
mysqldump -uroot -p wordpress>/root/wordpress.sql mysql -uroot -p wordpress
参考资料:
1.https://www.digitalocean.com/community/tutorials/how-to-install-the-latest-mysql-on-debian-9
2.https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-9
Recent Comments