CentOS下快速安裝LAMP環境!
##########安裝 httpd##########
# yum -y install httpd httpd-devel
service httpd start
chkconfig httpd on
########安裝 mysql##########
yum -y install mysql mysql-devel mysql-server
service mysqld start
chkconfig mysqld on
# mysqladmin -u root password 'newpassword' [引號內填密碼]
#####安裝php5.3########
install php5.3.3 //這是安裝php5.3.3的 php5.3安裝
yum install -y php53-mysql php53 php53-devel php53-common php53-xml php53-bcmath php53.i386 php53-bcmath.i386 php53-cli.i386 php53-common.i386 php53-devel.i386 php53-gd.i386 php53-ldap.i386 php53-mbstring.i386 php53-mysql.i386 php53-odbc.i386 php53-pdo.i386 php53-snmp.i386 php53-soap.i386 php53-xml.i386
######安裝php5.1#########
install php 5.1.6 //這是默認安裝php5.1.6的
php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel
整合Apache與PHP及系統初始化配置
vim /usr/local/apache2/conf/httpd.conf
查找AddType application/x-gzip .gz .tgz,在該行下面添加
AddType application/x-httpd-php .php
查找DirectoryIndex index.html 把該行修改成
DirectoryIndex index.html index.htm index.php
<VirtualHost 192.168.1.140:8080>
DocumentRoot /var/www/html/openshop/webadmin/web/
HostNameLookups off
<Directory "/var/www/html/openshop/webadmin/web/">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.php
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
Listen 8008
<VirtualHost *:8008>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^.*\.(gif|jpg|jpeg|png|swf|flv)$ /display_img.php [L]
DocumentRoot "/var/www/html/IMG_SERVER"
<Directory "/var/www/html/IMG_SERVER">
Options FollowSymLinks IncludesNOEXEC Indexes
DirectoryIndex index.html index.php
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>