LAMP

LAMP


    L: linux

   A: Apache(httpd)

   M: Mysql/MariaDB

   P:PHP/Perl/Python/


  Fast architectural solution for LAMP combination:

        http and php are integrated through modules;


  LAMP architecture order:

       1. Install the corresponding package;

          Cent OS 6:

                   yum  -y install  httpd   mysql-server  php  php-mysql

  

          Cent OS 7:

                   yum  -y install  httpd   mariadb-server  php   php-mysql

       

       2. Create a virtual host;

          1) cd  /etc/httpd/conf.d

                vim host2.conf

       QQ screenshot 20180504181504.png      

             

            2) Create the corresponding directory:

                 # mkdir -pv  /myvhost/vhost2

                     vim  /mymyvhost/vhost2/index.php

                        vhost2 <br>
                       <?php
                            phpinfo();
                       ?>

                After editing, test the PHP function on the web side:

                If successful, do a PHP database connection test:

                  Edit file:

                     vim  /mymyvhost/vhost2/index.php  

                        vhost2 <br>
                        <?php
                            $y = mysql_connect('172.16.1.25','myuser','123456');

                             if($y)

                               echo "yes";

                             else

                                echo "no";

                         ?>

                   web test:

                QQ screenshot 20180504183422.png

                    test was successful


         Note: the user 'myuser' needs to be authorized in the database

                      which is:

                      mysql>  grant  all on  *.*  to 'myuser'@'172.16.%.%'  identified  by  '123456'


            

         1. Deploy the blog system:

                    Put the compressed package of the blog system under /myvhost/vhost2/

                    After decompression:

                    Access with the web side:  

QQ screenshot 20180504185055.png 


                 Then click the start now icon to log in, and then publish the blog post;



         Deploy the forum system: the same blog

             Web access:

     QQ screenshot 20180504190155.png 

     Click the "I agree" icon to operate;

     Note: If garbled characters appear, modify the main configuration file of httpd (/etc/httpd/conf/httpd.conf): Disable AddDefaultCharset UTF-8,

               Add AddDefaultCharset GB2312;



     Deploy the database system: operate the same as above

       After logging in:

   QQ screenshot 20180504191323.png


  Then check locally whether the table is added successfully:

         # mysql  -p123456

            use ytc

   QQ screenshot 20180504191723.png

  The ball table was added successfully;

        

    

     

              

                   


 

                

 





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325297382&siteId=291194637