Fully-functional Web servers in Linux

Source: Internet
Author: User
Article Title: fully-functional Web servers in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Debugging environment: Redhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4

I will not talk about Linux installation. This is a basic skill. In fact, this article is applicable to other linux systems similar to Redhat. You only need to master the methods I provide. Remember to install Redhat9. Do not install the default apache, mysql, php, and related software. Use rpm-e * to delete installed packages.

  1. Install Mysql3.23.58

In fact, it is quite feasible to directly install the rpm package provided by the official Mysql website. The rpm package provided by his official website is basically synchronized with the tar package release, I like this very much. At least the rpm package will not be found in the mysql library file during subsequent debugging. However, it is necessary to talk about the steps for custom installation. After all, there are a lot of user-defined installation steps.

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

Installation steps:

Tar zxvf mysql-3.23.58.tar.gz

Cd mysql-3.23.58

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

Make

Make install

# Prefix =/usr/local/mysql target directory for mysql Installation

# Sysconfdir =/etc my. ini configuration file path

# Localstatedir =/var/lib/mysql database storage path

Initialize the database after installation. You do not need to perform this step if you upgrade the database;

/Usr/local/mysql/bin/mysql_install_db

If the system does not have a mysql user, do the following:

Useradd-M-o-r-d/var/lib/mysql-s/bin/bash-c "MySQL Server"-u 27 mysql

Then I start mysql

/Usr/local/mysql/bin/safe_mysqld &

OK. Check if mysql works properly.

Mysql-uroot mysql

Generally, the database cannot be connected normally. The error message is:

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2)

In fact, most of the questions on the Internet are the whole question. If you cannot find any link to mysqld. sock, you may wish to see the mysql error log to understand what is going on. Here, the error log is

/Var/lib/mysql /*. err, you will find that mysql cannot be started only because/var/lib/mysql does not allow access to the mysql service. By default, mysql calls the mysql user to start the service, since you know why it cannot be started, it's easy. As long

Chown-R mysql: mysql/var/lib/mysql. If it still cannot be started, you can debug the permission slowly. Generally, it is a permission issue if it cannot be started.

If you still cannot start it, use my complicated permission settings. I do this every time. Generally, there is no problem. See:

Chown-R root/usr/local/mysql

Chgrp-R mysql/usr/local/mysql

Chown-R root/usr/local/mysql/bin

Chgrp-R mysql/usr/local/mysql/bin

Chgrp-R mysql/var/lib/mysql

Chmod 777/var/lib/mysql

Chown-R root/var/lib/mysql

Chgrp-R mysql/var/lib/mysql

Chmod 777/var/lib/mysql

Chown-R root/var/lib/mysql /*

Chgrp-R mysql/var/lib/mysql /*

Chmod 777/var/lib/mysql /*

Chmod 777/usr/local/mysql/lib/mysql/libmysqlclient.

 

[1] [2] Next page

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.