CentOS 7.x Installation Lamp

Source: Internet
Author: User

CentOS 7.x installation Apache[[email protected] ~] #yum-y install httpd httpd-devel[email protected] ~]# systemctl start httpd[email protected] ~]# Systemctl enable httpdCentOS 7.x installation Mariadb database[email protected] ~]# yum-y install mariadb mariadb-server mariadb-libs mariadb-devel[ email protected] ~]# systemctl start mariadb [[email protected] ~]# Systemctl enable MARIADBDatabase security settings:[email protected] ~]# mysql_secure_installationLogin Database:[email protected] ~]# mysql-uroot-pcentos7.x installing PHP7 with Yum1. Installing Epel-releaseby command:yum-y Install Epel-releasesuccessfully installed. 2. Installing PHP7The terminal runs the following command again:RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm successfully acquires the PHP7 Yum Source, and then executes:yum-y Install php70wcentos7.x installing php7.2 with Yum1. If you have previously installed a lower version of PHP, first uninstall:[[email protected] ~] #yum-y remove php*2, because the Linux yum source does not exist php7.x, so we want to change the Yum sourceRPM-UVH https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm RPM-UVH https:// mirror.webtatic.com/yum/el7/webtatic-release.rpm 3, yum install php72w and various expansion modules, choose their own needs canyum-y Install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring PHP7 2w-mysqlnd Php72w-opcache php72w-pdo php72w-xml4, finally, write a PHP probe pointer, test PHP:[[email protected] ~] #cd/var/www/html/[[email protected] ~] #vi info.php<?phpphpinfo ();?>Save and exit5. Restart the Apache server:[email protected] ~]# systemctl restart httpd6. Visit http://localhost/info.php* Associate PHP with a database:[[email protected] ~] #yum Install Php-mysqlCentOS 7.x Installation phpMyAdmin1, install Epel First, otherwise the package will appear when installing Pgpmyadmin. [email protected] ~]# Yum install epel-release[email protected] ~]# RPM-IVH http://rpms.famillecollet.com/enterprise/remi-release-7.rpm 2, [[email protected] ~]# sudo yum install phpMyAdmin3. Open the PhpMyAdmin configuration file (path:/etc/httpd/conf.d/phpmyadmin.conf) with a text editor and locate and comment out the line of code with the word "Require IP XXXX". There will be lines of code like this, replaced with "Require all granted"[email protected] ~]# sudo vi/etc/httpd/conf.d/phpmyadmin.confModified file Content
  1. <Directory/usr/share/phpMyAdmin/>
  2. Adddefaultcharset UTF-8
  3. <ifmodule mod_authz_core.c>
  4. # Apache 2.4
  5. <RequireAny>
  6. # Require IP 127.0.0.1 #注释掉
  7. # Require IP:: 1 #注释掉
  8. Require all granted #新添加
  9. </RequireAny>
  10. </IfModule>
  11. <ifmodule!mod_authz_core.c>
  12. # Apache 2.2
  13. Order Deny,allow
  14. Deny from all
  15. Allow from 127.0.0.1
  16. Allow from:: 1
  17. </IfModule>
  18. </Directory>
  19. <Directory/usr/share/phpMyAdmin/setup/>
  20. <ifmodule mod_authz_core.c>
  21. # Apache 2.4
  22. <RequireAny>
  23. #Require IP 127.0.0.1 #注释掉
  24. #Require IP:: 1 #注释掉
  25. Require all granted #新添加
  26. </RequireAny>
  27. </IfModule>
  28. <ifmodule!mod_authz_core.c>
  29. # Apache 2.2
  30. Order Deny,allow
  31. Deny from all
  32. Allow from 127.0.0.1
  33. Allow from:: 1
  34. </IfModule>
  35. </Directory>
4, [[email protected] ~]# systemctl restart httpd

CentOS 7.x Installation Lamp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.