Build-and-Install lamp architecture---modularity

Source: Internet
Author: User
Tags mysql commands

First, package and installation environment preparation

1. Program version:

Apr-1.5.0.tar.bz2apr-util-1.5.3.tar.bz2httpd-2.4.10.tar.bz2mariadb-5.5.43-linux-x86_64. Tar.gzphp-5.6.4.tar.xzphpmyadmin-4.0.5-all-languages.zipdiscuz_x3.2_sc_gbk.zip

2, ready to install the development environment

Yum Groupinstall "Server Platform Development" "Development tools"-yyum install Pcre-devel-yyum install bzip2-devel Li Bmcrypt-devel-yyum Install Libxml2-devel-y

Second, install LAMP Schema Program

installing on a single host LAMP architecture, providing BBS Forum Business and managing MySQL database through browser .

1 , installation httpd program

1) Install httpd program dependent Apr Package

Tar XF apr-1.5.0.tar.bz2cd apr-1.5.0./configure--prefix=/usr/local/aprmake && make install

2) Install httpd program dependent apr-util Package

Tar XF apr-util-1.5.3.tar.bz2 cdapr-util-1.5.3./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/ make&& make Install

3) Install the HTTP Package

[Email protected] httpd-2.4.10]#/configure--prefix=/usr/local/apache-2.4.10--sysconfdir=/etc/ APACHE24--WITH-APR=/USR/LOCAL/APR--with-apr-util=/usr/local/apr-util/--enable-so--enable-ssl--enable-cgi-- Enable-rewrite--with-zlib--with-pcre--enable-modules=most--enable-mpms-shared=all--with-mpm=prefork[[email Protected] httpd-2.4.10]# make &&make Install

4) Create apahce Soft link

[Email protected] ~]# ln-s/usr/local/apache-2.4.10//usr/local/apache[[email protected] ~]# ll/usr/local/ apachelrwxrwxrwx 1 root root 3 11:27/usr/local/apache->/usr/local/apache-2.4.10/

5) Provide service script /etc/rc.d/init.d/httpd

Modify the httpd configuration file to specify the PID file storage path Pidfile "/var/run/httpd.pid" service script through the replication system of the original HTTPD service script, based on this simple modification, the content of the changes are as follows: [email         Protected] ~]# cp/etc/rc.d/init.d/httpd/etc/rc.d/init.d/httpd24 apachectl=/usr/local/apache/bin/apachectl HTTPD=${HTTPD-/USR/LOCAL/APACHE/BIN/HTTPD} added to the start-up service: [[email protected] ~]# chkconfig--add httpd24[[email Protected] ~]# chkconfig httpd24 on

6) Setting httpd Environment Variables

[Email protected] httpd-2.4.10]# vim/etc/profile.d/httpd.sh path=/usr/local/apache/bin/: $PATH [[email protected] H ttpd-2.4.10]#./etc/profile.d/httpd.sh

2 , installing the Universal binary MariaDB

1) Create a MariaDB running user

[[email protected] ~]# groupadd-r mysql[[email protected] ~]# useradd-r-g MySQL MySQL

2) Create a database hosting directory and set up the owner, genus Group

[Email protected] ~]# mkdir/data/mysql-p[[email protected] ~]# chown-r mysql.mysql/data/mysql/

3) Unzip the MariaDB package into the/usr/local directory

[Email protected] tools]# tar xfmariadb-5.5.43-linux-x86_64.tar.gz-c/usr/local/

4) Create a soft link

[Email protected] tools]# cd/usr/local/[[email protected] local]# Ln-smariadb-5.5.43-linux-x86_64/mysql

5) Initializing the database

[[Email protected] local]# CD Mysql[[email protected] mysql]# chown-r root.mysql./*[[email protected] MySQL] #scripts/my sql_install_db--datadir=/data/mysql/--user=mysql

6) Provide MySQL master configuration file

[Email protected] mysql]# mkdir/etc/mysql[[email protected] mysql]# cpsupport-files/my-large.cnf/etc/mysql/my.cnf

7) Edit the/etc/mysql/my.cnf configuration file

Add the database storage directory to the [Mysqld] tab in the/ETC/MYSQL/MY.CNF configuration file .

DataDir =/data/mysql

8) providing service scripts for MySQL

[Email protected] mysql]# cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld[[email protected] mysql]# chmod +x/etc /rc.d/init.d/mysqld[[email protected]2 mysql]# chkconfig--add mysqld[[email protected] mysql]# chkconfig mysqld on

9) Setting environment variables for mysql command

[Email protected] mysql]# vim/etc/profile.d/mysql.sh path=/usr/local/mysql/bin: $PATH [[email protected] mysql]#. etc/profile.d/mysql.sh

set the man help manual for MySQL commands

Add the following line in the /etc/man.cnf

Manpath/usr/local/mysql/man

) export mysql header file to /usr/include

[[email protected] mysql]# ln-s/usr/local/mysql/include/mysql//usr/include/12) output MySQL library file [[email protected] mysql]# echo '/usr/local/mysql/lib ' >/etc/ld.so.conf.d/mysql.conf[[email protected] mysql]# ldconfig

