Build a lamp with the source code package

Source: Internet
Author: User
Lamp environment Setup 1. Install apahce (1) install related dependent packages

[[Email protected] ~] # Yum-y install GCC make OpenSSL-devel C ++ libxml2-devel

 

(2). Compile and install apahce

 

[[Email protected] # tar-zxf httpd-2.2.25

[[Email protected] # cd httpd-2.2.25

[[Email protected] SRC] #. /configure -- prefix =/usr/local/httpd -- enable-so -- enable-Rewrite -- enable-CGI -- enable-SSL -- enable-charset-lite -- enable-suexec --- suexec-caller = daemon -- With-suexec-docroot =/usr/local/httpd/htdocs

[[Email protected] SRC] # Make & make install

(3) start Apache testing after compilation and Installation

[[Email protected] #/usr/local/httpd/bin/apachectl start

[[Email protected] httpd-2.2.25] # netstat-tlnp | grep: 80

TCP 0 0: 80: * Listen 56629/httpd

(4) add Apache as a system service

[[Email protected] init. d] # cp/usr/local/httpd/bin/apachectl/etc/init. d/myhttpd

[[Email protected] init. d] # Vim/etc/init. d/myhttpd

In #! Add the following lines to/bin/Bash:

# Chkconfig: 35 85 15

# Description: Description

[[Email protected] init. d] # chkconfig -- add myhttpd

2. Install MySQL (1), decompress and compile and install

[[Email protected] SRC] # useradd-m-u 49-S/sbin/nolog MySQL

[[Email protected] host src] # tar -zxfmysql-5.1.62.tar.gz

[[Email protected] # cd mysql-5.1.62

[[Email protected] mysql-5.1.62] #. /configure -- prefix =/usr/local/MySQL -- With-charset = utf8 -- With-collation = utf8_general_ci -- With-extra-charsets = GBK, gb2312

[[Email protected] mysql-5.1.62] # Make & make install

(2) Database Configuration

[[Email protected] # cp support-files/my-medium.cnf/etc/My. CNF

[[Email protected] # cd/usr/local/MySQL/bin/

[[Email protected] #./mysql_install_db -- user = MySQL

 

[[Email protected] bin] # chown-r root: MySQL/usr/local/MySQL/

[[Email protected] bin] # chown-r MySQL/usr/local/MySQL/var/

 

[[Email protected] bin] # ln-S/usr/local/MySQL/bin/*/usr/local/bin/

[[Email protected] bin] # ln-S/usr/local/MySQL/lib/MySQL/*/usr/lib64/

[[Email protected] bin] # ln-S/usr/local/MySQL/include/MySQL/*/usr/include/

(3) add mysqld as a system service

[[Email protected] bin] # cd/usr/src/mysql-5.1.62/support-files/

[[Email protected] # cp mysql. Server/etc/init. d/mysqld

[[Email protected] Support-files] # chmod + x/etc/rc. d/init. d/mysqld

[[Email protected] # chkconfig -- add mysqld

(4) Start MySQL Testing

[[Email protected] Support-files] # servicemysqld start

[[Email protected] Support-files] # netstat-tlnp | grep: 3306

TCP 0 0 0.0.0.0: 3306 0.0.0.0: * Listen 18314/mysqld

[[Email protected] Support-files] #

 

3. Install the PHP source code package (1). decompress and compile and install the package.

1. [[email protected] SRC] # tar-zxf php-5.4.19.tar.gz

2. [[email protected] SRC] # cdphp-5.4.19

3. [[email protected] php-5.4.19] #. /configure -- prefix =/usr/local/PHP -- enable-mbstring -- enable-sockets -- with-apxs2 =/usr/local/httpd/bin/apxs -- With-mysql =/usr/ local/MySQL -- With-config-file-Path =/usr/local/PHP

[[Email protected] php-5.4.19] # Make & make install

[[Email protected] php-5.4.19] # cpphp. ini-development/usr/local/PHP. ini

(2) modify the httpd configuration file to support PHP format files

[[Email protected] httpd] # Vim/usr/local/httpd/CONF/httpd. conf, add a line:

Addtype application/X-httpd-PHP. php

[[Email protected] httpd] # Vim/var/www/html/index. php

<?

PHP phpinfo ();

?>

 


This article is from the "Linux learning" blog, please be sure to keep this source http://2993336.blog.51cto.com/2983336/1439708

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.