In fact, I have introduced the LNMP one-click installation package to you before (please look here for review). Regarding the one-click installation package, there are both praise and criticism, but there is no doubt that it is , for a novice-level player like me and a good VPS, the one-click package is undoubtedly a good choice.

Why do you specifically talk about the installation and use of
LNMPA today? The main reason is that I recently changed my space, and the VPS in my hand basically does not come with a free panel. The more I use it, the more problems will arise. Therefore, I will summarize it here and treat it as a note.
LNMPA represents the website server architecture of Nginx, MySQL, PHP, and Apache under Linux. The difference from the previous LNMP is that it adds Apache support. Using Nginx as a front-end service can provide faster and more timely static pages, js, pictures, etc. When the client requests access to dynamic pages, Nginx's reverse proxy will be processed by Apache. After Apache is processed, it will be handed over to Nginx and returned to the client.
[LNMPA installation]
First, we need to install LNMP. I will not go into details about this process. The commands are listed below:

#wget -c http://soft.vpser.net/lnmp/lnmp0.7.tar.gz
#tar zxvf lnmp0.7.tar.gz
#cd lnmp0.7/
#. /centos.sh

Then, wait for the installation to complete. After that, we can optionally install the acceleration (./eaccelerator.sh) and encryption (./ionCube.sh) components. Next, start installing Apache. It is very simple and only requires one command:

#./apache.sh

After that, you are still waiting for the system to compile automatically. Once completed, we can open the default page.
[Using LNMPA]
For a good VPS, I think the biggest convenience brought by adding Apache is that it can directly support .htaccess files, and there is no need to worry about pseudo-static rules. .
Add virtual host: /root/vhost.sh
Delete virtual host: rm /usr/local/nginx/conf/vhost/domain name.conf Also required: rm /usr/local/apache/conf/vhost/ Domain name.conf
LNMPA status management: /root/lnmpa {start|stop|reload|restart|kill|status}
Nginx status management: /etc/init.d/nginx {start|stop|reload|restart }
PureFTPd status management: /etc/init.d/pureftpd {start|stop|restart|kill|status}
MySQL status management: /etc/init.d/mysql {start|stop|restart|reload |force-reload|status}
Apache status management: /etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}
Nginx main configuration file: /usr/ local/nginx/conf/nginx.conf
MySQL configuration file: /etc/my.cnf
PHP configuration file: /usr/local/php/etc/php.ini
PureFtpd configuration file: /usr /local/pureftpd/pure-ftpd.conf
PureFtpd MySQL configuration file: /usr/local/pureftpd/pureftpd-mysql.conf
Apache configuration file: /usr/local/apache/conf/httpd.conf
LNMPA upgrade PHP version: ./upgrade_lnmpa_php.sh (note: execute in the lnmp directory)
[Difficulties and usage tips]
1. Solution to the need to enter an FTP account when upgrading the wordpress plug-in in the LNMPA environment:

chown -R www:www /home/(website directory)

2. Mail sending problem under Debian
The Debian template uses exim4 as the mail server by default (not our common sendmail), which requires simple configuration to support mail sending. The method is: change dc_eximconfig_configtype=’local’ in /etc/exim4/update-exim4.conf.conf to dc_eximconfig_configtype=’internet’, and use the following command to restart Exim4.

invoke-rc.d exim4 restart

3. After installing LNMP on the 64bit system, what should I do if it prompts that the database password is incorrect and cannot be managed?
Just execute the script below to reset your password!

wget http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh;sh reset_mysql_root_password.sh

4. Mysql disables logging
and comments out the lines    #log-bin=mysql-bin
#binlog_format=mixed in /etc/my.cnf

5. Modify the number of nginx processes
in the /usr/local/nginx/conf/nginx.conf file
. Generally, there is no need to modify it. If your VPS gives you dual cores, you can modify the worker_processes value to 2
6. Modify the number of processes of php-cgi
Modify the number of processes of php-cgi
In /usr/local/php/etc/php-fpm.conf
modify <value name="max_children">12</ value> Generally 256M memory, can be set to about 12
7. Modify the maximum number of simultaneous connection files
The system default is 1024, it is best to increase it
Use ulimit -a to view all restrictions of the current system value, use ulimit -n to view the current maximum number of open files.
The newly installed Linux only has 1024 by default. When used as a server with a heavy load, it is easy to encounter error: too many open files. Therefore, it needs to be made larger.
Use ulimit -n 65535 to modify it immediately, but it will be invalid after restarting. (Note ulimit -SHn 65535 is equivalent to ulimit -n 65535, -S refers to soft, -H refers to hard)
has the following three modification methods:
① Add a line of ulimit -SHn in /etc/rc.local 65535
②Add a line ulimit -SHn in /etc/profile 65535
③Add the following two lines at the end of /etc/security/limits.conf to record
* soft nofile 65535
* hard nofile 65535
Which one should be used specifically? Try which one works. The first method has no effect in CentOS, the third method has effect, and the second method has effect in Debian.
8. Change the default ssh port
Edit /etc/ssh/sshd
The default is 22. It is recommended to modify it
In order to ensure that you will not be unable to log in via SSH after the modification, it is recommended to add a port number first and wait for confirmation. After you can connect, delete port 22 (Debian system: /etc/ssh/sshd_config)
9. Change the ROOT password (of course, this step can be completed directly in the SolusVM background)
After logging in to SSH with the ROOT account, Enter passwd  and then enter the second new password
. It is recommended to set it to more than 9 digits, a combination of English and numeric characters.


Hong Kong/United States/Domestic High Speed ​​VPS

postid
8569

Leave a Reply