In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to install LNMP with one click of OneinStack". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "OneinStack how to install LNMP with one click"!
Oneinstack one-click php/java/hhvm installation and ultra-detailed vps manual installation of lnmp
1. Oneinstack one-click php/java/hhvm installation
1. Oneinstack official website:
Official website:
2. Oneinstack one-click php/java/hhvm installation code is as follows: (Ali Cloud users can select oneinstack Ali cloud node, which will be faster)
Yum-y install wget screen curl python # for centos/redhat# apt-get-y install wget screen curl python # for debian/ubuntuwget http://aliyun-oss.linuxeye.com/oneinstack-full.tar.gz # Aliyun users download wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz # including source code, wget http://mirrors.linuxeye.com/oneinstack.tar.gz # can be downloaded at home and abroad without source code It is recommended that only foreign hosts download tar xzf oneinstack-full.tar.gzcd oneinstack # if you need to modify the directory (installation, data storage, nginx log), please modify the options.conf file screen-s oneinstack # if the network is interrupted, you can execute the command `screen-r oneinstack` to reconnect the installation window. / install.sh # Note: do not sh install.sh or bash install.sh
3. The one-click installation package of oneinstack supports free installation of the following combinations:
Lnmp (linux + nginx+ mysql+ php) lamp (linux + apache+ mysql+ php) lnmpa (linux + nginx+ mysql+ php+ apache): nginx handles static, apache (mod_php) handles dynamic phplnmt (linux + nginx+ mysql+ tomcat): nginx handles static, tomcat (jdk) handles javalnmh (linux + nginx+ mysql+ hhvm)
4. You can choose when you install it. (click to enlarge)
5. Then you can install the php cache accelerator according to your own needs, providing zendopcache, xcache, apcu, eaccelerator. (click to enlarge)
6. There are php encryption and decryption tools ioncube, zendguardloader, memcached, redis and so on. (click to enlarge)
7. One-click installation of oneinstack supports upgrades:. / upgrade.sh, which provides upgrades such as nginx, tengine, apache, php, mysql, redis, etc. (click to enlarge)
Nginx-1.9.5 + mariadb-10.1 + php-7.0.0rc5 website environment building tutorial on ubuntu14.04lts
II. Compile and install nginx-1.9.5
1. Above is the one-click installation method for lnmp, followed by a tutorial on manually building a lnmp environment on a ubuntu-14.04 lts system. The reason why we choose to build the environment manually is to accumulate the experience of building the environment from manual construction (heavy fog) and enjoy some fun. If you are interested in this area and have enough free time, you might as well give it a try.
2. First of all, go to nginx to download the nginx source code (Note: since nginx-1.9.5 is installed in this blog to support the http/2 protocol, a 1.8.0 tutorial will be given after this paragraph for some websites that do not need ssl).
Cd / usr/local/srcwget https://nginx.org/download/nginx-1.9.5.tar.gz
Download libressl (Note: the purpose of using libressl in this blog is to support the chacha20-poly1305 streaming encryption algorithm used in ssl, and the ssl library can also be used for sites that use aes-gcm).
Cd / usr/local/srcwget https://ftp.openbsd.org/pub/openbsd/libressl/libressl-2.3.0.tar.gztar xzf libressl-2.3.0.tar.gz
4. Now, the directory structure of / usr/local/src is similar to this (shown in backslash and indentation):
Usr\ local\ src\ libressl-2.3.0 nginx-1.9.5
5. Compilation preparation:
Apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-devgroupadd wwwuseradd www-g www
6. Start compiling nginx:
. / configure\-- user=www\-- group=www\-- prefix=/usr/local/nginx\-- with-http_stub_status_module\-- with-http_ssl_module\-- with-http_gzip_static_module\-- with-ipv6\-- with-http_v2_module\-- with-openssl=../libressl-2.3.0
7. The compilation parameters I use are described as follows:
-- user=www\ # specify nginx operation user-- group=www\ # specify nginx operation user group-- prefix=/usr/local/nginx\ # specify nginx installation path without modification-- with-http_stub_status_module\ # enable status monitoring module-- with-http_ssl_module\ # enable ssl--with-http_gzip_static_module\ # enable gzip--with-ipv6\ # enable ipv6 No V6 can be removed-- with-http_v2_module\ # enable http/2--with-openssl=../libressl-2.3.0 # specify openssl path
8. Set up the makefile and start compiling:
Makemake install
9. Add environment variables:
For vim / etc/environment#vim operation, please add google# at the end of the path variable: / usr/local/nginx/sbin# is completed, similar to path= "/... /... /.: / usr/local/nginx/sbin" # Save and exit source / etc/environment
10, enter: nginx-v, display the version of nginx, it means that the installation is successful.
11. If you do not want to install nginx-1.9.5, you can use this method to install nginx-1.8.0. The procedure is the same as above, and the code is as follows:
Cd / usr/local/srcwget https://nginx.org/download/nginx-1.8.0.tar.gzcd / usr/local/srcwget https://www.openssl.org/source/openssl-1.0.2d.tar.gz tar zxvf openssl-1.0.2d.tar.gz cd openssl-1.0.2d. / configmakeldconfigapt-get install libpcre3 libpcre3-dev zlib1g zlib1g-devgroupadd wwwuseradd www-g www./configure\-user=www\-group=www\-prefix=/usr/local / nginx\-- with-http_stub_status_module\-- with-http_ssl_module\-- with-http_gzip_static_module\-- with-ipv6\-- with-http_v2_module\-- with-openssl=/usr/local/src/openssl-1.0.2dmakemake installvim / etc/environment#vim Operation Please add google# at the end of the path variable: / usr/local/nginx/sbin# is similar to path= "/ . /: /. /:: / usr/local/nginx/sbin "# Save exit source / etc/environmentnginx-v
3. Apt-get quickly installs mariadb-10.1
1. Add the official mariadb apt source:
Sudo apt-get install software-properties-commonsudo apt-key adv-- recv-keys-- keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository 'deb https://mariadb.nethub.com.hk//repo/10.1/ubuntu trusty main'# my vps is the vps of Hong Kong softlayer data center vps.to, so we have added the apt source of hk, and you can find more # sources here: https://downloads.mariadb.org/mariadb/repositories
2. Apt-get install mariadb:
Pt-get install mariadb-client mariadb-server
3. The root password and duplicate password will be required during installation, as required. If you need to change the root password, use:
/ usr/bin/mysqladmin-u root-p Old password New password
IV. Compile and install php-7.0.0rc5
1. Download the php-7.0.0rc5 source package:
Cd / usr/local/srcwget https://downloads.php.net/~ab/php-7.0.0rc5.tar.gztar xzf php-7.0.0rc5.tar.gz
2. Install the php dependency package:
Sudo apt-get install libxml2-dev libpcre3-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libxpm-dev libfreetype6-dev libmysqlclient-dev libt1-dev libgd2-xpm-dev libgmp-dev libsasl2-dev libmhash-dev unixodbc-dev freetds-dev libpspell-dev libsnmp-dev libtidy-dev libxslt1-dev libmcrypt-dev
3. Compile php:
Cd / usr/local/src/php-7.0.0rc5. / configure-- prefix=/usr/local/php\-- with-config-file-path=/usr/local/php/etc\-- with-fpm-user=www-- with-fpm-group=www\-- enable-fpm\-- disable-fileinfo\-- enable-mysqlnd\-with-mysqli=mysqlnd\-- with-pdo-mysql=mysqlnd\-- with-iconv-dir=/usr/local\-- with-freetype-dir\-- with-jpeg- Dir\-- with-png-dir\-- with-zlib\-- with-libxml-dir=/usr\-- enable-xml\-- disable-rpath\-- enable-bcmath\-- enable-shmop\-- enable-exif\-- enable-sysvsem\-- enable-inline-optimization\-- with-curl\-- enable-mbregex\-enable-inline-optimization\-enable-mbstring\-- with-mcrypt\-- with-gd\-- enable-gd-native-ttf\-- With-openssl\-- with-mhash\-- enable-pcntl\-- enable-sockets\-- with-xmlrpc\-- enable-ftp\-- with-gettext\-- enable-zip\-- enable-soap\-- disable-debugmake # time may be longer My vps.to vps takes about 15 minutes to make install.
4. Add environment variables:
Vim / etc/environment# at the end of the path variable:: / usr/local/php/bin# save exit source / etc/environment
5. Test: php-v, output the php version indicates that the installation is successful.
Modify the configuration files of nginx, mariadb and php
1. Modify the nginx configuration file and establish a virtual host configuration folder:
Mkdir / usr/local/nginx/conf/vhost
2. Edit nginx.conf to introduce all virtual host configurations:
Vim / usr/local/nginx/conf/nginx.conf# adds the include vhost/*.conf;# file header user www;work_process 1 to the last} line before it # saves and exits according to the cpu core number setting
3. Add the nginx service and test the nginx:
Wget https://raw.github.com/jasongiedymin/nginx-init-ubuntu/master/nginx-o / etc/init.d/nginxchmod + x / etc/init.d/nginxservice nginx start
4. If the nginx server is being started, it means it is successful. Finally, execute the following code to boot:
Update-rc.d-f nginx defaults
5. Modify the mariadb configuration file and set the mariadb character set:
Cd / etc/my.cnf.d vim server.cnf # add character-set-server=utf8 # under [mysqld] paragraph and enter [client] default-character-set=utf8 # above [server] paragraph to save and exit service mysql restart
6. Modify the php configuration file and copy the default php.ini file:
Cd / usr/local/src/php-7.0.0rc5cp php.ini-production / usr/local/php/etc/php.ini
7. Close display_errors:
Vim / usr/local/php/etc/php.ini# navigate to display_errors and set: display_errors = off# save exit
8. Modify php-fpm configuration:
Cd / usr/local/php/etccp php-fpm.conf.default php-fpm.conf # if not, create the file cd php-fpm.dcp www.conf.default www.confvim www.conf# modify the following items: user = wwwgroup = wwwlisten = / dev/shm/php-cgi.socklisten.owner = wwwlisten.group = wwwlisten.mode = 066 save exit
9. Establish a php service:
Cp / usr/local/src/php-7.0.0rc5/sapi/fpm/init.d.php-fpm / etc/init.d/php-fpmchmod + x / etc/init.d/php-fpmupdate-rc.d-f php-fpm defaults
10. Start php:
Service php-fpm start
VI. Establish a virtual host
1. Since setting up a virtual host is a troublesome task, the virtual host script of oneinstack.com is borrowed here. Use the following command to use the virtual host script of the oneinstack package:
Wget https://mirrors.linuxeye.com/oneinstack.tar.gztar xzf oneinstack.tar.gzcd oneinstack./vhost.sh
2. Follow the prompts to establish a virtual host. (click to enlarge)
3. Resolve the domain name to vps, enter the corresponding virtual host directory, edit the following php file, or upload a php probe, and then you can see that lnmp is successful:
Summary of manual installation of lnmp for vps
1, in fact, vps manual installation of lnmp is still very troublesome, of course, its customizability is also very high, for friends who do not want to use lnmp to install the package, they can manually compile the latest version of nginx, mysql, php, etc., can first experience the performance improvement of the new version.
2. The author of the oneinstack one-click php/java/hhvm installation package also has a number of utilities. Here is a code that automatically searches the hard disk and mounts it:
Wget https://mirrors.linuxeye.com/scripts/auto_fdisk.shchmod + x. / auto_fdisk.sh./auto_fdisk.sh
3. If you see the figure below, the automatic mount has been successfully mounted. This method has passed the test on Aliyun vps, and other vps hosts are available.
At this point, I believe you have a deeper understanding of "OneinStack how to install LNMP with one click". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.