In fact, I have introduced to you before LNMP One click installation package (back Look here, Gu )The one button installation package has both praise and criticism. However, there is no doubt that the one button installation package is a good choice for novice players like Zhao Rong.
Why did you say it today LNMPA How about the installation and use of? The main thing is that recently I changed the space, and the VPS in my hand basically doesn't give away panels, so there are more problems when I use more. So, let's summarize it here and use it as a note to make a note.
LNMP A represents the website server architecture of Nginx, MySQL, PHP and Apache under Linux. Different from the previous LNMP, Apache support is added. Using Nginx as a front-end service can make static pages, js, pictures, etc. faster and more timely. When a client requests to access a dynamic page, Nginx's reverse proxy will be sent to Apache for processing, and Apache will send it to Nginx after processing and return it to the client.
[LNMPA installation]
First, we need to install LNMP. I won't go into details about this process. The following commands are listed:
#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. Later, we can optionally install acceleration (./accelerator.sh) and encryption (./ionCube. sh) components. Next, start to install Apache. It is very simple and requires only one command:
#./ apache.sh
After that, we still wait for the system to compile automatically. After that, we can open the default page.
[Use of LNMPA]
As for Zhao Rong, I think the biggest convenience brought by the addition of Apache is that it can directly support. htaccess files, and there is no need to bother with pseudo static rules.
Add virtual host:/root/vhost.sh
To delete a virtual host: rm/usr/local/nginx/conf/vhost/domain.conf At the same time, you need: rm/usr/local/apache/conf/vhost/domain.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 state management:/etc/init.d/httpd {start | stop | restart | graceful | graceful stop | configetest | 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 miscellaneous problems and application skills]
1. To upgrade wordpress plug-ins in the LNMPA environment, you need to enter an FTP account:
Chown - R www: www/home/(website directory)
2. Email sending problem under Debian
The Debian template uses exim4 as the mail server by default (not our common sendmail), which needs simple configuration to support mail sending. The method is: change dc_exitconfig_configtype='local' in/etc/exim4/update-exim4.conf.conf to dc_exitconfig_configtype='internet', and use the following command to restart Exim4.
invoke-rc.d exim4 restart
After the 3.64bit system installs LNMP, it prompts that the database password is incorrect and cannot be managed. What should I do?
Execute the following script to reset the password!
wget http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh ; sh reset_mysql_root_password.sh
4. MySQL Disable Log
In/etc/my.cnf
Put # log bin=mysql bin
#Binlog_format=mixed
5. Modify the number of nginx processes
In the/usr/local/nginx/conf/nginx.conf file
Generally, it does not need to be modified. If your VPS gives you dual cores, you can modify the worker_processes value to 2
6. Modify the number of php cgi processes
Modify the number of php cgi processes
In/usr/local/php/etc/php fpm.conf
Modify<value name="max_children">12</value>256M memory generally, which can be set to 12
7. Modify the maximum number of simultaneously connected files
The default value of the system is 1024, which should be larger
Use ulimit - a to view all the limit values of the current system, and ulimit - n to view the current maximum number of open files.
The newly installed Linux only has 1024 by default. When it is used as a server with heavy load, it is easy to encounter error: too many open files. Therefore, it needs to be enlarged.
Use ulimit - n 65535 to modify it immediately, but it will be invalid after restart. (Note: ulimit - SHn 65535 is equivalent to ulimit - n 65535, - S refers to soft, - H refers to hard)
There are three modification methods as follows:
① Add a line ulimit SHn 65535 in/etc/rc.local
② Add a line ulimit SHn 65535 in/etc/profile
③ Add the following two lines of records at the end of/etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
The first method in CentOS has no effect, the third method has effect, and the second method in Debian has effect.
8. Change the ssh default port
Edit/etc/ssh/sshd
The default value is 22. It is recommended to modify
In order to avoid SSH login failure after modification, it is recommended to add a port number first, and then delete port 22 after confirmation of connection (Debian system is:/etc/ssh/sshd_config)
9. Modify 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 new password again
It is recommended to set it to more than 9 digits and English numeral character combination
Statement: Blogs are only for sharing information and are not recommendations. Websites do not participate in transactions and are not intermediaries. The content only represents personal views and is not authoritative. Readers should consider it and take their own risks! Every penny and every commodity is still the eternal truth. Juvenile readers (including physical and psychological) should visit this website with their guardians! This article is written by( Zhao Rong )Original compilation, reprint, please keep the link: VPS novice tutorial ⑦: LNMPA installation and use tutorial The code is not easy, please do not copy or paste! About using: This website mainly shares server and VPS information, and does not provide any product sales or purchase. All visitors please purchase and use products within the scope of national laws and regulations. QQ group discussion: 683851361 About safety: Any IDC has the possibility of going bankrupt and running away. The host line is even more uncontrollable. Monthly payment and backup are your best choices. Please keep good and regular backup habits