LNMP(linux+nginx+mysql+php) server environment configuration practical
notes ), but the Chinese tutorials on the Internet are messy, so today I will share a nice quick integrated environment installation package.
ps: Google LEMP is required for foreign tutorials.
Well, start today's tutorial:
First, the system requirements are: CentOS/RadHat/Fedora, Debian/Ubuntu/Raspbian/Deepin VPS
operation starts:
(1) cd /
(2) wget http://www.fuhuijinlai.com /lnmp.zip && unzip lnmp.zip (Note: If zip is not installed, yum -y install zip)
(3) chmod -R 777 /usr/local/src/ (Explanation: make the file executable and writable)
(4) vi /etc/rc.d/rc.local (explanation: add boot-up self-start)
add the following content in the last line:
/usr/local/src/install.sh
(5) reboot (explanation: restart)
Okay , wait 30 minutes, basically the current Alibaba cloud hard disk, SSD hard disk, can be installed soon, but finally wait 30 minutes to reconnect to the server, and then verify it
. Execute the following script
service mysqld restart
service nginx restart
/usr/local/php/sbin/php-fpm restart
If all displays OK, congratulations, rookie got it
(6) Clean up and cancel the automatic installation script
vi /etc/rc.d/rc.local Delete the following , to avoid the next restart to install
/usr/local/src/install.sh again
(7) The next step is to modify the database password.
vi /etc/my.cnf
find the location of thread_concurrency = 8 and
add content below it (password-free Enter)
skip-grant-tables
exit and save (:wq)
restart the database
service mysqld restart
Ok, enter the database
/usr/local/mysql/bin/mysql -u admin -p
No password is needed at this time, press Enter to enter the
change The password of the database admin, the command is as follows
UPDATE user SET Password = password ('your password') WHERE User = 'admin';
exit, exit
and edit
vi /etc/my.cnf again
Delete the skip-grant-tables just now, exit, save,
restart the database, service mysqld restart
, and then enter the database
/usr/local/mysql/bin/mysql -u admin -p
. At this time, you need to enter your password.
Enter normally, successful If
you want to create a new website, for
example, your domain name is xiaodi.com
mkdir -p /web/www/xiaodi.com (create your website and upload your code here)
in /usr/local/nginx/conf/vhost/ Create your domain configuration file,
vi /usr/local/nginx/conf/vhost/xiaodi.com.conf
add the following
server
{
listen 80;
server_name www.mglhc.com xiaodi.com;
index index.html;
root /web /www/xiaodi.com;
location ~ .*\.php?$
{
fastcgi_pass 127.0.0.1:9000; #php forwarding parsing
fastcgi_index index.php;
include fcgi.conf;
}
access_log /web/log/xiaodi.com.log main;
}
Exit and save, restart nginx
service nginx restart
Of course, your domain name needs to be resolved to the server's ip,
now you can access your I have a website, at /web/www/xiaodi.com, just add your content freely, php, html can be parsed normally,
is it very simple, it is much more reliable than other sharing, don't forget to give a thumbs up !
LNMP (linux+nginx+mysql+php) server environment configuration practical notes
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=326072882&siteId=291194637
Ranking