3 , compile and install PHP

1) Compile and install PHP

Tar XF php-5.6.4.tar.xzcd php-5.6.4./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql-- With-openssl--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir --with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--enable-sockets--with-apxs2=/usr/local/apache/bin/ Apxs--with-mcrypt--WITH-CONFIG-FILE-PATH=/ETC/PHP--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP/PHP.D--with-bz2-- Enable-maintainer-ztsmake && make Install

2) Provide php configuration file

[Email protected] php-5.6.4]# mkdir/etc/php/php.d-p[[email protected] php-5.6.4]# cpphp.ini-production/etc/php/ Ini

3) Edit Apache config file httpd.confto apahce support PHP

Add the following two lines to the /etc/apache24/httpd.conf:

AddType application/x-httpd-php. Phpaddtype Application/x-httpd-php-source.phps

Navigate to DirectoryIndex:

DirectoryIndex index.php index.html

Third, the configuration LAMP

1, decompression Discuz and phpMyadmin program

[[email protected] tools] #mkdir/web[[email protected] tools]# unzipdiscuz_x3.2_sc_gbk.zip[[email protected] tools]# MV upload//web/discuz[[email protected] tools]# unzipphpmyadmin-4.0.5-all-languages.zip[[email protected] tools]# MV Phpmyadmin-4.0.5-all-languages/web/pma

2, provide httpd virtual machine for www.blog.com and www.phpmysql.com

Modify The/etc/apache24/httpd.conf configuration file to open the virtual file:

Include/etc/apache24/extra/httpd-vhosts.conf

in the edit /etc/apache24/extra/httpd-vhost.conf file, the contents are as follows:

<VirtualHost *:80>   ServerAdmin [email protected]    documentroot  "/web/discuz"    servername www.bbs.com   serveralias  bbs.com   ErrorLog  "Logs/bbs.com-error_log"    CustomLog  "logs/ Bbs.com-access_log " combined   <Directory "/web/discuz ">      AllowOverride None     Options None      require all granted  </directory></virtualhost> <virtualhost  *:80>   ServerAdmin [email protected]   DocumentRoot  "/ WEB/PMA "   servername www.phpmysql.com   serveralias phpmysql.com    ErrorLog  "Logs/phpmysql.com-error_log"    CustomLog  "logs/ Phpmysql.com-access_log "&NBSP;COMBINED&NBSP;&NBSP;&Nbsp;<directory  "/WEB/PMA" >     AllowOverride None      Options None     Require all granted   < /directory></virtualhost>

3.Reload The configuration file for the HTTPD service

[Email protected] extra]# service HTTPD24 Reload

4, add the database for BBS and set up the user name and password to manage MySQL

mariadb [(None)]> create database bbs; query ok, 1 row affected  (0.00 sec) mariadb [(none)]> GRANT ALL  on bbs.* to ' Userbbs ' @ ' localhost '  IDENTIFIED BY  ' bbspass '; query ok, 0 rows affected  (0.00 sec) mariadb [(none)]> GRANT  All on bbs.* to ' Userbbs ' @ ' 127.0.0.1 '  IDENTIFIED BY  ' bbspass '; query ok, 0 rows affected  (0.00 sec) mariadb [(none)]> SET  Password for ' root ' @ ' localhost '  =password (' MySQL '); query ok, 0 rows affected  (0.05 sec) mariadb [(none)]> SET  Password for ' root ' @ ' 127.0.0.1 '  =password (' MySQL '); query ok, 0 rows affected  (0.00 sec) mariadb [(none)]> FLUSH  privileges; query ok, 0 rows affected  (0.00&NBSP;SEC)

Four, browse BBS and PHPMyAdmin

1, edit the client's hosts file, add the following content

172.16.9.21 www.bbs.com172.16.9.21 www.phpmysql.com

2.set permissions and genus for the corresponding directories in the/web/discuz directory

[Email protected]~]# cd/web/discuz/[[email protected] discuz]# chown-r. daemon./config/data/uc_client/uc_server/[[e Mail protected] discuz]# chmod g+w-r./config/data/uc_client/uc_server/

3. Enter www.bbs.comin the input browser to start initializing bbs, enter the corresponding database name and password, click Install. You can start to decorate the BBS.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/78/wKioL1VKDu_RDmmjAAvWeH443tg409.bmp "title=" Snap12.bmp "alt=" Wkiol1vkdu_rdmmjaavweh443tg409.bmp "/>

4, in the browser input www.phpmysql.com, using the root username login, password for MySQL, log on to manage the MySQL database.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/78/wKioL1VKDyuh01Z3AAvOPGRxzxI251.bmp "title=" Snap15.bmp "alt=" Wkiol1vkdyuh01z3aavopgrxzxi251.bmp "/>


This article is from the "Wu Tai Wan" blog, please be sure to keep this source http://wuday.blog.51cto.com/2623944/1643603

Build-and-Install lamp architecture---modularity

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.