centos6.4+apache+mariadb+php Build WordPress

Source: Internet
Author: User
Tags bz2 install php

----LAMP ==> Linux Apache Mariadb PHP


-----Preparation Before installation:

Yum-y install gcc gcc-c++ zlib libxml2-devel libxml2 libmcrypt libmcrypt-devel libltdl libltdl-devel libpng libpng-devel FreeType autoconf gd gd-devel ncurses*--install jpegwget HTTP://WWW.IJG.ORG/FILES/JPEGSRC.V9A.TAR.GZTAR-ZXVF JPEGSRC.V9A.TAR.GZCD jpeg-9a/./configure--prefix=/data/server/jpegmakemake Install


------------Installing MARIADB

Create mariadb Run Account:

Groupadd mysqluseradd mysql-g MySQL

To compile mariadb you need to use CMake

Yum-y Install CMake

If not, then go to the official website to download the latest: http://www.cmake.org/

Tar XF cmake-x.x.tar.gzcd cmake-x.x./bootstrapmake && make install



1. SOURCE Installation:

wget HTTP://MIRROR.MEPHI.RU/MARIADB/MARIADB-10.0.14/SOURCE/MARIADB-10.0.14.TAR.GZTAR-ZXVF MARIADB-10.0.14.TAR.GZCD Mariadb-10.0.14cmake. -dcmake_install_prefix=/data/server/mariadb-dmysql_datadir=/data/mariadb-dwith_federated_storage_engine=1- Dwith_ssl=system make && make install


2.yum Installation:

The content of this file is the reference website, and generated from the official website, the specific address of the installation source warehouse is:

https://downloads.mariadb.org/mariadb/repositories/

Add the following code to the Yum Source:

# MariaDB 10.1 CentOS repository list-created 2014-12-03 03:10 utc# Http://mariadb.org/mariadb/repositories/[mariadb]na me = Mariadbbaseurl = Http://yum.mariadb.org/10.1/centos6-x86gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

Yum-y install mariadb-server mariadb-clientservice mysql startmysql-uroot-p# default password is empty


[[email protected] ~]# mysql -uroot -penter password: welcome to  The mariadb monitor.  commands end with ; or \g.your mariadb  connection id is 3Server version: 10.1.0-MariaDB MariaDB  servercopyright  (c)  2000, 2014, oracle, skysql ab and others. type  ' help; '  or  ' \h '  for help. Type  ' \c '  to clear the current input  statement. mariadb [(None)]> mariadb [(None)]> mariadb [(none)]> show  databases;+--------------------+| database            |+--------------------+| information_schema | |  mysql              | |  performance_schema | |  test               |+--------------------+4 rows in  set  (0.00 sec) mariadb [(none)]> mariadb [(none)]> status;----------- ---mysql  ver 15.1 distrib 10.1.0-mariadb, for linux  (i686)  using  readline 5.1connection id:          7current  database:current user:           [email  protected]SSL:                     Not in useCurrent pager:           stdoutUsing outfile:           ' ' using delimiter:        ; Server:                 mariadbserver version:          10.1.0-MariaDB MariaDB ServerProtocol version:        10Connection:              localhost via unix socketserver characterset:    latin1db      characterset:    latin1Client characterset:     utf8conn.  characterset:    utf8unix socket:             /var/lib/mysql/mysql.sockUptime:                  7 min 56 secthreads: 1   questions: 20  slow queries: 0  opens: 0  flush  tables: 1   open tables: 26  queries per second avg: 0.042-------------- 


To change the root password:

mysqladmin-u root password ' test123 '

To modify the data storage directory:

Service MySQL Stop

To create a new DB directory:

Mkdir/data/mariadb

Copy the default database to a new location:

Cp-a/var/lib/mysql/data/mariadb

To back up the original configuration file:

Cp-a/etc/my.cnf/etc/my.cnf_bak # The file is just a contained statement, and the real backup is the following file: Cp/etc/my.cnf.d/server.cnf/etc/my.cnf.d/server.cnf_ Bak
CAT/ETC/MY.CNF.D/SERVER.CNF |grep-v ^#[server][mysqld]datadir =/data/mariadb/mysqlsocket =/var/lib/mysql/ Mysql.sock character_set_server = UTF8 [embedded][mariadb][mariadb-10.1]service mysql start #启动Mariadb



------------Installing Apache

wget http://apache.communilink.net//httpd/httpd-2.4.10.tar.bz2

wget http://ftp.cuhk.edu.hk/pub/packages/apache.org//apr/apr-1.5.1.tar.bz2

wget http://ftp.cuhk.edu.hk/pub/packages/apache.org//apr/apr-util-1.5.4.tar.bz2


TAR-JXF apr-1.5.1.tar.bz2cd apr-1.5.1./configure--prefix=/data/server/apr--disable-ipv6make && make INSTALLTAR-JXF APR-UTIL-1.5.4.TAR.BZ2CD apr-util-1.5.4./configure--prefix=/data/server/apr-util--with-apr=/data/ Server/aprmake && make installtar-jxf httpd-2.4.10.tar.bz2cd httpd-2.4.10./configure--prefix=/data/server/ Apache--enable-http--enable-ssl--enable-vhost-alias--enable-rewrite--with-apr=/data/server/apr--with-apr-util= /data/server/apr-utilmakemake Install

Test:

[Email protected] opt]# Curl http://127.0.0.1/

-----------Install PHP

wget http://hk1.php.net/distributions/php-5.6.3.tar.bz2tar-jxf PHP-5.6.3.TAR.BZ2CD php-5.6.3./configure--prefix=/ data/server/php--with-apxs2=/data/server/apache/bin/apxs--disable-ipv6--with-zlib--with-gd--with-jpeg-dir=/ Data/server/jpeg--with-png-dir--with-zlib-dir--with-freetype-dir--with-mysql--with-mysqli-- Enable-embedded-mysqli--enable-zip--enable-mysqlnd--with-gdmakemake INSTALLCP./php.ini-production/data/server/ Php/lib/php.ini


To modify the default time zone for PHP:

Vim/data/server/php/lib/php.inidate.timezone = Asia/shanghai # Remove the parameter comment and set the time zone for Asia Shanghai

Modify the Apache configuration file so that it can parse the PHP program:

AddType application/x-httpd-php. php# Add the row to the appropriate place <ifmodule Dir_module>directoryindex index.html index.php# Add: Index.php</ifmodule>loadmodule php5_module modules/libphp5.so# generally added by default, if not, you manually add to the appropriate place


-----Create a database:

MariaDB [(None)]> CREATE database WordPress;  MariaDB [(None)]> grant all privileges on wordpress.* to [email protected] ' localhost ' identified by "[email protected]" with GRANT option; MariaDB [(None)]> flush privileges;

-----Create WordPress

wget https://cn.wordpress.org/wordpress-4.0.1-zh_CN.tar.gztar-zxf wordpress-4.0.1-zh_cn.tar.gzcp-ar WordPress/ data/www/

Http://localhost/wordpress/wp-admin

Fill in the database information, submit, 2 minutes OK



This article is from the "Bug" blog, please be sure to keep this source http://chongzi100.blog.51cto.com/340243/1591485

centos6.4+apache+mariadb+php Build WordPress

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.