搜索
首页php教程php手册Apche + MySQL + PHP整合安装脚本

这个脚本可以无需人工干预的完成L.A.M.P的整合工作。

该脚本适用于整合源码包方式的apache2.0.5x,php4.0.x和已编译好的(Binary版本)的MySQL4.0.2x。

注意,以上三个包最好从各自的官方站点下载,并且下载后最好不要改变文件名!

使用方法:

=====

1、将下载好的3个包和本安装脚本(install_lamp.sh)放置在

/home/Nanu下。放置的位置随意,但注意必须把3个包和本安装脚本放在同一目录!

2、Apache和PHP的./configure部分根据需要换成你的编译参数;

3、执行install_lamp.sh;

4、安装完成后,MySQL的root密码默认保存在/usr/local/mysql/passwd.root中,以备忘记。

脚本代码:

=====

CODE:[Copy to clipboard]#!/bin/bash

# Mysql4.0.x Start

/bin/tar xzvf mysql*4.0.*.tar.gz

/bin/rm -f mysql*4.0.*.tar.gz

/usr/sbin/useradd mysql

/bin/mv mysql*4.0* /usr/local/mysql

/usr/local/mysql/scripts/mysql_install_db --user=mysql

/bin/chown -R root /usr/local/mysql/.

/bin/chown -R mysql /usr/local/mysql/data

/bin/chgrp -R mysql /usr/local/mysql/.

/bin/cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf

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

echo "Please Set Your MySQL root Password:"

read password

/usr/local/mysql/bin/mysqladmin -u root password $password

/bin/touch /usr/local/mysql/passwd.root

echo $password >; /usr/local/mysql/passwd.root

/usr/local/mysql/bin/mysqladmin -u root --password=$password shutdown

/bin/cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

/sbin/chkconfig --add mysqld

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

# MySQL4.0.x End

# Apache2.0.x Start

/bin/tar xzvf httpd-2.0.*.tar.gz

cd httpd-2.0.*

./configure --prefix=/usr/local/apache --mandir=/usr/share/man --enable-mods-shared=all --enable-so

make

make install

echo "AddType application/x-httpd-php .php" >;>; /usr/local/apache/conf/httpd.conf

sed -i 's/"DirectoryIndex index.html index.html.var"/"DirectoryIndex index.htm index.html index.php index.html.var"/g' /usr/local/apache/conf/httpd.conf

/usr/local/apache/bin/apachectl -k start

# Apache2.0.x End

# PHP4.0.x Start

/bin/tar xzvf php-*.tar.gz

cd php-*

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --mandir=/usr/share/man --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php/etc

make

make install

/bin/cp php.ini-recommended /etc/php.ini

sed -i 's/"register_globals = Off"/"register_globals = On"/g' /etc/php.ini

/usr/local/apache/bin/apachectl -k restart

# PHP4.0.x End



声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热工具

mPDF

mPDF

mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

Dreamweaver Mac版

Dreamweaver Mac版

视觉化网页开发工具

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器