Linux下Apache+PHP+MYSQL编译步骤

为最近手头上正在做的一个项目编译服务器环境而写:

安装mysql
#cd /usr/local/src
#groupadd mysql
#useradd -g mysql mysql
#wget http://mysql.dataphone.se/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz
#tar zxvf mysql-5.0.67.tar.gz
#cd mysql-5.0.67
#./configure --prefix=/usr/local/mysql --with-mysqld-user=mysql --with-charset=gbk --bindir=/usr/local/bin --sbindir=/usr/local/sbin --enable-shared --enable-static
#make
#make install
#cd /usr/local/mysql
#mysql_install_db
#chown -R mysql:mysql *
#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
#/etc/rc.d/mysql start (加入到/etc/rc.local)


安装apache
#useradd ossh
#cd /usr/local/src
#wget
#tar zxvf httpd-2.2.9.tar.gz
#cd httpd-2.2.9
#./configure --prefix=/usr/local/apache --enable-cgi --enable-ssl --enable-modules="most"
#make
#make install
#vi /usr/local/apache2/etc/httpd.conf

User daemon
Group daemon改为:
User ossh
Group ossh
打开Include conf/extra/httpd-vhosts.conf的注释

在#Include conf/extra/httpd-languages.conf行下面增加一行:
AddDefaultCharset GBK

#vi /usr/local/apache2/conf/extra/httpd-vhosts.conf 清空内容,加入下面的设置:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@snda.com
DocumentRoot "/home/ossh/slightphp/public/cdnms/htdocs"
ServerName localhost
ErrorLog "logs/slightphp-error_log"
CustomLog "logs/slightphp-access_log" common

<IfModule dir_module>
DirectoryIndex index.html index.php index.htm
</IfModule>

Alias /res "/home/ossh/slightphp/public/cdnms/resource"
Alias /client "/home/ossh/slightphp/resource"
ScriptAlias /cgi-bin "/home/ossh/slightphp/public/cdnms/cgi-bin

<Directory "/home/ossh/slightphp/">
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
</VirtualHost>


#ln -s /usr/local/apache2/bin/apachectl /etc/init.d/apachectl
#/etc/init.d/apachectl start (加入到/etc/rc.local)

安装php
#cd /usr/local/src
#tar zxvf php-5.2.6.tar.gz
#cd php-5.2.6
#./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --enable-mbstring --without-pear --disable-cli --with-mysqli=/usr/local/bin/mysql_config --with-ldap --enable-pcntl
#make
#make install
#ln -s /usr/local/php/bin/php-cgi /usr/local/bin/php
#cp php.ini-recommended /usr/local/php/lib/php.ini
#mkdir -p /usr/lib/php/modules
#vi /usr/local/php/lib/php.ini
;error_reporting = E_ALL & ~E_NOTICE改成
error_reporting = E_ALL & ~E_NOTICE

error_reporting = E_ALL改成
;error_reporting = E_ALL

display_errors = Off改成
display_errors = On

short_open_tag = Off改成
short_open_tag = On

magic_quotes_gpc = Off改成
magic_quotes_gpc = On

post_max_size = 8M改成
post_max_size = 50M


upload_max_filesize = 2M改成
upload_max_filesize = 40M

;date.timezone =改成
date.timezone = Asia/Shanghai

extension_dir = "./"改成
extension_dir = "/usr/lib/php/modules/"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值