Linux Server Tutorial: simple implementation of LAMP through source code compilation

Source: Internet
Author: User
How to Implement LAMP? 1 make sure that there are no httpdphpmysqlmysql-serverspanrpm-qhttpdphpmysqlmysql-serverspan2 to install 4 development package groups in the system, make sure the following installation will not go wrong spanyum-ygroupinstallDevelopmentLibraries

How to Implement LAMP?

1> make sure there is noHttpd PhpMysql-server

  1. Rpm-q httpd php mysql-server

2> Install four development package groups to ensure that subsequent installation will not go wrong

  1. Yum-y groupinstall "Development Libraries" "Development TooLs"" Legacy Software Development "" X Software Development"

3> download: wget httpd lib mysql php and so on

Install lib ExtensionMcRypt only requires./configure & make & makeinstall

4> install and configure mysql:

Create mysql users and groups

  1. GroupaDd-G 3306 mysql
  2.  Useradd-U 3306-g mysql-M-s/sbin/nologin mysql
  3.  SetEnforce 0 # disable selinux
  4.  Chown-R mysql: mysql/mydata # direct our directory to mysql users and mysql groups

 ExtractMysql

  1. Tar xf mysql-5.5.15-linux2.6-i686.tar.gz-C/usr/local
  2.  Cd/Usr/local
  3.  Ln-Sv mysql-5... mysql ### link the directory of the mysql version to mysql
  4. Cd mysql
  5. Chown-R mysql: mysql. ### change the owner Group of the mysql directory to mysql user and mysql group.
  6. Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data ### initialize Mysql

Mysql cannot be started at this time.

  1. Chown-R root. ### change the owner to the root user
  2.  Cp SuPport-FileS/mysql. server/etc/init. d/mysqld ### prepare scripts for mysql to start the required services
  3.  Chkconfig-- Add mysqld ### add to service queue
  4. Chkconfig mysqld on ### start upon startup

At this time, an error will be reported if it is started. By default, mysql will find the data directory under its installation directory as its data directory.

Prepare the main configuration file for it

  1. Cp support-files/my-large.cnf/etc/my. cnf

Edit this file and give it a datadir directory

  1. Vim/etc/my. cnf
  2. Add: datadir =/mydata/data
  3. And set thread_coNcUrrency = change to the number of CPU cores x 2.

In this case, the instance can be started normally.

  1. Service mysqld start

If a startup error occurs, go to/mydata/data/localhost. localdomain. err to view the error message.

At this time, we have not fully prepared Mysql. We also need to prepare its library file and header file.

  1. Vim/etc/ld. so. conf. d/mysql. conf ### import the database file
  2. Add:/usr/local/mysql/lib
  3. Ldconfig ### use ldconfig to reload
  4. Ln-sv/usr/local/mysql/include/usr/include/mysql ### import the header file
  5. Vim/etc/profiles ### define the PATH environment variable
  6. Write: PATH = $ PATH:/usr/local/mysql/bin

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.