centos6.3下搭建LAMP环境
系统: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-devellibpng-devel freetype-devel openssl-develbzip2-devellibcurl-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 //放在一起执行
#make
#make install
1、
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 字段关联libjpeg.so
--with-freetype-dir字段关联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时区
1
date.timezone = "Asia/Shanghai"
安装Mysql
yum install mysqlmysql-server php-mysqlmysql-libs –y
创建用户
1
grant all privilegeson *.* to 'aixue'@'%' identified by '123456'
配置Apache
cd /etc/httpd/conf
vim httpd.conf
添加内容
1
2
3
4
5
6
7
ServerName 127.0.0.1
NameVirtualHost *:80
include/etc/httpd/conf/vhost_*.conf
Addtypeapplication/x-httpd-php.php
Addtypeapplication/x-httpd-php-source.phps
AddType application/x-httpd-php .html
AddTypeapplication/x-httpd-php.htm
创建配置文件
vim vhost_5aixue.com.conf
内容为:
1
2
3
4
5
6
7
8
9
10
11
12
13
<VirtualHost*:80>
ServerNametest1.5aixue.com
ServerAliastest1.5aixue.com
DocumentRoot/home/aixue/public_html
ErrorLog /var/log/test.5aixue.com_error_log
CustomLog/var/log/test.5aixue.com_access_log combined
DirectoryIndexindex.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
修改两项内容:
1
2
WEBROOT','/home/aixue/public_html/
LOCAL_IP','192.168.10.103
vimdb_config.php
修改数据库用户名和密码
导入数据库。
数据库配置文件:
cp /usr/share/mysql/my-small.cnf /etc/my.conf
帮你顶下哈!! 内练一口气,外练一口屁。 长大了娶唐僧做老公,能玩就玩一玩,不能玩就把他吃掉。 男人与女人,终究也只是欲望的动物吧!真的可以因为爱而结合吗?对不起,我也不知道。。 生我之前谁是我,生我之后我是谁? 自从我变成了狗屎,就再也没有人踩在我头上了。
页:
[1]