RedHat9.0 + Apache + MySQL + PHP Typical configuration

zhaozj2021-02-16  89

RedHat9.0 Apache MySQL PHP Typical configuration

[July 14, 2004 10:12 Wednesday]

Work articles

Original address:

http://www.5ilinux.com/lamp01.html

Linux Apache MySQL PHP Typical configuration

Debug environment: redhat9.0 apache1.3.29 mysql3.23.58 php4.3.4

I will not talk about the installation of the Linux system. This is the basic skill. In fact, this article should be common in other Linux similar to Redhat. Everyone will master the way I offer. Remember not to install the default Apache, MySQL, and PHP and related software when installing RedHat9.0. Please use rpm -e * to delete the installed package with rpm -e *.

1. Install mysql3.23.58

In fact, the RPM package provided by the official website is also a more feasible way. The RPM package of his official website is basically synchronized with the tar package. I prefer, at least the RPM package is installed. The mysql library file cannot appear in debugging. But there is still a need to talk about the steps of custom installation. After all, the netizen has a very much-defined installation.

Software Get:

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 mysql installation target directory

# sysconfdir = / etc ini Path to Profile

# localstatedir = / var / lib / mysql data inventory Path

To initialize the database after installation, you don't have to do this if you are upgrading;

/ usr / local / mysql / bin / mysql_install_db

If the system doesn't have a mysql user, it is best to 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, let's take a look at Mysql work properly.

MySQL -uroot mysql

Under normal circumstances, it is not a normal link database. The error prompt is generally:

Error 2002: Can't Connect To Local MySQL Server Through Socket '/VAR/LIB/Mysql/mysql.sock' (2)

In fact, everyone asks all the questions all the questions, saying what link is not mysqld.sock. In fact, everyone may wish to see what Mysql's error log understand what is going on, I here's the wrong log is

/var/lib/mysql/*.err You will find mysql only, because / var / lib / mysql permissions do not allow mysql service access, English MySQL default is to call mysql users to start the service, ok, Since you know what is the reason you can't start, it is simple. We only need

Chown -r mysql: mysql / var / lib / mysql is in line, if it is still not started, slowly adjust the permissions, anyway, it is generally not the problem. If everyone still can't start, then use my more cumbersome permissions, anyway, I do this every time, I will generally don't have a problem. See below:

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 / mysql

Chgrp -r mysql / var / lib / mysql / mysql

CHMOD 777 / VAR / LIB / MYSQL / MySQL

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

chgrp -r mySQL / var / lib / mysql / mysql / *

CHMOD 777 / VAR / LIB / MYSQL / MySQL / *

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

After doing the above steps, then a script for your compilation directory COPY

CP Support-files / mysql.server /etc/rc.d/init.d/mysqld

Chkconfig --Add MySQLD

Use NTSYSV settings to make MySQL each startup automatically.

Ok, until this mysql is installed, you can start your MySQL service like this.

/etc/rc.d/init.d/mysqld start

The following steps are more important,

LN -S / usr / local / mysql / lib / mysql / usr / lib / mysql

LN -S / usr / local / mysql / include / mysql / usr / include / mysql

Everyone can do this, you can customize the MySLQ library file path when compiling other software, but I still like to link the library file to the default location so you can use software such as PHP, VPOPMAIL. MySQL library file address.

2. Install Apache1.3.29. I didn't choose to install apache2.0, I am still not assured to him, because the latest release of Apache on the Internet is basically targeted 2.0, of course, everyone can choose to install the corresponding version. I am talking about the use of DSO dynamic compilation. Apache.

As for the compilation method of Apache, you can refer to my previous article "Apache's static / dynamic compile in Apache PHP MySQL app"

http://www.5ilinux.com/apache01.html

Software Get:

http://httpd.apache.org/

TAR ZVXF APACHE_1.3.29.TAR.GZ

CD Apache_1.3.29

Modify SRC / include / httpd.h to increase the maximum number of threads

#define hard_server_limit 256

Change to

#define hard_server_limit 2560

Save an exit compile Apache

./configure --prefix = / usr / local / apache --enable-module = so --enable-module = REWRITE --ENABLE-Shared = max - htdocsdir = / var / www &&

Make &&

Make INSTALL # Here we tell the setup script via the enable-module parameter, we need to start the SO and REWRITE modules, the SO module is used to mention the Apache core module supported by the DSO, and the REWRITE module is a module that uses the address rewritten, due to ReWrite The module requires DBM support. If there is no compilement in the first installation, you need to recompile the entire Apache in the future. To do this unless you can determine that the Rewrite module will not be used later, it is recommended that you compile the REWRITE module when you compile.

When this parameter is compiled, when the action of this parameter is compiled, it is compiled into a DSO module except for all Apache other than SO. Instead of compiling into the Apache core.

It's very simple to install apache, start apache to see

/ usr / local / apache / bin / apachectl start

Then use IE

http: // Your server address. You should be able to see familiar Apache feathers.

3. Install PHP4.3.4

Software Get:

http://www.php.net/downloads.php

TAR ZVXF PHP-4.3.4.TAR.GZ

CD PHP-4.3.4

./configure /

--Prefix = / usr / local / php /

--with-mysql = / usr / local / mysql /

--enable-force-cgi-redirect /

--with-freetype-dir = / usr /

--with-png-dir = / usr /

--with-gd --enable-gd-native-ttf /

--with-TTF /

--with-GDBM /

--with-getText /

--with-iconv /

--with-jpeg-dir = / usr /

--With-PNG /

--with-Zlib /

--With-XML /

--enable-calendar /

--with-apxs = / usr / local / apache / bin / apxs

Make

Make Install

# I here, because the server needs to use the GD library, add some compilation parameters that support GD, GD uses the RedHat's own GD library. If you are not installed, you can install it from the installation disc, not to install the GD, Install libjpeg, libpng, etc. Also --with-mysql = / usr / local / mysql points to the path to you install MySQL. --with-apxs points to the path to the apxs file.

vi /usr/local/apache/conf/httpd.conf

Look up

Add in this range

AddType Application / X-httpd-php .php

AddType Application / X-httpd-php-source .phps

CPOPY PHP configuration file

Cp ../php4.3.4/php.ini.dist /usr/local/php/lib/php.ini

Modify the php.ini file

Register_globals = on

OK! Restart a Apache server

/ usr / local / apache / bin / apachectl restart

Then write a PHP test page info.php: The content is as follows

PHPINFO ();

?>

Normal, you should see the PHP information, congratulations on your APCHE MySQL PHP installation success.

转载请注明原文地址:https://www.9cbs.com/read-12631.html

New Post(0)