Apache/PHP/MySQL for rhas3的安装

2016-02-19 14:43 2 1 收藏

关注图老师设计创意栏目可以让大家能更好的了解电脑,知道有关于电脑的更多有趣教程,今天给大家分享Apache/PHP/MySQL for rhas3的安装教程,希望对大家能有一点小小的帮助。

【 tulaoshi.com - 编程语言 】

今天安装成功了APM,总结一下,给大家一个文档。

一安装前的准备工作

1.创建软件安装目录:

# useradd software
把安装文件拷贝到/home/software目录
删除RH AS 3.0 Update 1 自己带的相关RPM包
rpm -e --nodeps httpd-2.0.46-26.ent
rpm -e --nodeps php-4.3.2-8.ent
二.安装MySQL
# cd /home/software/mysql-4.0.17
# ./configure --prefix=/usr/local/mysql --with-charset=gbk
--without-debug 去除debug模式
--enable-assembler 使用一些字符函数的汇编版本
--without-isam 去掉isam表类型支持 现在很少用了 isam表是一种依赖平台的表
--with-pthread 强制使用pthread库(posix线程库)
--enable-thread-safe-client 以线程方式编译客户端
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static 以纯静态方式编译服务端和客户端
--with-raid 激活raid支持
# make

# make install

# ./scripts/mysql_install_db

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

# cd /usr/local
# groupadd mysql
# useradd mysql -g mysql -M -s /sbin/nologin
# chmod 750 mysql -R
# chgrp mysql mysql -R
# chown mysql mysql/var -R

# chown -R mysql.mysql /usr/local/mysql/var


# cd /home/software/mysql-4.0.17

# cp ./support-files/my-medium.cnf /etc/my.cnf -fv
# cp support-files/mysql.server /etc/init.d/mysqld copy启动的mysqld文件
# chmod 700 /etc/init.d/mysqld
# cd /usr/local/mysql/libexec
# cp mysqld mysqld.old
# strip mysqld
# chkconfig --add mysqld
# chkconfig --level 345 mysqld on
# service mysqld start
pstree |grep mysqld 查看mysql有没有正常启动
# ln -s /usr/local/mysql/bin/mysql /sbin/mysql
# ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin
# ln -s /usr/local/mysql/bin/mysqldump /sbin/mysqldump
为了执行命令方便。
增加root用户的密码:

#mysqladmin -u root password ''yourpassword''
# mysql -uroot -p
# 输入你设置的密码
mysqluse mysql;
mysqldelete from user where password=""; #删除用于本机匿名连接的空密码帐号
mysqlflush privileges;
mysqlquit

设置my.cnf文件:

cd /etc/my.cnf

vi my.cnf

[client]
socket = /var/lib/mysql/mysql.sock

[mysqld]
port=3306
socket = /var/lib/mysql/mysql.sock
set-variable = key_buffer_size=16M
set-variable = max_allowed_packet=1M
set-variable = innodb_buffer_pool_size=256M
set-variable = innodb_additional_mem_pool_size=128M
set-variable = innodb_log_file_size=64M
set-variable = innodb_log_buffer_size=16M
set-variable = max_connect_errors=999999999
innodb_data_file_path=ibdata:100M:autoextend
innodb_flush_log_at_trx_commit=1
default-character-set = gbk

三.安装cURL/Ming

1.Install cURL for PHP

# cd /home/software

# tar zxvf curl-7.11.0.tar.gz

# cd /home/software/curl-7.11.0

./configure

make

make install

2.Install ming for PHP

# cd /home/software

# tar zxvf ming-0.2a.tgz

# cd /home/software/ming-0.2a

# make

# cp –r /home/software/ming-0.2a/php_ext/* /home/software/php-5.0.0b4/ext/ming

# cp -rfvp /home/software/ming-0.2a/libming.so /lib
# cp -rfvp /home/software/ming-0.2a/libming.so /usr/lib
# cp -rfvp /home/software/ming-0.2a/libming.so /usr/local/lib

# cp -rfvp /home/software/ming-0.2a/*.h /usr/include
# cp -rfvp /home/software/ming-0.2a/*.h /usr/local/include

# cd /home/software/php-5.0.0b4

# ./buildconf

# ./configure --with-ming=/home/software/ming-0.2a

四.安装Apache

cd /home/software/httpd-2.0.47

./configure --prefix=/usr/local/apache2 --enable-so
--enable-mods-shared=most &&
make &&
make install

五.安装PHP

cd /home/software/php-5.0.0b4

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --enable-track-vars --enable-ftp

