lamp.zip
准备工作
yum groupinstall “Development Tools” -y
mkdir -pv /usr/local/src/lamp
tar -xvf lamp.tar -C /usr/local/src/lamp/
cd /usr/local/src/lamp/
一、安装apr
tar fvxj apr-1.4.6.tar.bz2
cd apr-1.4.6/
./configure --prefix=/usr/local/apr
make && make install
二、安装apr-util
tar fvxj apr-util-1.5.1.tar.bz2
cd apr-util-1.5.1/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install
三、安装Apache
停掉Apache服务:service httpd stop
yum install zlib-devel openssl-devel pcre-devel -y
tar fvxz httpd-2.4.3.tar.gz
cd httpd-2.4.3/
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-module=so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache --enable-static-support --enable-static-ab --disable-userdir --with-mpm=prefork --enable-nonportable-atomics --disable-ipv6 --with-sendfile
make && make install
/usr/local/apache2/bin/apachectl -k restart //开始Apache服务
ps -aux | grep apache //查看Apache运行
killall httpd //关闭Apache服务
四、安装Mysql
rpm -ivh cmake-2.6.4-7.el5.i386.rpm
groupadd mysql //添加组
useradd -g mysql mysql //添加用户
yum remove mysql-server mysql mysql-devel -y //卸载之前版本
yum install ncurses-devel -y
mkdir -pv /usr/local/mysql/data //递归显示创建目录
tar fvxz mysql-5.5.29.tar.gz
cd mysql-5.5.29
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ -DMYSQL_DATADIR=/usr/local/mysql/data/ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DWITH_INNODBBASE_STORAGE_ENGINE=1 -DENABLE_LOCAL_INFILE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_USER=mysql -DWITH_DEBUG=0 -DWITH_EMBEDED_SERVER=0
make && make install
cd /usr/local/mysql
cp support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
vim /etc/my.cnf
[mysqld] //此位置下添入下行
skip-name-resolve = 1
cp support-files/mysql.server /etc/init.d/mysqlsource
chmod 755 /etc/init.d/mysqlsource
chown -R mysql.mysql /usr/local/mysql/
sh scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/ //初始化数据库,并指定库路径和数据路径
做软连接
ln -s /usr/local/mysql/bin/* /usr/bin/
ln -s /usr/local/mysql/lib/* /usr/lib/
ln -s /usr/local/mysql/libexec/* /usr/local/libexec/
ln -s /usr/local/mysql/share/man/man1/* /usr/share/man/man1/
ln -s /usr/local/mysql/share/man/man8/* /usr/share/man/man8/
五、安装相关软件包
tar fvxz libiconv-1.14.tar.gz
cd libiconv-1.14/
./configure --prefix=/usr/local/ --with-apr=/usr/local/apr
make && make install
tar fvxz libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure && make && make install
cd libltdl/
./configure --enable-ltdl-install && make && make install
tar fvxz mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure && make && make install
ln -s /usr/local/lib/* /usr/lib/
ln -s /usr/local/bin/libmcrypt-config /usr/bin/
tar fvxz mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
./configure && make && make install
六、安装配置PHP
yum install libxml2-devel libpng-devel bzip2-devel curl-devel libjpeg-devel freetype-develnet-snmp-devel -y
tar fvxj php-5.4.11.tar.bz2
cd php-5.4.11/
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdomysql=/usr/local/mysql --with-iconv-dir=/usr/local/ --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --with-pcre-regex --with-zlib --with-bz2 --enable-calendar --disable-phar --with-curl --enable-dba --with-libxml-dir --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-mhash --enable-mbstring --with-mcrypt --enable-pcntl --enable-xml --disable-rpath --enable-shmop --enable-sockets --enable-zip --enable-bcmath --with-snmp --disable-ipv6 --disable-rpath --disable-debug --with-apxs2=/usr/local/apache2/bin/apxs
make ZEND_EXTRA_LIBS=’-liconv’
make install
cp php.ini-production /usr/local/php/etc/php.ini
vim /usr/local/apache2/conf/httpd.conf
/AddType //搜索关键字
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php //添加行
/IfModule dir_module //搜索关键字
DirectoryIndex index.php //修改行
vim /usr/local/php/etc/php.ini
short_open_tag = On //修改行
cd /usr/local/apache2/htdocs/
rm -f index.html
vim index.php
Hello World
七、查看Apache服务,并重新启动
ps -aux | grep httpd
killall httpd
/usr/local/apache2/bin/apachectl -k restart
八、论坛文件的修改
uzip emlog_5.3.1.zip
mv emlog_5.3.1/emlog/src/* /usr/local/apache2/htdocs/ //移动论坛文件
cd /usr/local/apache2/htdocs
chmod -R 777 * //修改目录下所有文件的权限
mysql
create database emlog;
Quit
九、启动Apache && Mysql服务 && 访问配置
/usr/local/apache2/bin/apachectl -k restart //启动Apache服务
/etc/init.d/mysqlsource start //启动Mysql 服务
lamp编译部署
最新推荐文章于 2022-07-05 14:51:30 发布