gaojinguan 发表于 2018-11-28 07:24:48

MYSQL+APACHE+PHP静态安装apache实验

  系统 :LINUX5.4
目的: MYSQL+APACHE+PHP 实验
软件: mysql-5.0.22.tar.gz
      httpd-2.2.15.tar.gz
       php-5.2.13.tar.gz

一、安装MYSQL
1、   创建mysql用户和组
#chmod777mysql-5.0.22.tar.gz
tar –zxvf mysql-5.0.22.tar.gz
#cdmysql-5.0.22
#groupadd mysql
#useradd –g mysql –s /bin/bash mysql
#password mysql

2、开始安装mysql
#./configure
--prefix=/usr/local/mysql         #mysql安装目录
--with-charset=utf8                #使用UTF8字符集
--with-collation=utf8_general_ci   #校对规则
--with-extra-charsets=complex      #支持所有的扩展字符集
--with-big-tables                  #启用大表
--with-plugins=partition         #大表分割
--enable-assembler               #允许汇编模式,(优化性能)
--enable-local-infile            #支持从本地导入mysql
#make
#make install

#
cpsupport-files/my-large.cnf /etc/my.cnf

#cd /usr/local/mysql/
#bin/mysql_install_db--user=mysql
# chown -R root .
#chown -R mysql var
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
19374
# Starting mysqld daemon with databases from /usr/local/mysql/var

3、 开机启动mysql
#cp share/mysql/mysql.server/etc/init.d/mysqld
#chkconfig --add mysqld
#chmod +x /etc/init.d/mysqld
#chkconfig--level 35 mysql on
#service mysqld start
#cp /usr/local/mysql/bin/* /sbin
# mysqladmin-u root -h localhost password 'aa123456'
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied foruser 'root'@'localhost' (using password: NO)
# mysql-u root -p
Enter password:
Welcome to the MySQL monitor.   Commands end with ; or \g.
Your MySQL connection id is 4 to serverversion: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' toclear the buffer.

mysql>

mysql> grant all privilegeson *.* to root@'%' identified by 'aa123456' with grant option;
QueryOK, 0 rows affected (0.00 sec)
从你的NVCAT链接试试吧
到这里基本上已经安装成功了

二、 安装APACHE

#chmod777httpd-2.2.15.tar.gz
# cd httpd-2.2.15
#./configure

--prefix=/usr/local/apache2      #指定安装目录

--enable-module=so    #启动模块    
--enable-module=rewrite #启用重写功能
--enable-shared=max #把除了so以外的所有apache的标准模块都编译成DSO模块

#make
#make install

开机自启动
# echo "/usr/local/apache2/bin/apachectl start" >> rc.local


三、 安装PHP
1、
# tar -xvzf php-5.2.13.tar.gz
# cd php-5.2.13
#./configure
--prefix=/usr/local/php5   #指定安装目录
--with-mysql=/usr/local/mysql   
--with-apxs2=/usr/local/apache2/bin/apxs
#make
#make test
#make install
#cp php.ini-dist /usr/local/php5/lib/php.ini
#vi /usr/local/apache2/conf/httpd.conf

在284行 defaultType text/plain后面添加

    AddType application/x-httpd-php .php .phtml
    286 AddType application/x-httpd-php-source .phps

找 到Directory index 后面添加 index.php

2、重启apache
cd /usr/local/apache2/htdocs/
#
touchindex.php





页: [1]
查看完整版本: MYSQL+APACHE+PHP静态安装apache实验