Linux under the Lamp source installation deployment

Source: Internet
Author: User
Tags ini mysql php file php write apache log linux

First, software package

Download apache:http://labs.renren.com/apache-mirror//httpd/

Download php:http://www.php.net/downloads.php

Download mysql:http://www.mysql.com/downloads/mysql/

Second, the installation of Apache

1). Tar zxvf httpd-2.0.64.tar.gz

CD httpd-2.0.64

2)./configure--prefix=/usr/local/apache2--enable-so-enable-rewrite

--prefix=/usr/local/apache2//apache installation directory.

--enable-deflate=shared//Support for Web page compression

--ENABLE-MODULE=SO//Open so module, so module is used to lift the DSO support of the Apache core module

--enable-expires=shared//support for HTTP control

--enable-rewrite=shared//Support URL rewriting

--enable-cache//Support caching

--enable-file-cache//Support file caching

--enable-mem-cache//Support memory cache

--enable-disk-cache//support for disk caching

--enable-static-support//support for static connections (default for dynamic connections)

--enable-static-htpasswd

Compiling htpasswd with static connections-managing user files for Basic authentication

--enable-static-htdigest

Compiling htdigest with static connections-managing user files for Digest authentication

--enable-static-rotatelogs

Compiling rotatelogs with a static connection-scrolling the Apache log's pipeline log program

--enable-static-logresolve

Compiling logresolve with static connections-resolves the IP address in the Apache log to host name

--enable-static-htdbm

Compiling htdbm with static connections-manipulating the DBM password database

--enable-static-ab

Compiling ab-apache HTTP server performance test tools with static connections

--enable-static-checkgid

Compiling checkgid with static connections

--disable-cgid

Prohibit execution of CGI scripts with an external CGI daemon

--DISABLE-CGI//Prohibit compiling CGI version of PHP

--disable-userdir//Prevents users from providing pages from their home directory

--with-mpm=worker//Let Apache run as a worker

--enable-authn-dbm=shared//To operate the dynamic database. Rewrite when needed.

According to the Apache official documentation,--enable-mods-shared=all does not enable

All the extra modules, to install all the modules, should use

--enable-mods-shared= "All SSL LDAP cache proxy Authn_alias Mem_cache

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/

File_cache authnz_ldap charset_lite dav_lock Disk_cache "

It's the same for--enable-modules.

3). Make && make install

4). Start Apache

/usr/local/apache2/bin/apachectl start

IE browser input http://Ip address test Apache service.

5). Edit Httpd.conf Support PHP

Vim/usr/local/apache2/conf/httpd.conf

* Add LoadModule php5_module to LoadModule place module/libphp5.so

* Add index.php at DirectoryIndex Place

* Add at AddType application

AddType application/x-httpd-php. php. phtml

AddType Applicatoin/x-httpd-php-source. Phps

Add index.php to DirectoryIndex place

Three: PHP Installation

Tar jxvf php-5.3.10.tar.bz2

CD php-5.3.10

./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql/--with-apxs2=/usr/local/apache2/bin/apxs

Make

Make Test

Make install

CP Php.ini-dist/usr/local/lib/php.ini

Test PHP

Enter the Apache default home directory/usr/local/apache/htdocs to build a index.php file in the directory

Cd/usr/local/apache/htdocs

#vi test.php write to one content

<?php

Phpinfo ();

?>

IE browser input http://Ip address test PHP.

Four. mysql installation (this version does not need to compile)

Groupadd MySQL

useradd-g MySQL MySQL

Tar zxvf mysql-5.5.20-linux2.6-i686.tar.gz

Cd/usr/local

Ln-s/usr/local/src/mysql-5.5.20-linux2.6-i686/usr/local/mysql

Cp/usr/local/src/mysql-5.5.20-linux2.6-i686/support-files/my-medium.cnf/etc/my.cnf

Cd/usr/local/mysql

Chown-r Root.

Chown-r MySQL Data

Chgrp-r MySQL.

Initialize database:

/usr/local/mysql/scripts/mysql_install_db--user=mysql

Cp/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysql

Start MySQL

/usr/local/mysql/bin/mysqld_safe--user=mysql &

That's it.

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.