Linux installation configuration lamp v2_linux

Source: Internet
Author: User
Tags install php openssl php source code vars centos

Copyright Notice: Original works, allow reprint, reprint, please be sure to hyperlink form to indicate the original publication of the article, the author's information and this statement. Otherwise, legal liability will be held. Http://blog.csdn.net/mayongzhan -Ma Yongjin, Myz,mayongzhan

The final installation is only mysql+apache+php

The system has its own zlib libxml2 libxslt Libcurl OpenSSL

After the modified Linux installation Configuration lamp v2 as follows:

The pain of N days ah. This thing is really sick. N Multiple software requires make

Thinking about this place, I suddenly started liking xmapp.

Hope that the vast number of phper have time to study this too time-consuming ... If you are a professional Linux administrator ... It's going to be hard.

Installed the first card to the zlib .... The final result is to delete the CentOS that have been quickly loaded ...

The painful process is as follows

MySQL + Apache + OpenSSL + PHP + gd + libpng + libjpeg + freetype2 + zlib (This is important for a lot of use.) +LIBXML2

Mysql

This is the first hurdle.

First make error ... After analysis, it is known that GCC is not installed. Faint. When pretending to be CentOS, I didn't pay attention to what I had to choose to have a development tool ... Found or not make, after analysis .... Know that I am under the GLIBCC, is compiled ... Pour ~ ~ ~ ~

Copy the past ... directly.

Apache this thing is not installed first. We'll have to put in some other little things. But these are the little things. leading to the termination of the whole process

Zlib

This is the first one. Nothing to say,/configure--prefix=/usr/myz/libs/zlib.

Put it on smoothly.

Freetype2

And it's loaded.

And then the libpng.

It's stuck here.

Hint that zlib cannot be found

I tried to change the makefile .... The result is useless ...

And then reload the next zlib ... Then install libpng ... The result was not fitted to the designated location ... Out of my mind.

Delete after

Pain... If God gave me another chance ... I would like to install Xmapp directly ... If you need to install a Web server. I choose ... rpm ... If it is Ubuntu, I choose Apt-get ...

Try to reinstall it again. as follows:

MYSQL+APACHE+PHP+GD + libpng + libjpeg + freetype2 + zlib+libxml

Mysql

TAR-ZXVF mysql.tar.gz

Groupadd MySQL

useradd-g MySQL MySQL

to the unpacked directory.

Initialize database:./scripts/mysql_install_db--user=mysql

Chown-r Root.
Chown-r MySQL Data
Chgrp-r MySQL.

Add to System Startup Group (Red Hat): CP./support-files/mysql.server/etc/init.d/mysqld

Chkconfig mysqld Reset
Add CP./support-files/my-medium.cnf/etc/my.cnf
Bin/mysqld_safe--user=mysql &

There is a little problem here, the system startup error. Because we can not find MySQL, of course, to modify/etc.init.d/mysqld this file, the inside of the/usr/local/mysql into my directory, OK

There's one more thing to go under the/usr/local/bin ln-fs/usr/myz/mysql/bin/mysql MySQL.

And, of course, Mysqladmin mysqldump.

This will not connect remotely ... Dizzy....

Grant all on *.* to root@ "202.11.10.253" identified by "Dbpassword"

Ok... MySQL is finished installing ...

MySQL Configuration

Setup actually just did some

Mysqladmin-u Root Password XXX

Now it's time to set the character sets.

Locate the client configuration [clients] add below

Default-character-set=utf8 default character set is UTF8

After finding [mysqld] Add

Default-character-set=utf8 default character set is UTF8

init_connect= ' Set NAMES UTF8 ' (set to connect to MySQL database with UTF8 encoding to make MySQL database run UTF8)

After the modification, restart the MySQL (/etc/init.d/mysql restart) can, query about show variables like ' character% ';

Zlib

This is very important .... Learn from the lessons of the past. Direct default installation

# TAR-ZXVF Zlib-1.2.2.tar.gz
# CD zlib-1.2.2
#./configure
# make
# make Install

Libjpeg

This is stupid. You cannot create a folder yourself. You know, in make install's step,

#./configure--prefix=/usr/local/jpeg--enable-shared--enable-static

# make
# make Install

The problem folder is created yourself. Ok

Libpng

# CP Scripts/makefile.linux Makefile
# make (if the hint can not find the Zlib library file or header file, most of the makefile file zlib default path is incorrect. You can edit the makefile file, locate the zlib item, and then specify the path to the zlib path, or the default installation.
# make Install

FreeType

./configure--prefix=/usr/local/freetype

Make

Make install

LIBXML2
./configure--PREFIX=/USR/LOCAL/LIBXML2
Make
Make install

