Linux under apache&php&mysql&cgi modified version _unix Linux

Source: Internet
Author: User
Tags openssl

Based on a piece of paper that claims to be his own experience.
Many articles together, hehe
mod_perl,fastcgi that column I did not debug, because I do not like CGI. CHMOD mysql that column is stuck twice, if there is a problem, you can do experiments back and forth.

Linux under apache+mysql+php^ ^^ ^^ ^^ ^ (modified edition)

Alas, there are so many articles on the Internet, the version is so much, and there are some problems, to solve the problems and mistakes with their own day time, modify the wrong place, the final version is the following


apache1.3.24+php4.21+mysql3.23.49+openssl+mod_ssl+mod_perl+mod_fastcgi
Note here that Apache 1.3x can be used as a static PHP module
2.x.x currently can only be used dynamically, and there is no Windows version

Packages required for this installation:
Apache_1.3.24.tar.gz
Php-4.2.1.tar.gz
Mysql-3.23.49.tar.gz
Mod_fastcgi-2.2.12.tar.gz
Mod_perl-1.26.tar.gz
Mod_ssl-2.8.8-1.3.24.tar.gz
Openssl-0.9.6d.tar.gz

Although the Apache version has been to 2.0.36, it looks as if it is not really out of the experimental phase from other sources, and the latest PHP 4.21 cannot be compiled into the Apache 2.0.xx static module at the moment. This installation is compiled into a static module, so did not use the new version of Apache.

###################################################


Installation:

Place these packages in a directory, such as/usr/local/src
Then unzip the packages:
Tar xzvf apche_1.3.24.tar.gz
Tar xzvf php-4.2.1.tar.gz
Tar xzvf mysql-3.23.49.tar.gz
Tar xzvf mod_fastcgi-2.2.12.tar.gz
Tar xzvf mod_perl-1.26.tar.gz
Tar xzvf mod_ssl-2.8.8.-1.3.24.tar.gz
Tar xzvf openssl-0.9.6d.tar.gz

After the decompression is complete, you will see a folder that has been generated in the current directory that understands the compression

Start Configuration compilation Now:

1. Install MySQL First
Need PTH Oh, don't forget
1 Set up MySQL user group:

Groupadd MySQL
useradd-g MySQL MySQL

2) Configure and compile

CD mysql-3.23.49
./config--prefix=/usr/local/mysql

If you want to use MySQL transactions, you can add--with-berkeley-db, namely:

./configure \
--prefix=/usr/local/mysql \
--with-berkeley-db

After the configuration is complete, you can compile the

3) Compile and install
Compilation is simple, only one command

Make

And then install

Make install

4) Initialization
After the installation is over, there are several steps, starting with initializing the database

scripts/mysql_install_db

Then you set the permissions

Chown-r Root/usr/local/mysql
Chown-r Mysql/usr/local/mysql/var
Chgrp-r Mysql/usr/local/mysql

Then copy the my.cnf required to start MySQL to the/etc directory

Cp/usr/local/mysql/share/mysql//my-medium.cnf/etc/my.cnf
(of which there are three documents, MY-SMALL.CNF, MY-LARGE.CNF and MY-HUGE.CNF,
For machine performance, the last one applies to about 2GB of memory

5) Start

/usr/local/mysql/bin/safe_mysqld--user=mysql &

You can see the startup information, the root user should be set a password, because the default is no password after installation

6) Set password for root

/usr/local/mysql/bin/mysqladmin-u root-p Password Your_new_password

Note that the first password is the parameter of the command, typed as is, and Your_new_password is the new password you want to set. For example, to set the root password to 123456, enter the command:

/usr/local/mysql/bin/mysqladmin-u root-p Password 123456

The system prompts you to enter the current password after the carriage return, which should be as follows:

Enter Password:

Because there is no password at this time, so you can enter directly, there is no hint to return to the prompt state, and the password has been set to complete. You can now verify that the password is in effect by closing the MySQL service:

/usr/local/mysql/bin/mysqladmin-u root-p shutdown
Enter password:123456

System prompts MySQL has been closed:

020531 13:14:35 MySQL Ended
[1]+ done/usr/local/mysql/bin/safe_mysqld--user=mysql

##########################################################################

2. Install Apache + PHP + other modules

To configure the module first

Cd/usr/local/src

1 Move the fastcgi directory to the Apache module directory and rename it to fastcgi

MV mod_fastcgi-2.2.12 apache_1.3.24/src/modules/fastcgi

2) Configure and compile the OpenSSL module

cd/usr/local/src/openssl-0.9.6d
SH Config
Make
Make Test

3) Configure Mod_ssl

cd/usr/local/src/mod_ssl-2.8.8-1.3.24
./configure--with-apache=. /apache_1.3.24

4) Configure compilation and install Mod_perl

cd/usr/local/src/mod_perl-1.26
Perl makefile.pl \
Apache_src=.. /APACHE_1.3.24/SRC \
Do_httpd=1 \
Use_apaci=1 \
Pre_httpd=1 \
Everything=1

and then compile

Make

Then test the results of the compilation

Make Test

Installation

Make install

5) Configure Apache

cd/usr/local/src/apache_1.3.24
Ssl_base=.. /openssl-0.9.6d./configure \
--prefix=/usr/local/apache \
--ENABLE-MODULE=SSL \
--ACTIVATE-MODULE=SRC/MODULES/FASTCGI/LIBFASTCGI.A \
--activate-module=src/modules/perl/libperl.a

Now that the Apache configuration has been completed, the next step is to start the PHP

6) Configure compilation installation php-4.2.1

cd/usr/local/src/php-4.2.1
./configure \
--with-mysql=/usr/local/mysql \
--with-apache=.. /apache_1.3.24 \
--enable-track-vars \
--ENABLE-TRANS-SID \
--with-gd

and then compile

Make

Installation

Make install

7 reconfigure and compile to install Apache

cd/usr/local/src/apache_1.3.24
./config.status \
--activate-module=src/modules/php4/libphp4.a

Compile

Make

Installation

Make certificate
Make install

8) Final Setup

cd/usr/local/src/php-4.2.1
CP Php.ini-dist/usr/local/lib/php.ini

You can edit php.ini as needed

Edit the httpd.conf in the/usr/local/apache/conf directory

Found it:
<ifmodule mod_dir.c>
DirectoryIndex index.html
</IfModule>

To
<ifmodule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>

Add a section to the file:
AddType application/x-httpd-php. php

Setting ends.

9) debugging

I don't have to say that.

Load MySQL at system startup
Cp/usr/local/mysql/share/mysql/mysql.server/etc/rc.d/init.d/mysql
Cd/etc/rc.d/rc3.d
Ln-s.. /init.d/mysql S70mysql


Load Apache at system startup
Cp/usr/local/apache/bin/apachectl/etc/rc.d/init.d/httpd
Cd/etc/rc.d/rc3.d
Ln-s.. /INIT.D/HTTPD s80httpd

10) plus Zend Accelerator, it works.
The newest 1. 31 version, whether it is under the win or under Linux, according to the prompts step by step on the
Linux is./install.sh, hey, easy.

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.