RHEL5.5简单配置apache+MySql+PHP

yum install gcc

tar fxz httpd-2.0.64.tar.gz
cd httpd-2.0.64
./configure
make
make install
#setenforce 0
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -P INPUT DROP
ln /usr/local/apache2/bin/apachectl /etc/init.d/httpd
/etc/init.d/httpd restart
#=================================
tar fxz mysql-5.0.18.tar.gz
cd mysql-5.0.18
yum install gcc-c++
yum install libtermcap-devel
#===============
useradd mysql 
./configure --prefix=/usr/local/mysql --with-charset=gbk
make
make install
cp support-files/my-medium.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 &
#================
tar fxj php-5.2.8.tar.bz2
yum install libxml2-devel
cd php-5.2.8
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php
make && make install
vim /usr/local/apache2/conf/httpd.conf
#========================
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.html.var
/usr/local/apache2/bin/apachectl restart
#========================
touch /usr/local/apache2/htdocs/index.php
cat > /usr/local/apache2/htdocs/index.php
<?
phpinfo();
?>
 
unzip ECShop_V2.7.2_GBK_Release0604.zip 
cp -rf upload /usr/local/apache2/htdocs/
chmod -R 777 /usr/local/apache2/htdocs/upload/

你可能感兴趣的:(apache,mysql,PHP,RHEL)