linux+apache2.4+php5.6+mysql5.6 Source Installation Steps

Source: Internet
Author: User
Tags install php fully qualified domain name

First, install Apache

To install the Apache server software, you need to install several dependent software

apr-1.4.6.tar.gz:http://apr.apache.org/

apr-util-1.4.1.tar.gz:http://apr.apache.org/

pcre-8.20.tar.gz:http://www.pcre.org/

httpd-2.4.10.tar.gz:http://httpd.apache.org/download.cgi

Download the above software to a custom directory such as:/home/cc/apache and unzip each package separately

1, Install Apr (the following software is installed by default directory:/usr/local/)

TAR-ZXVF apr-1.5.1.tar.gzcd apr-1.5.1./configure--prefix=/usr/local/aprmake && make install

2, Installation Apr-util

TAR-ZXVF apr-util-1.5.4.tar.gzcd apr-util-1.5.4./configure--prefix=/usr/local/apr-util/--with-apr=/usr/local/apr /make && make Install

3, Installation Pcre

Tar pcre-8.36.tar.gzcd. /pcre-8.36./configure--prefix=/usr/local/pcremake && make install

4. Installing Apache

TAR-ZXVF httpd-2.4.10.tar.gz CD httpd-2.4.10./configure--prefix=/usr/local/apache/--with-apr=/usr/local/apr/-- with-apr-util=/usr/local/apr-util/--with-pcre=/usr/local/pcre/make && make install

  

Error and Workaround:

1, AH00558:httpd:Could not reliably determine the server ' s fully qualified domain name, using 127.0.0.1. Set the ' ServerName ' directive globally to suppress this message

Workaround
#ServerName www.example.com:80
ServerName localhost:80

2, (98) address already in use:AH00072:make_sock:could not bind to Address 0.0.0.0:80
No listening sockets available, shutting down

Workaround:
Check to see which app is taking up 80 ports:
NETSTAT-TULNP | grep ': 80 ' or Ps-ef | grep httpd
Kill ' PID ' or killall-9 httpd

Second, install MySQL

After the MySql5.5 version is required to install the source code with the CMake command compiled, so it needs to be installed on the system CMake

mysql-5.6.19.tar.gz:http://dev.mysql.com/downloads/mysql/(select Source Code)
make-4.0.tar.gz:http://ftp.gnu.org/gnu/make/
GCC 4.8.3:http://www.gnu.org/software/gcc/
(The above two Linux system comes with, so generally do not need to download the installation again)
cmake-3.0.2.tar.gz:http://www.cmake.org/download/
bison-3.0.tar.gz:http://www.gnu.org/software/bison/
ncurses-5.9.tar.gz:http://www.gnu.org/software/ncurses/

TAR-ZXVF mysql-5.6.19.tar.gz
    CD mysql-5.6.19 The following is a line here in order to facilitate the understanding and comments written in line-wrapping comments, the actual compilation in the line before the newline with "\" link, the following code can directly copy the paste Cmake-dcmake_install_prefix=/usr/local/mys Ql-dmysql_datadir=/usr/local/mysql/data-dsysconfdir=/etc-dwith_myisam_storage_engine=1-dwith_innobase_storage_ Engine=1-dwith_memory_storage_engine=1-dwith_readline=1-dmysql_unix_addr=/var/lib/mysql/mysql.sock-dmysql_tcp_ Port=3306-denabled_local_infile=1-dwith_partition_storage_engine=1-dextra_charsets=all-ddefault_charset=utf8- Ddefault_collation=utf8_general_cimake && make install (this process takes half an hour) Cd/usr/local/mysqlchown-r Mysql:mysql. (Please note the point number)./scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/datachown-r Root:mysql. (Please note the dot) chown-r mysql:mysql./datachmod-r ug+rwx. (Note the dot) #cp support-files/my-medium.cnf/etc/my.cnf (original old version is this operation, 5.6. Version 12 is the following file address) CP Support-files/my-default.cnf/etc /MY.CNF (and/etc/my.cnf +x permissions to delete other users ' write permissions at the same time) vi/etc/my.cnf edit my.cnf configuration file Default-storage-engine=myisamexplicit_defaults_For_timestamp=true (here is used to turn on caching)
   

Start the MySQL service
/usr/local/mysql/bin/mysqld_safe--user=mysql &

#将mysql的启动服务添加到系统服务中
CP Support-files/mysql.server/etc/init.d/mysql

#让chkconfig管理mysql服务
Chkconfig--add MySQL

#开机启动
Chkconfig MySQL on

Start the MySQL service
Service MySQL Start

To modify the root user password
/usr/local/mysql/bin/mysqladmin-u Root Password

When creating a new user, the error resolution method:
Open MY.CNF, find
Sql_mode= "Strict_trans_tables,no_auto_create_user,no_engine_substitution"
Revision changed to
Sql_mode=no_auto_create_user,no_engine_substitution
Then restart MySQL

Third, install PHP

        TAR-ZXVF php-5.5.13.tar.gzcd php-5.5.13./configure--prefix=/usr/local/php/--with-apxs2=/usr/local/apache/bin/ Apxs--with-config-file-path=/usr/local/lib--with-mysql=/usr/local/mysql--enable-track-vars--with-xmlmake & & Make Install  

1. CP Php.ini-production/usr/local/php/lib/php.ini
2, vim/usr/local/apache/conf/httpd.conf
Add the following addtype to the existing AddType (no PHP text will be parsed without the following statement)
addtypeapplication/x-httpd-php

<ifmodule dir_module>
DirectoryIndex index.html index.php//Home Index Add index.php
</IfModule>

LoadModule Php5_module modules/libphp5.so

linux+apache2.4+php5.6+mysql5.6 Source Installation Steps

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.