make
make install
cp /home/software/php-5.0.0b4/php.ini-dist /usr/local/php/lib/php.ini -vf

修改php.ini文件:

#Edit /usr/local/php/lib/php.in

MySQL教程是:Apache/PHP/MySQL for rhas3的安装。i
#Initialize session on request startup.
#session.auto_start = 0 change to 1
#register_globals = Off change to On(No Comment)

六.修改Apache的配置文件

1.去掉ServerName前面的”#”符号:

ServerName Apache2

修改:

DocumentRoot "/data/vhost_apache"

修改:

#
# This should be changed to whatever you set DocumentRoot to.
#
#Directory "/usr/local/apache/htdocs"

Directory "/data/vhost_apache"

2.去掉Indexes支持:

# This may also be "None", "All", or any combination of "Indexes",

Options FollowSymLinks MultiViews

#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride None

3.增加默认主页的php支持:

#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
IfModule mod_dir.c
DirectoryIndex index.php index.html
/IfModule

4.增加php后缀支持:

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
AddType application/x-tar .tgz
AddType image/x-icon .ico

AddType application/x-httpd-php .php .phtml .php3 .inc
AddType application/x-httpd-php-source .phps

5.增加MaxClients值:

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

在Apache2.0中新加入了ServerLimit指令,使得无须重编译Apache就可以加大MaxClients。下面是prefork配置段。

IfModule prefork.c
StartServers 10
MinSpareServers 10
MaxSpareServers 15
ServerLimit 3000
MaxClients 2048
MaxRequestsPerChild 10000
/IfModule
6.设置自启动
cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd
chmod 700 /etc/init.d/httpd
vi /etc/init.d/httpd
在第二行后增加
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description:http server
注意:没有这几行,在使用chkconfig时会提示你:service httpd does not support chkconfig。
Chkconfig - -add httpd
Chkconfig –level 345 on httpd
这样,在运行级别345上httpd就可以自动启动了。

七、修改php.ini文件

# cd /usr/local/php/lib

需要设置为On

; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

激活session:

; Initialize session on request startup.
session.auto_start = 1

八。测试
mkdir /data/vhost_apache
cd /data/vhost_apache
vi index.php
加入
?php
phpinfo()

保存退出,打开浏览器,输入http://yourip/就可以看到phpinfo的信息了

来源:https://www.tulaoshi.com/n/20160219/1607704.html

延伸阅读
Freebsd5.1release+httpd-2.0.47+mysql-4.0.14+php-4.3.2+phpMyAdmin-2.5.1+ZendOptimizer-2.1.0b-FreeBSD4.0-i386+discuz2.0-gb2312详细安装教程 刚接触linux是今年4月的事情,装过不少linux发行版本,最终还是选择了unix中的freebsd,喜欢它的简洁。不过我也是初学者,将这10多天学freebsd的经验总结给大家分享,希望大家能够少走当初我的一...
标签: PHP
  作者:大金刚 电邮:cheng24@163.net 内容:一、 安装APACHE1.3.9(配置conf目录下的httpd.conf文件) 1.#BindAddress * 改为 BindAddress 127.0.0.1     #Servername new.host.name 改为 Servername localhost 2.让你的APACHE来支持PHP4. 加上下面这么几句:      ScriptAlias /php4/ \...
标签: PHP
    我写过的教程不多,而且大部分都是来源于别人的教程,不过,这里所介绍的,都是融入我所总结的经验.--引言 PHP的执行效率是有目共睹的,这也是我喜欢它的原因之一,和它称为绝妙搭档的Mysql以及Apache想融合,不能不惊叹其效率了。PHP更新也很快,这里列举了目前最新版本PHP4.3.2RC4(几乎没有BUG了,估计写完这篇不...
标签: PHP
  Windows 2000+Apache+MySql+PHP3+PHP4+PERL安装使用小结 www。1000script.com 2002-9-3 1000script专业脚本 Windows 2000+Apache+MySql+PHP3+PHP4+PERL安装使用小结(一) 这里一定有许多和我一样喜欢尝试新鲜事物的朋友,尤其是当听说 某某软件有了新的版本时一定也会迫不及待的去下载一份回来用用再说。 这里我想和大家探...
标签: Web开发
1.apache 在如下页面下载apache的for Linux 的源码包 http://www.apache.org/dist/httpd/; 存至/home/xx目录,xx是自建文件夹,我建了一个wj的文件夹。 命令列表: cd /home/wj tar -zxvf httpd-2.0.54.tar.gz mv httpd-2.0.54 apache cd apache ./configure --prefix=/usr/local/apac...

经验教程

218

收藏

34
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部