软件下载由于我是使用了公司内部资源,所以没有显示在此文章里。
安装apache
cd /usr/local/src
tar zxfv httpd-2.0.59.tar.gz
cd httpd-2.0.59
./configure --prefix=/usr/local/apache --with-mpm=prefork --enable-so --enable-modules=all
make;make install
--------------------------------------
apache日志安装
cd /usr/local/src
tar zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure && make && make install
---------------------------------------
apache配置修改 --(在编译时如果使用--with-mpm=prefork就修改以下参数)
vi /usr/local/apache/conf/httpd.conf
ServerLimit 2048
StartServers 100
MinSpareServers 50
MaxSpareServers 100
MaxClients 1500
MaxRequestsPerChild 10000
---------------------------------------
#LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
#LogFormat "%h %l %u %t "%r" %>s %b" common
#LogFormat "%{Referer}i -> %U" referer
#LogFormat "%{User-agent}i" agent
找到并注释掉以上配置 并在下面复制以下参数:
SetEnvIf Request_URI .gif$ gif-image
SetEnvIf Request_URI .GIF$ gif-image
SetEnvIf Request_URI .jpg$ gif-image
SetEnvIf Request_URI .JPG$ gif-image
SetEnvIf Request_URI .png$ gif-image
SetEnvIf Request_URI .js$ gif-image
SetEnvIf Request_URI .css$ gif-image
SetEnvIf Request_URI .swf$ gif-image
SetEnvIf Request_URI .bmp$ gif-image
找到并注释掉以下参数并添加新参数:
#LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %I %O" combinedio
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
# CustomLog logs/access_log common (如无法启动则删除这行)
CustomLog "|/usr/local/sbin/cronolog /usr/local/apache/logs/access.%Y%m%d" combined env=!gif-image
ServerAdmin
DocumentRoot /xxx(此目录要自己建,然后给相应权限,一般测试机可以给777)
ServerName xxx.xxx.com
------------------------------------------------------------------------------------------------------
安装mysql
cd /usr/local/src
tar zxvf mysql-max-4.0.27-pc-linux-gnu-i686-glibc23.tar.gz
mv mysql-max-4.0.27-pc-linux-gnu-i686-glibc23 /usr/local/mysql
groupadd mysql ; useradd -g mysql mysql
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
/usr/local/mysql/bin/mysqld_safe --user=mysql &
安装PHP
cd /usr/local/src
tar zxvf php-5.0.5.tar.gz
cd php-5.0.5
./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
make
make install
cp php.ini-dist /usr/local/lib/php.ini
------------------------------------------
vi /usr/local/lib/php.ini
register_globals = Off 修改成On
------------------------------------------
shell> vi /usr/local/apache/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.htm index.php
查找
AddType application/x-gzip .gz .tgz
添加
AddType application/x-httpd-php .php
------------------------------------------
安装phpmyadmin
cd /usr/local/src
tar zxvf phpmyadmin.tar.gz
cd phpmyadmin
vi config.inc.php
找到 $cfg['PmaAbsoluteUri']
修改你将上传到空间的phpMyAdmin的网址
如:$cfg['PmaAbsoluteUri'] = '(主机名或者IP地址)/phpmyadmin(PHPMYADMIN目录复制到APACHE网站目录里/';
还有下面的
$cfg['Servers'][$i]['host'] = 'localhost';(通常用默认,也有例外)
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
在自己的机子里调试用config,如果在网上用cookie。
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user(用户名,自己机里用root,在网上设你的ftp用户名)
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
自己机里不用设
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only(你只有一个数据就设置一下)
还有设
$cfg['DefaultLang'] = 'zh';
设置完毕可以上传到网上了。
浏览 当然你设置不同就用那个网址。
阅读(714) | 评论(0) | 转发(0) |