Simple compilation and installation of lamp

Source: Internet
Author: User
Tags install openssl

[Install mariadb in binary mode]

1. Expand the program

# Tar mariadb-5.5.32-linux-x86_64.tar.gz-C/usr/local/

2. Enter the decompressed folder.

# Cd/usr/local/mariadb-5.5.32-linux-x86_64/

3. Create a data storage directory

# Mkdir-PV/mydata/Data

4. Create users and groups for Secure Login

# Groupadd-r MySQL

# Useradd-G mysql-r MySQL

5. Change the owner Group of the Data Directory

# Chown-r MYSQL: MySQL/mydata/data/

6. Create a soft link for the extracted directory

# Cd/usr/local

# Ln-SV mariadb-5.5.32-linux-x86_64/MySQL

7. Go to the MySQL directory and modify the owner group of all files

# Cd MySQL/

# Chown-r root: MySQL *

8. Copy and modify the MySQL configuration file

# Mkdir/etc/MySQL

# Cp support-files/my-large.cnf/etc/MySQL/My. CNF

# Vim/etc/MySQL/My. CNF // modify and enter in [mysqld]

[Mysqld]

Thread_concurrency = 2

Datadir =/mydata/Data

9. initialize the database

# Scripts/mysql_install_db -- user = MySQL -- datadir =/mydata/Data

10. Copy the startup script file to/etc/rc. d/init. d.

# Cp support-files/MySQL. Server/etc/rc. d/init. d/mysqld

11. Add a service

# Chkconfig -- add mysqld

12. Simple startup Service

# Service mysqld start

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/46/CF/wKioL1P0oYiR1AeBAAF_SaLyl18526.jpg "style =" float: none; "Title =" image 000.png" alt = "wkiol1p0oyir1aebaaf_salyl18526.jpg"/>

13. Enter the path of the command and view the man document.

# Vim/etc/profile. d/MySQL. Sh

Export Path =/usr/local/MySQL/bin: $ path

# Source/etc/profile. d/MySQL. Sh

# Man mysqld

========================================================== ========

[Httpd compilation and installation]

1. Resolve Dependencies

(1) Compile and install APR

# Tar xf apr-1.5.0.tar.bz2

# Cd apr-1.5.0

# Vim configure

Change Rm = '$ RM' to Rm = '$ Rm-F'

#./Configure -- prefix =/usr/local/APR

# Make & make install

# CD ..

(2) Compile and install Apr-util

# Tar xf apr-util-1.5.3.tar.bz2

# Cd apr-util-1.5.3

#./Configure -- prefix =/usr/local/APR-util -- With-Apr =/usr/local/APR

# Make & make install

# CD ..

(3) The httpd-2.4.9 compilation process also depends on the PCRE-devel software package, need to be installed in advance. This software package comes with the system CD, so you can find and install it.

# Yum-y install PCRE-devel

2. Compile and install the httpd-2.4.9

# Tar xf httpd-2.4.9.tar.bz2

# Cd httpd-2.4.9

#. /Configure -- prefix =/usr/local/Apache -- sysconfdir =/etc/httpd24 -- enable-so -- enable-CGI -- enable-Rewrite -- With-zlib -- With-PCRE -- -Apr =/usr/local/APR -- With-Apr-util =/usr/local/APR-util -- enable-modules = most -- enable-MPMs-shared = all -- -MPM = event

# Make & make install

3. Modify the main configuration file of httpd and set the path of its PID file.

# Cd/etc/httpd24

# Cp httpd. conf httpd. conf. Bak

# Vim/etc/httpd24/httpd. conf

Pidfile "/var/run/httpd. PID"

4. Provide the sysv service script/etc/rc. d/init. d/httpd24.

# Vim/etc/rc. d/init. d/httpd24

For more information, see the/etc/rc. d/init. d/httpd script.

5. grant permissions, add services, and start services.

# Chmod + x/etc/rc. d/init. d/httpd24

# Chkconfig -- add httpd24

# Service httpd24 start

Bytes -------------------------------------------------------------------------------------------

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/46/CF/wKioL1P0ob_CV_X9AACNoMlobdk498.jpg "Title =" image 001.png" alt = "wkiol1p0ob_cv_x9aacnomlobdk498.jpg"/>

========================================================== ==========================================================

[PHP compilation and installation]

  1. Resolve Dependencies

# Yum-y groupinstall "desktop platform development"

# Yum-y install bzip2-devel libmcrypt-devel

# Yum install OpenSSL-devel

2. Compile and install PHP

# Tar xf php-5.4.26.tar.bz2

# Cd php-5.4.26

#. /Configure -- prefix =/usr/local/PHP -- With-mysql =/usr/local/MySQL -- With-OpenSSL -- With-mysqli =/usr/local/MySQL/bin/ mysql_config -- enable-mbstring -- With-FreeType-dir -- With-JPEG-dir -- With-PNG-dir -- With-zlib -- With-libxml-Dir =/usr -- enable-XML -- enable-sockets -- with-apxs2 =/usr/local/Apache/bin/apxs -- With-mcrypt -- With-config-file-Path =/etc -- With-config-file-Scan -Dir =/etc/PHP. D -- with-bz2 -- enable-maintainer-ZTS

# Make & make install

3. Provide configuration files for PHP

# Cp PHP. ini-production/etc/PHP. ini

4. Edit the main configuration file of Apache to make Apache support PHP

# Cd/etc/httpd24

# Vim httpd. conf

Addtype application/X-httpd-PHP. php

Addtype application/X-httpd-PHP-source. PHPs


Directoryindex index. php index.html

5. Restart the HTTPd service.

# Service httpd24 restart

6. Test whether PHP is supported

# Cd/usr/local/Apache/htdocs/

# Vim index.html

<? PHP

Phpinfo ();

?>

# Mv index.html index. php

# Service httpd24 restart

Bytes -------------------------------------------------------------------------------------------

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/46/CF/wKioL1P0odnhlXqCAAKOdsQQH3s705.jpg "Title =" image 002.png" alt = "wkiol1p0odnhlxqcaakodsqqh3s705.jpg"/>

========================================================== ========================================================== ==============




This article is from the "riaair small building" blog, please be sure to keep this source http://riaair.blog.51cto.com/9177337/1542803

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.