CP Xml2-config/usr/bin This will be used in PHP when compiling

Gd

Note: Both PNG and zlib are installed by default

#./configure--prefix=/usr/local/gd2--with-jpeg=/usr/local/jpeg--with-png=/usr/local/lib--with-zlib=/usr/local/ Lib--with-freetype=/usr/local/freetype
# make
# make Install

If you do not appear above those few things of no words is the installation of success. Finally ... the next step is Apache.

Apache

#./configure--prefix=/usr/myz/apache--sysconfdir=/etc--enable-so--enable-track-vars--enable-rewrite--with-z=/ Usr/local/lib
# make
# make Install

Sysconfdir is the configuration file directory

So is allowed so

Track-vars for the get/post of boot cookies

Rewrite rewrite

Z zlib compression

Apache Configuration

Vi/etc/httpd.conf
There are several places to change:
Find LoadModule Php5_module modules/libphp5.so
Let PHP5 in the Dynamic module mode (DSO) loaded on Apache. Apache loads PHP after it is started.
Before the # number removed (the default has been removed note) (LoadModule xxx.so in PHP will come out automatically)
#AddType application/x-gzip. gz. tgz
Add two lines below
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
The first sentence is to let Apache when encountering the. php file suffix, call the PHP module to explain the code inside PHP. The second sentence is to display the PHP source code in syntax highlighting when encountering the. phps file suffix. Here you can do a lot of articles, such as AddType application/x-httpd-php HTML, so that Apache can also explain the. html file through PHP, many sites "pseudo static" is here to do the hands and feet.
Find DirectoryIndex index.html
Change to DirectoryIndex index.html index.htm index.php, which is to set the default home page for Apache. And it has a sequence of priorities.

Modify the WWW directory

First Mkdir/var/www

And then modify the httpd.conf.

DocumentRoot "/var/www"

<directory "/var/www" >
# CP/USR/LAMP/APACHE2/BIN/APACHECTL/ETC/INIT.D/HTTPD
Set up startup
# chkconfig--add httpd

There will be an error here. In the first line of the httpd, add the following:

# Myz

# chkconfig:2345 60 40

# Description:myz Server
Add Apache as a system service
# service httpd Start

Wait here first, because libphp5.so will have to install PHP.

About the permission denied error

Processed as follows:

1. Vi/etc/sysconfig/selinux

Change selinux=disabled

2.chcon-t texrel_shlib_t/usr/apache/modules/libphp5.so

Or a simple way to turn off the SELinux, #setup在里面找selinux相关的disabled掉.
Then start starts the service, and the same service httpd stop is stopping. You can also service httpd restart. But there is no hint, you can write your own shell script, add some hint information will look much better.

There will be a little error starting here:

HTTPD could not reliably determine

It needs to be added under the servername:www.example.com:80 in the httpd.conf.

Www.yourdomain.com:80

Yes, if Ping does not go through port 80, try shutting down the Linux firewall, #setup里面有.

Php

#./configure--prefix=/usr/myz/php \

--WITH-APXS2=/USR/MYZ/APACHE/BIN/APXS \

--WITH-CONFIG-FILE-PATH=/ETC \

--enable-safe-mode \

--with-zlib= \

--with-zlib-dir=/usr/local/lib \

--with-libxml-dir=/usr/local/lib \

--enable-mbstring \

--with-mysql=/usr/myz/mysql \

--WITH-MYSQL-SOCK=/TMP \

--with-pdo-mysql=/usr/myz/mysql \

--ENABLE-SOAP \

--WITH-XMLRPC \

--enable-sockets \

--with-curl=/usr/local/lib \

--with-xsl=/usr/local/lib \

--WITH-OPENSSL=/USR \

--with-gd=/usr/local/lib \

--with-jpeg-dir=/usr/local/lib \

--with-png-dir=/usr/local/lib \

--with-freetype-dir=/usr/loca/lib \

The blue word is what I feel is necessary.

Some of them need to be installed. Like APACHE,ZLIB,LIBXML2,LIBCURL,LIBXSLT.

I'm using 5.2.5, some things are default enable, like CLI.

This is not all ... But it's enough. But not good ... But it's too much.

I made it up n times!!!!

Not loaded with Libcurl and XSLT.

Make

The scariest thing is to keep cycling when make test ... The last thing I can do is reset my Computer ...

Make install

Again appeared the mistake, said that cannot find the libphp5.so, searched for a long time, finally put all the deletion again. Ok

Copy the php.ini-recommended to php.ini and store it in the/etc/directory.

PHP Configuration

This one... Be casual ... Because it was an experiment, so nothing changed. Only looked at the next phpinfo ()

End...


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.