The above has been introduced: Lamp construction:
http://itwolf.blog.51cto.com/3286625/1385137
However, the integration environment is used. But there are times when we need to configure the relevant environment for ourselves, so that we are more familiar with how the various components work, and more highly configurable. Direct start:
mysql:http://dev.mysql.com/downloads/mysql/
My version:Mysql-5.6.24-1.linux_glibc2.5.x86_64.rpm-bundle.tar
apache:http://apache.mirrors.lucidnetworks.net/httpd/
My version:httpd-2.4.12.tar.gz
Apache protable Runtime (Apr dependent packet Also, all in this connection): http://apache.osuosl.org//apr/
My version:
Apr-1.5.2.tar.gz
Apr-util-1.5.4.tar.gz
pcre-8.37.tar.gz ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
Here to pay attention is to install pcre, do not download pcre2 version, or change the name or configuration, change things more troublesome, but also some people do not install, but I recommend installation, regular Ah, there is no say I choose to install.
php:http://php.net/downloads.php
My version:php-5.5.25.tar.gz
Configuration XML Components LIBXML2: Official ftp://xmlsoft.org/libxml2/
In addition, my CentOS7 has been updated
650) this.width=650; "title=" 2015-05-20 10_09_40-centos64-vmware workstation.png "alt=" Wkiol1vb7vfa2en9aadml2smdig747.jpg "src=" Http://s3.51cto.com/wyfs02/M02/6D/10/wKioL1Vb7vfA2eN9AADMl2smdIg747.jpg "/>
before installation :
Install GCC & gcc-c++ with Apache on the back, just put it on first.
Yum install-y gcc gcc-c++
Describes the hardware environment and the files to be installed, starting with the installation:
install MySQL
One thing to tell before installing, here is the warning from the official:
Warning
Once the release package was installed on your system, any system-wide update by the Yum Update command would automatically Upgrade MySQL packages on your system and also replace any native third-party packages, if Yum finds replacements for them In the MySQL Yum repository. See upgrading MySQL with the MySQL Yum Repository and replacing a Native third-party distribution of MySQL for details.
Presumably, if you install this version of the package, as long as you update the system with the Yum update command, MySQL is automatically updated to the latest version, including some packages that replace the third party, However, two connections are also given to help us update MySQL and update the third party package.
# RPM-IVH mysql-devel-5.6.24-1.linux_glibc2.5.x86_64.rpm# RPM-IVH mysql-server-5.6.24-1.linux_glibc2.5.x86_64.rpm# RPM-IVH mysql-client-5.6.24-1.linux_glibc2.5.x86_64.rpm
To view the following installed version information:
#mysql--versionmysql Ver 14.14 distrib 5.6.24, for Linux (x86_64) using Editline Wrapper
To view the MARIADB information that has been installed:
#yum list *maria*mariadb.x86_64 1:5.5.41-2.el7_0 @basemariadb-libs.x86_64 1:5.5.41-2.el7_0 @bas emariadb-server.x86_64 1:5.5.41-2.el7_0 @base
Let's try it out:
#mysqlERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
OK, forget to start the service, to start our mariadb service.
#systemctl start Mariadb.service#systemctl enable Mariadb.service #因为mariadb服务启动正常, set mariadb to boot automatically.
Then make the MARIADB security settings:
# sudo mysql_secure_installation/usr/mysql_secure_installation: line 379: find_mysql_ Client: command not foundnote: running all parts of this script is recommended for all mariadb servers in production use! please read each step carefully! In order to log into mariadb to secure it, we ' ll need The currentpassword for the root user. if you ' ve just Installed mariadb, andyou haven ' t set the root password yet, the password will be blank,so you should just press enter here. enter current password for root (Enter for none):ERROR 1045 ( 28000): access denied for user ' root ' @ ' localhost ' (using password: no) enter current password for root (enter for none): Ok, successfully used password, moving on ... setting the root password ensures that nobody can log into The mariadbroot user without the proper authorisation. you already have a root password set, so you can safely answer ' n '. Change the root password? [y/n] n ... skipping. by default, a mariadb installation has an anonymous user, allowing anyoneto log into mariadb without having to have a user account created forthem. this is intended only for Testing, and to make the installatioNgo a bit smoother. you should remove them before moving into aproduction environment. remove anonymous users? [y/n] y ... success! normally, root should only be allowed to connect from ' localhost ' . thisensures that someone cannot guess at the root Password from the network. disallow root login remotely? [y/n] y ... success! by default, mariadb comes with a database named ' Test ' that anyone canaccess. this is also intended only for testing, And should be removedbefore moving into a production environment. remove test database and access to it? [y/n] y - dropping& NBsp;test database... ... success! - removing privileges on test database... ... success! Reloading the privilege tables will ensure that all changes made so farwill take effect immediately. reload privilege tables now? [y/n] yerror 1146 (42S02) at line 1: Table ' mysql.servers ' doesn ' t exist ... failed! Cleaning up ... All done! if you ' ve completed all of the above steps, Your mariadbinstallation should now be secure. thanks for using mariadb!
Inside the specific settings themselves see the situation settings, my only for reference.
Now let's come in and try it:
# mysql-u Root-penter Password:welcome to the MariaDB Monitor. Commands End With; or \g.your MariaDB connection ID is 24Server version:5.5.41-mariadb MariaDB servercopyright (c) +, Oracle, Maria DB Corporation Ab and others. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. MariaDB [(None)]>
Ok,mysql installation is complete,
Also note that joining your system firewall open, please note that for MySQL open 3306 port.
But we're only going to finish the first step.
Install our fighter (Apache)
#gzip-D httpd-2.4.12.tar.gz#tar xvf HTTPD-2.4.12.TAR#CD httpd-2.4.12
To start compiling and installing:
#./configure--prefix=/usr/local/apachechecking for chosen layout ... Apachechecking for working mkdir-p ... yeschecking for grep that handles long lines and-e .../usr/bin/grepchecking for eg Rep ... /usr/bin/grep-echecking build system Type ... x86_64-unknown-linux-gnuchecking host system type ... x86_64- Unknown-linux-gnuchecking target system type ... x86_64-unknown-linux-gnuconfigure:configure:configuring Apache Portable Runtime library...configure:checking for APR ... Noconfigure:error:APR not found. Please read the documentation.
If the APR is missing, install an APR (which has already been downloaded at the beginning of the article and can be installed directly):
Install Apr:
#mkdir/USR/LOCAL/APR#TAR-ZXVF APR-1.5.2.TAR.GZ#CD apr-1.5.2#./configure--prefix=/usr/local/aprbalabala......# Make#make Install
OK, then apr-util:
#tar-zxvf apr-util.1.5.4.tar.gz#cd apr-util#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin /apr-1-config#make#make Install
Down is Prce:
# mkdir/usr/local/pcre# TAR-ZXVF pcre-8.37.tar.gz#/configure--prefix=/usr/local/pcre--with-apr=/usr/local/apr/ bin/apr-1-config# make# make Install
Well, these are the dependencies that have been installed and re-engaged in fighter jets.
# CD httpd-2.4.12#./configure--prefix=/usr/local/apache--with-pcre=/usr/local/pcre--WITH-APR=/USR/LOCAL/APR-- with-apr-util=/usr/local/apr-util# make# make Install
Normal finish, see normal not:
650) this.width=650; "title=" 2015-05-21 13_47_13-centos64-vmware workstation.png "src=" http://s3.51cto.com/wyfs02/ M02/6d/22/wkiol1vdc1ix42v7aafnrzlq8ei147.jpg "alt=" Wkiol1vdc1ix42v7aafnrzlq8ei147.jpg "/>
Install PHP
# TAR-ZXVF php-5.5.25.tar.gz# cd php-5.5.25# mkdir/usr/local/php#./configure--prefix=/usr/local/php--with-apxs2=/ Usr/local/apache/bin/apxs--with-config-file-path=/usr/local/lib--enable-track-var--with-xml--with-mysql-- With-zlib-dir=/usr/localconfigure:error:xml2-config not found. Please check your LIBXML2 installation.
Forget that our XML component is not yet installed.
# TAR-ZXVF libxml2-2.9.2.tar.gz# cd libxml2-2.9.2# mkdir/usr/local/libxml2#./configure--prefix=/usr/local/libxml2# Makelibxml.c:14:20:fatal error:python.h:no such file or directory #include <Python.h>
Look at the python package.
# Yum Search Python|grep python-develdbus-python-devel.i686:libraries and headers for dbus-pythondbus-python-devel.x86 _64:libraries and headers for dbus-pythongstreamer-python-devel.i686:headers in developing programs that'll usegstr Eamer-python-devel.x86_64:headers for developing programs that would usepython-devel.x86_64:the libraries and header fi Les needed for Python
Just a 64-bit, quickly loaded:
# yum Install python-devel.x86_64
All right, let's get our libxml2.
#./configure--prefix=/usr/local/libxml2#make#make Install
Eight wrong eight wrong, finished, then make:
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-config-file-path=/usr/local/ Lib--enable-track-var--with-xml--with-mysql--with-zlib-dir=/usr/localconfiguring SAPI modulesRunning System Checksgeneral settingsconfiguring extensionsconfigure:error:xml2-config not found. Please check your LIBXML2 installation.
Sweat, it's wrong again, see what else is libxml. Not installed and installed (mainly refers to: *-devel):
#yum list *libxml* #yum install libxml2-devel.x86_64
OK, and then the third time to install PHP, the result is the same as the previous one, so the bottom of this attempt to change some of the commands, please note:
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--WITH-LIBXML2=/USR/LOCAL/LIBXML2-- with-mysql=/usr/bin/mysqlconfiguring SAPI modulesrunning System checksgeneral settingsconfiguring Extensionsconfigure:error:Cannot find MySQL header files Under/usr/bin/mysql. Note that the MySQL client library isn't bundled anymore!
Check for MySQL-related not installed and installed:
# Yum list *mariadb*# yum install mariadb-devel.x86_64
I don't think I can put it all on, but I have to enlarge the Recruit:
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--WITH-LIBXML2=/USR/LOCAL/LIBXML2-- With-config-file-path=/usr
Very good, finished. But does anyone know why they can't find a specific path?
In short, let's Test it first:
Vim/var/www/info.php<?phpphpinfo ();? >
Just out of a blank page,
This article is from the "Wolf Soul" blog, please be sure to keep this source http://itwolf.blog.51cto.com/3286625/1653584
CentOS7 + Apache2.4 + Mysql5.5 + PHP5.5