Configure a full-featured Web server under a Linux system

Source: Internet
Author: User
Tags include log mysql php and mysql database linux

Debugging Environment: redhat9.0apache1.3.29mysql3.23.58php4.3.4

Linux system installation I do not say, this is the basic skills, in fact, this article in similar redhat other Linux should also be universal, everyone as long as you master the method I provided on the line. Remember to install REDHAT9. Do not install system default Apache,mysql and PHP and related software when 0. Already installed, please remove the installed package with rpm-e*.

1. Install Mysql3.23.58

In fact, to be honest, directly install the MySQL official website provided by the RPM package is also a more feasible way, the RPM package on his official website is basically synchronized with the release of the TAR package, which I prefer, at least if you install the RPM package in the subsequent debugging will not appear in the MySQL library file can not find the situation. But here it is necessary to talk about the custom installation of the steps, after all, the user's custom installation also said quite a lot.

Software acquisition: http://www.mysql.com/downloads/index.html

Installation steps:

Tarzxvfmysql-3.23.58.tar.gz

cdmysql-3.23.58

./configure--prefix=/usr/local/mysql--sysconfdir=/etc--localstatedir=/var/lib/mysql

Make

Makeinstall

Target directory for #prefix =/usr/local/mysqlmysql installation

#sysconfdir the path to the =/etcmy.ini configuration file

#localstatedir the path that the =/var/lib/mysql database stores

After installation to initialize the database, of course, you are upgraded without doing this step;

/usr/local/mysql/bin/mysql_install_db

If the system does not have MySQL this user, it is best to do the following step:

Useradd-m-o-r-d/var/lib/mysql-s/bin/bash-c "MySQLServer"-u27mysql

And then I start MySQL.

/usr/local/mysql/bin/safe_mysqld&

OK, let's see if MySQL works.

Mysql-urootmysql

Generally, you cannot link the database properly, and the error message is generally:

Error2002:can ' Tconnecttolocalmysqlserverthroughsocket '/var/lib/mysql/mysql.sock ' (2)

In fact, everyone asked the most online is the whole problem, said what link not to mysqld.sock, in fact, we may wish to look at MySQL error log to understand how the matter, I here the error log is in

/var/lib/mysql/*.err you will find MySQL only so can not boot, because the/var/lib/mysql permission does not allow MySQL service access, English MySQL default is to invoke MySQL user to start the service, well, Now that you know what's the reason for not starting, it's easy. We just chown-rmysql:mysql/var/lib/mysql on the line, if we can not start, and then slowly debug permissions, anyway, generally not start is the issue of permissions.

If we still can not start, then use my more cumbersome permission settings, anyway, I do it every time, generally will not have problems, see below:

Chown-rroot/usr/local/mysql

Chgrp-rmysql/usr/local/mysql

Chown-rroot/usr/local/mysql/bin

Chgrp-rmysql/usr/local/mysql/bin

Chgrp-rmysql/var/lib/mysql

Chmod777/var/lib/mysql

Chown-rroot/var/lib/mysql/mysql

Chgrp-rmysql/var/lib/mysql/mysql

Chmod777/var/lib/mysql/mysql

chown-rroot/var/lib/mysql/mysql/*

chgrp-rmysql/var/lib/mysql/mysql/*

chmod777/var/lib/mysql/mysql/*

Chmod777/usr/local/mysql/lib/mysql/libmysqlclient.a

Finish the steps above, and then copy a script from your catalog to the past

Cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld

Chkconfig--addmysqld

Use the NTSYSV setting to make MySQL run automatically every time you start.

All right, now that MySQL is installed, you can start your MySQL service.

/etc/rc.d/init.d/mysqldstart

The next step is more critical,

Ln-s/usr/local/mysql/lib/mysql/usr/lib/mysql

Ln-s/usr/local/mysql/include/mysql/usr/include/mysql

You can not do this, you can build other software to customize the MYSLQ of the library file path, but I still like to link the library file to the default location, so you can compile similar software such as Php,vpopmail without specifying MySQL's library file address.



Related Article

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.