One. Source code installation Apache
Install Apr first .
TAR–ZXVF apr- Version
Cd apr- Version
./configure--PREFIX=/USR/LOCAL/APR
Make
Make install
re-install Apr-util
TAR–ZXVF apr-util- Version
Cd apr-util- Version
./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR
Make
Make install
also need to install Pcre
Similar to the above
4. Installing Apache
TAR–ZXVF httpd– Version
Cd httpd– Version
./configure--help can see what the various options below are
./configure--prefix=/usr/local/apache--sysconfdir=/etc/httpd--enable-so--enable-rewrite--enable-cgi-- Enable-cgid--enable-modules=most--enable-mods-shared=most--ENABLE-MPMS-SHARED=ALL--WITH-APR=/USR/LOCAL/APR-- With-apr-util=/usr/local/apr-util
Make
Make install
two. CMake and Bison are required to compile the installation after installing the MySQL 5.5 version of the source code
official website default installation directory in /usr/local/mysql
First we start by creating the place where the data is stored mkdir–p/mysql/data(where it can be useful)
configuration file is /etc/my.cnf--/etc/mysql/my.cnf– process /my.cnf home directory /my.cnf total four
two . Installing CMake
Cd/usr/local/src
Tar zxvf cmake-2.8.5.tar.gz
cdcmake-2.8.5
./bootstrap
Make
Makeinstall
Cd.. /
Tar zxvf bison-2.5.tar.gz
cdbison-2.5
./configure
Make
Makeinstall
Cd.. /
three . Compile and install MySQL 5.5.15
TAR-ZXVF mysql-5.5.15.tar.gz–c/usr/local
ln–svmysql-5.5 MySQL
cdmysql-5.5.15/
start creating MySQL groups and users
Groupadd-g 306-r MySQL
Useradd–g 306–r–u 306 MySQL
for the security of the data, the owner and group changed to MySQL and changed to master root.
chown–rmysql.mysql/usr/local/mysql/*
Chown-r mysql/usr/local/mysql/*
Cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-DWITH_EXTRA_CHARSETS:STRING=UTF8,GBK \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_datadir=/mysql/data \
-dmysql_user=mysql
When such an error occurs,
Remove CMakeCache.txt and rerun CMake. On Debian/ubuntu,package name was Libncurses5-dev, on Redhat and derivates it was ncurses-devel.
Call Stack (Mostrecent call first):
cmake/readlinenanake:118 (find_curses)
cmake/readlinenanake:214 (Mysql_use_bundled_readline)
cmakelists.txt:257 (Mysql_check_readline)
--Configuringincomplete, errors occurred!
we should do rm–rfcmakecache.txt.
then execute yum–y install Ncurses-devel
Execute the command you just installed again.
Make
Makeinstall
three. We found mysql_install_db under the/usr/local/mysql/scripts/.
First, execute permissions on this script chmod o+x mysql_install_db
you can look at the usage of the script ./mysql_install_db–help
Modify the script again
Basedir= "/usr/local/mysql"
Builddir= "/usr/local/mysql"
Ldata= "/mysql/data"
Save exit
/mysql_install_db–user=mysql–datadir=/mysql/data will see after successful execution .
See the Manual for more instructions.
You can start the MySQL daemon with:
Cd/usr/local/mysql,/usr/local/mysql/bin/mysqld_safe &
You can test the MySQL daemon withmysql-test-run.pl
Cd/usr/local/mysql/mysql-test; perlmysql-test-run.pl
Problems with The/usr/local/mysql/scripts/mysqlbug script!
Four Let's start copying the configuration file.
all the configuration files are in /usr/local/mysql/support-files
Add Execute Permissions to mysql.server chmod o+x mysql.server
CP mysql.server/etc/init.d/mysqld ( copy )
There are four profiles starting with my-that are selected according to their memory size.
CP MY-HUGE.CNF/ETC/MY.CNF
You can add a service
Chkconfig--add mysqld
See if the service is added.
When you meet such a mistake
150520 6:26:00 [ERROR] Fatal error:please read "Security" section ofthe manual to find off how to run mysqld as root!
you need to add the [msyqld] module in the configuration file/etc/my.cnf User=mysql
Chkconfig--list mysqld
Five End
We can start the service.
Service mysqld Start
A convenience to modify environment variables.
we'll check MySQL first , where's the/usr/local/mysql/bin?
I can edit vim/etc/profile.d/mysql.sh directly .
Export path= $PATH:/usr/local/
Save exit
also under the Shell command line path= $PATH:/usr/local/mysql/bin
that's the fix for MySQL ...
First we need to install php-* and php-mysql.
#./configure--prefix=/usr/local/php–-with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql-- With-libxml=/usr/bin–enable-xml--enable-mbstring
will encounter an error xml2-config NotFound. Please check your LIBXML2 installation.
need to download LIBXML2 and the Libxml2-devle
Find/-name "Xml-config"
It's usually under the/usr/bin.
in the find php.ini-production in the compiled directory
Cp Php.ini-production/etc/php.ini
because this configuration of php added to the Apache module ()--with-apxs2 played a role. So do not start the PHP server.
Next we need to modify the Apache configuration file.
Plus AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps These two items must finally be added with a space .
Now you can restart the service, it is possible to service, the port is also listening, is not connected to the server. The solution is that we need to stop the service before starting.
/usr/local/apache/bin/apachetl stop
/usr/local/apache/bin/apachetl start
Create a PHP file in the root directory of Apache . Vim a.php
<title> test</title>
<?php
$conn =mysql_connect (' localhost ', ' root ', ' 199207 ');
if ($conn)
echo "success!";
Else
echo "Failure";
?>
you should see success on your page
This will test whether the MySQL database is accessed via PHP scripts in Apache .
This ends. Simple source code compiler installed LAMP Platform Build SUCCESS!!!!!
This article from "The Dark before Dawn" blog, declined reprint!
SOURCE Build Lamp Environment