In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the deployment of LAMP architecture and the configuration of dynamic website environment". In daily operation, I believe many people have doubts about the deployment of LAMP architecture and the configuration of dynamic website environment. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "LAMP architecture deployment and dynamic website environment configuration". Next, please follow the editor to study!
Experimental environment:
Operating system: centos 7.5
Server IP:192.168.10.5
Running user: root
Connection tool: xshell tool
Web environment: Linux+apache+php+mariadb (LAMP architecture)
The large-scale dynamic application system platform is mainly aimed at the underlying system architecture of high-traffic and high-concurrency websites. The operation of large-scale websites needs a reliable, secure, scalable and easy-to-maintain application system platform as a support to ensure the smooth operation of website applications. All these things need to be supported by web servers. The technologies applied in them include single node web server system, load balancing system, data cluster system, cache system, distributed storage system, distributed server management system, code release system and so on. Now it is generally popular for enterprises to use automated system deployment, which can run all web business in docker containers and simplify the configuration process of operation and maintenance. Below we briefly introduce the deployment and use of a single node of the web server.
This article is an original, more suitable for enterprise applications, a detailed introduction can refer to the "Linux should learn" in Chapter 20 of the tutorial, where a detailed introduction of the LNMP architecture, and I am here to introduce the LAMP architecture, LAMP, LNMP are widely used in enterprises, generally large enterprise websites will run on the Linux server to save resources and improve the performance and security of the web server.
Single node web server
Through the installation of the yum source that comes with the system, you can also configure the local yum source through the local image, or you can install it after compilation through the rpm package or tar.gz source package; it is more convenient to install through yum, and the installation process automatically installs the dependent package; during the installation process of the rpm package, you need to find the dependent package according to the prompts, which is a troublesome way to install. Let's demonstrate it through the installation of the yum source.
Apache is an open source web server, it can run on almost all widely used computer platforms, because of its cross-platform and security is widely used, is the most popular Web server-side software, apache is also widely used in enterprises. Especially in combination with the Linux operating system to achieve the best performance.
1 、 install apache
# yum install httpd.x86_64 httpd-devel.x86_64-y / / install apache
# rpm-qa httpd / / check whether apache is installed successfully
# httpd-v / / View apache version
Server version: Apache/2.4.6 (CentOS)
Server built: Jun 27 2018 13:48:59
# systemctl start httpd.service / / start apache service
# systemctl status httpd.service / / View the status of apache service
# systemctl stop httpd.service / / stop apache service
# systemctl enable httpd.service / / set the apache service to start automatically when booting
Apache default profile path: / etc/httpd/
Apache default web path: / var/www/html, which is an empty directory by default
PHP is a powerful server-side scripting language for creating dynamic interactive sites; PHP is open source and widely used; at the same time, for competitors like Microsoft asp and asp.net server scripting languages, PHP is undoubtedly another efficient option. PHP is a little bit: open source, fast processing, easy to use, cross-platform, efficient, suitable for large website architecture, generally PHP is combined with Linux apache nginx mysql Iis+php is rare, complex configuration and poor performance. The following is a brief introduction to the installation and configuration of php.
2 、 install php
# yum install php php-common php-fpm php-gd php-soap php-json php-ldap php-mbstring php-mysqlnd php-mysqld php-xml php-xmlrpc php-opcache php-simplexml php-bcmath-y
# rpm-qa php* / / View the installed PHP module
# php-v / / View php version
# ll / etc/php.ini / / php default configuration file, the detailed parameters in the configuration file are not described here.
MySQL is also open source at first, and then after it was acquired by Oracle, the version began to charge, and then there was a MariaDB database. MariaDB database management system is a branch of MySQL, which is mainly maintained by the open source community. The purpose of using GPL to license MariaDB is to be fully compatible with MySQL, including API and the command line, so that it can easily become a substitute for MySQL. MariaDB is open source, cross-platform, strong performance, easy to expand, and wide range of applications.
3 、 install mariadb
# yum install mariadb.x86_64 mariadb-server.x86_64 mariadb-devel.x86_64-y
# rpm-qa mariadb / / check whether mariadb is installed successfully
# systemctl start mariadb.service / / start database service
# systemctl stop mariadb.service / / stop database service
# systemctl status mariadb.service / / View database service status
# systemctl enable mariadb.service / / set the database service to start automatically when booting
Start the service after mariadb installation. Database root users do not have a password. You need to initialize and set the password. The configuration is as follows:
# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
Password for the root user. If you've just installed MariaDB, and
You haven't set the root password yet, the password will be blank
So you should just press enter here.
Enter current password for root (enter for none): / / enter directly
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
Root user without the proper authorisation.
Set root password? [YBO] y / / y set the root user password
New password: / / enter the password
Re-enter new password: / / confirm the password
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
To log into MariaDB without having to have a user account created for
Them. This is intended only for testing, and to make the installation
Go a bit smoother. You should remove them before moving into a
Production environment.
Remove anonymous users? [YBO] y / / y Delete anonymous users
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
Ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [YPo] y / / y forbids root to log in remotely
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
Access. This is also intended only for testing, and should be removed
Before moving into a production environment.
Remove test database and access to it? [YPop] n / / n does not delete the test database, depending on your own needs.
... Skipping.
Reloading the privilege tables will ensure that all changes made so far
Will take effect immediately.
Reload privilege tables now? [YBO] y / / refresh the data table
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
Installation should now be secure.
Thanks for using MariaDB!
# mysql-h 127.0.0.1-u root-p / / Connect to the database
4. Test web service,apache + php + mariadb starts testing after installing and starting the service.
4.1. the following decryption appears when accessing the web server through the browser, which indicates that the apache is installed successfully.
Http://192.168.10.5
4.2.Test apache+php
# vim / var/www/html/index.php
Http://192.168.10.5/index.php
4.3.Test apache+php+mariadb
# vim / var/www/html/mysqld.php
Http://192.168.10.5/mysqld.php
At this point, the study on "LAMP architecture deployment and dynamic website environment configuration" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.