Introduction to the Linux lamp setup:
A:apache,web server, Process name: Httpdm:mysql, database system, Process name: mariadbp:php, scripting language, can be used to resolve dynamic resource requests on Web pages
Role:
Provide Web apps to build Web application infrastructure
Advantage:
Flexibility: There is no technical license limitations and the flexibility to build and deploy application personalization in the right way: lamp building is open source software, with a large number of builds, providing additional functional modules at low cost: Lamp formation is open source agreement, as long as follow the GPL agreement, you can freely access and free trial Ease of use: most host services use lamp-based environments as labels, applications do not need to be compiled in general, and deployment on new hosts is easy to implement
Here are a few ways to deploy a lamp: Centos 7: One, package installation (Yum,php+httpd=module mode)
1. Install Apache command: yum-y install httpd
650) this.width=650; "src=" Http://i.imgur.com/G9j1M3B.png "alt=" G9j1m3b.png "/>
Start: Systemctl start Httpd.service
650) this.width=650; "src=" Http://i.imgur.com/sC3SHeq.png "alt=" Sc3sheq.png "/>
Verify: The Welcome page can be opened in the browser, or the ' Curl ' command is tested
650) this.width=650; "src=" Http://i.imgur.com/q1N1nSV.png "alt=" Q1n1nsv.png "/>
2. Install PHP command: yum-y install PHP
650) this.width=650; "src=" Http://i.imgur.com/xcgSEVU.png "alt=" Xcgsevu.png "/>
Validation: Create a new index.php (edit PHP code) under/var/www/html and access
650) this.width=650; "src=" Http://i.imgur.com/0Y5Mclm.png "alt=" 0y5mclm.png "/>650" this.width=650; "src=" http:// I.imgur.com/u9geeg2.png "alt=" U9geeg2.png "/>
3. Install MySQL command: yum-y install Mariadb-server
650) this.width=650; "src=" Http://i.imgur.com/NsFAEqz.png "alt=" Nsfaeqz.png "/>
Start: Systemctl start Mariadb.service
650) this.width=650; "src=" Http://i.imgur.com/hOrx7Rx.png "alt=" Horx7rx.png "/>
Initialization: mysql_secure_intallation (securing MySQL server)
650) this.width=650; "src=" Http://i.imgur.com/lzNW7Es.png "alt=" Lznw7es.png "/>
Set root password, prohibit anonymous user login, disable remote login, delete test library,
Verify: Mysql-u ' root '-h ' localhost '-p ' password ';(login with root account verification)
650) this.width=650; "src=" Http://i.imgur.com/52BDonL.png "alt=" 52bdonl.png "/>
4.php+mysql Connection command: Yum-y install Php-mysql (Installation php-mysql)
650) this.width=650; "src=" Http://i.imgur.com/I64cfBn.png "alt=" I64cfbn.png "/>
Verify: Create index.php (write on test Database connection code) under/var/www/html and access
650) this.width=650; "src=" Http://i.imgur.com/IjpkDnd.png "alt=" Ijpkdnd.png "/>650" this.width=650; "src=" http:// I.imgur.com/bvv5cvr.png "alt=" Bvv5cvr.png "/>
Second, lamp (PHP-FPM)
1. Install Apache on Host a
Ditto
2. Install PHP command on Host B: yum-y install PHP-FPM
650) this.width=650; "src=" Http://i.imgur.com/ROxqzQM.png "alt=" Roxqzqm.png "/>
Configuration: vim/etc/php-fpm.d/www.conf file, change the following configuration
650) this.width=650; "src=" Http://i.imgur.com/3bzWqkw.png "alt=" 3bzwqkw.png "/>
Start: Systemctl start Php-fpm.service
650) this.width=650; "src=" Http://i.imgur.com/tYlTOtd.png "alt=" Tyltotd.png "/>
3. Configure the forwarding profile configuration on the Web server: vim/etc/httpd/conf.d/fcgi.conf
650) this.width=650; "src=" Http://i.imgur.com/ygvKohK.png "alt=" Ygvkohk.png "/>
The second statement defines all the. PHP requests that will access the current Web server map to the PHP-FPM server.
Test: Create a new index.html file on the Web server, create a new index.php file in the same directory on the PHP server, and Access
650) this.width=650; "src=" Http://i.imgur.com/UoD1Oco.png "alt=" Uod1oco.png "/>650" this.width=650; "src=" http:// I.imgur.com/grd5k5j.png "alt=" Grd5k5j.png "/>
4. Install MySQL, php-mysql
Ditto
Test: Create a new PHP page on PHP-FPM to test the connection database, visit the Web server to see if you can access the
650) this.width=650; "src=" Http://i.imgur.com/IqYvdmN.png "alt=" Iqyvdmn.png "/>650" this.width=650; "src=" http:// I.imgur.com/bm7m6xl.png "alt=" Bm7m6xl.png "/>
5. Test WordPress on PHP-FPM host/www/fcgi/test/unzip WordPress, and configure the wp-config.php file
650) this.width=650; "src=" Http://i.imgur.com/f0PS5c8.png "alt=" F0ps5c8.png "/>
Create a new library, user, and authorization on the MySQL server
650) this.width=650; "src=" Http://i.imgur.com/IJepZrR.png "alt=" Ijepzrr.png "/>650" this.width=650; "src=" http:// I.imgur.com/gjyywdc.png "alt=" Gjyywdc.png "/>650" this.width=650; "src=" Http://i.imgur.com/6d6yBSa.png "alt=" 6d6ybsa.png "/>650) this.width=650;" src= "Http://i.imgur.com/dbwzRwF.png" alt= "Dbwzrwf.png"/>
Access test: 172.16.1.45/wordpress
650) this.width=650; "src=" Http://i.imgur.com/DxfG4Y0.png "alt=" Dxfg4y0.png "/>
Linux Lamp Setup