日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

centos6.3下搭建LAMP环境

發(fā)布時間:2025/4/16 编程问答 14 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos6.3下搭建LAMP环境 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

系統(tǒng):centos6.3_x64

安裝包:

httpd-2.2.19.tar.gz

php-5.4.14.tar.bz2

libmcrypt-2.5.8.tar.gz

mcrypt-2.6.8.tar.gz

mhash-0.9.9.9.tar.gz


1.cd httpd-2.2.19

2../configure ?--prefix=/usr/local/apache ?--enable-vhost-alias ?--enable-rewrite ?--enable-info

3.Make

4.Make install

5.cp build/rpm/httpd.init /etc/init.d/httpd

6.chmod 755 /etc/init.d/httpd

7.chkconfig --add httpd

8.chkconfig --level 35 httpd on

9.cd /etc

10.ln -s /usr/local/apache/ ? httpd

11.cd /usr/sbin/

12.ln -fs/usr/local/apache/bin/httpd

13.ln -fs/usr/local/apache/bin/apachectl

14.cd /var/log

15.ln -s /usr/local/apache/logs ? httpd

16./etc/init.d/httpd start

安裝php

yum install libxml2

yum install libxml2-devel –y

yum install libjpeg libpng freetype libjpeg-devel libpng-devel freetype-devel openssl-devel bzip2-devel libcurl-devel libxslt-devel

安裝Libmcrypt

#tar -zxvf libmcrypt-2.5.8.tar.gz

#cd libmcrypt-2.5.8

#./configure

#make

#make install 說明:libmcript默認安裝在/usr/local

安裝mhash

#tar -zxvf mhash-0.9.9.9.tar.gz

#cd mhash-0.9.9.9

#./configure

#make

#make install

安裝mcrypt

#tar -zxvf mcrypt-2.6.8.tar.gz

#cd mcrypt-2.6.8

#LD_LIBRARY_PATH=/usr/local/lib ./configure ?//放在一起執(zhí)行

#make

#make install

1

./configure '--with-apxs2=/usr/local/apache/bin/apxs' '--prefix=/usr/local/php' '--with-iconv' '--with-mysql' '--with-mysqli' '--with-gd' '--with-zlib' '--with-jpeg-dir=/usr/lib64' '--with-png-dir' '--with-freetype-dir=/usr/lib64' '--with-curl=/usr/bin' '--with-openssl' '--with-openssl-dir=/usr' '--with-xsl=/usr' '--with-xmlrpc' '--enable-exif' '--enable-cli' '--enable-calendar' '--with-mhash' '--enable-mbstring' '--enable-mbregex' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-zip' '--enable-ftp ''--with-pear' '--disable-debug' '--with-bz2' '--with-mcrypt' '--with-mhash'

說明:

--with-jpeg-dir 字段關聯(lián)libjpeg.so

--with-freetype-dir字段關聯(lián)libfreetype.so


2、make

3、make install

4、拷貝php配置文件

cp php-5.4.14/php.ini-production ? /usr/local/php/lib/php.ini

修改php.ini時區(qū)

date.timezone = "Asia/Shanghai"

修改上傳文件大小

post_max_size = 10M upload_max_filesize = 10M

啟用短標簽

short_open_tag = On

安裝Mysql

yum install mysql mysql-server php-mysql mysql-libs –y

創(chuàng)建用戶

grant all privileges on *.* to 'aixue'@'%' identified by '123456';

數(shù)據(jù)庫配置文件:

cp /usr/share/mysql/my-small.cnf/etc/my.conf

設置字符集

[client]

default-character-set=utf8

[mysqld]

default-character-set=UTF8

/etc/init.d/mysqld restart

然后導入數(shù)據(jù) (要在設置字符集之后,負責要重新導入數(shù)據(jù))

修改數(shù)據(jù)庫用戶名和密碼



配置Apache

cd /etc/httpd/conf

vim httpd.conf

添加內容

ServerName 127.0.0.1 NameVirtualHost *:80 include /etc/httpd/conf/vhost_*.conf Addtype application/x-httpd-php .php Addtype application/x-httpd-php-source .phps AddType application/x-httpd-php .html AddType application/x-httpd-php .htm

創(chuàng)建配置文件

vim vhost_5aixue.com.conf

內容為:

<VirtualHost *:80> ServerName test1.5aixue.com ServerAlias test1.5aixue.com DocumentRoot /home/aixue/public_html ErrorLog /var/log/test.5aixue.com_error_log CustomLog /var/log/test.5aixue.com_access_log combined DirectoryIndex index.php index.html index.htm index.php4 index.php5 <Directory /home/aixue/public_html> Options -Indexes +IncludesNOEXEC +FollowSymLinks allow from all AllowOverride All </Directory> </VirtualHost>



將aixue包解壓到/home下,

cd /home/aixue/public_html/system/config

vim config.php

修改兩項內容:

WEBROOT','/home/aixue/public_html/ LOCAL_IP','192.168.10.103

vim db_config.php


轉載于:https://blog.51cto.com/151wqooo/1268683

總結

以上是生活随笔為你收集整理的centos6.3下搭建LAMP环境的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。