search
Homephp教程php手册Linux下Apache 2.2, MySQL 5.0和PHP 5.0的安装与配置

Linux下Apache 2.2, MySQL 5.0和PHP 5.0的安装与配置

Jun 13, 2016 am 09:50 AM
apachelinuxmysqlphpredDownandandInstalloperating systemenvironmentofConfiguration

1.安装环境
操作系统:Red Hat Linux Enterprise AS 4.0
数据库:MySQL 5.0.24
Web服务器:Apache 2.2.3
脚本语言:PHP 5.1.6

2.安装MySQL 5.0.24
-------------下载软件包mysql-5.0.24.tar.gz,地址http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.tar.gz //解压缩
# cd mysql-5.0.24 //进入解压缩后的文件目录
# ./configure --prefix=/usr/local/mysql \ //设定安装目录
--enable-thread-safe-client \ //编译线程安全版的客户端库
--without-debug \ //关闭debug功能
--localstatedir=/data/mysqldata \ //设定数据库文件目录
# make //编译
# make install //安装
# /usr/local/mysql/bin/mysql_install_db //初始化授权
# chown –R root:root /usr/local/mysql //文件属性改为root用户
# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf //复制配置文件
----------------------------------启动MySQL服务----------------------------------
# /usr/local/mysql/bin/mysqld_safe --user=root & //启动MySQL
----------------------------------修改MySQL密码----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot password mysqlsecret //修改密码
----------------------------------关闭MySQL服务----------------------------------
# /usr/local/mysql/bin/mysqladmin -uroot -pmysqlsecret shutdown //关闭MySQL

3.安装Apache 2.2.3
-------------下载软件包httpd-2.2.3.tar.gz,地址http://www.apache.org-------------
# tar zvxf httpd-2.2.3.tar.gz
# cd httpd-2.2.3
# ./configure --prefix=/usr/local/apache \
--enable-module=most \
--enable-shared=max
# make
# make install
----------------------------------启动Apache服务----------------------------------
# /usr/local/apache/bin/apachectl start
----------------------------------关闭Apache服务----------------------------------
# /usr/local/apache/bin/apachectl stop
----------------------------------重启Apache服务----------------------------------
# /usr/local/apache/bin/apachectl restart

4.安装PHP 5.1.6
-------------------下载软件包php-5.1.6.tar.gz,地址www.php.net--------------------
# tar zvxf php-5.1.6.tar.gz
# cd php-5.1.6
# ./configure --prefix=/usr/local/php \
--with-mysqld=/usr/local/mysql \
--with-apxs2=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/php/lib/php.ini

5.配置Apache服务的httpd.conf文件
*在LoadModule处添加 LoadModule php5_module module/libphp5.so
*在DirectoryIndex处添加 index.php
*在AddType application处添加
AddType application/x-httpd-php .php .phtml
AddType applicatoin/x-httpd-php-source .phps

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.