使用yum安装gcc-*、zlib-devel、openssl-devel、pcre-devel、ncurses-devel、libxml2-devel、libpng-devel、bzip2-devel、curl-devel、libjpeg-devel、freetype-devel、net-snmp-devel
1.安装apr-1.4.6.tar.bz2(apache所用的一个依赖包)
./configure --prefix=/usr/local/apr && make && make install && echo $?
2.安装apr-util-1.5.1.tar.bz2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install
3.A.安装httpd-2.4.3.tar.gz
./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 && echo $?
B.测试方法:
a.停止系统本来的http服务,rpm -e httpd
b.启动新装的apache2,/usr/local/apache2/bin/apachectl -k start
root 8334 0.0 0.4 4468 2200 ? Ss 11:46 0:00 /usr/local/apache2/bin/httpd -k start
daemon 8335 0.0 0.3 4468 1708 ? S 11:46 0:00 /usr/local/apache2/bin/httpd -k start
daemon 8336 0.0 0.3 4468 1708 ? S 11:46 0:00 /usr/local/apache2/bin/httpd -k start
daemon 8337 0.0 0.3 4468 1708 ? S 11:46 0:00 /usr/local/apache2/bin/httpd -k start
daemon 8338 0.0 0.3 4468 1708 ? S 11:46 0:00 /usr/local/apache2/bin/httpd -k start
daemon 8339 0.0 0.3 4468 1708 ? S 11:46 0:00 /usr/local/apache2/bin/httpd -k start
root 8375 0.0 0.1 3916 704 pts/1 R+ 11:46 0:00 grep apache
c.killall httpd
4.安装cmake包
rpm -ivh ./cmake-2.6.4-7.el5.i386.rpm
5.A.安装mysql-5.5.29.tar.gz
B.为mysql建立用户
groupadd mysql
useradd -g mysql mysql
C.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
等同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
D.make && make install && echo $?
E.配置文件
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
[root@localhost mysql-5.5.29]# chmod 755 /etc/init.d/mysqlsource
[root@localhost mysql-5.5.29]# chown -R mysql.mysql /usr/local/mysql/
F.初始化数据库
sh scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
G.做链接
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
6.安装libiconv-1.14.tar.gz
./configure --prefix=/usr/local/ --with-apr=/usr/local/apr && make && make install && echo $?
7.安装libmcrypt-2.5.8.tar.gz
./configure && make && make install && ldconfig
cd libltdl/
./configure --enable-ltdl-install && make && make install && echo $?
8.安装mhash-0.9.9.9.tar.gz
./configure && make && make install && echo $?
做链接
ln -s /usr/local/lib/* /usr/lib/
ln -s /usr/local/bin/libmcrypt-config /usr/bin/
9.安装mcrypt-2.6.8.tar.gz
./configure && make && make install && echo $?
10.A.安装php-5.4.11.tar.bz2
./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-pdo-mysql=/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 && echo$?
B.配置文件
[root@localhost php-5.4.11]# cp php.ini-production /usr/local/php/etc/php.ini
[root@localhost php-5.4.11]# vim /usr/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php(添加)
DirectoryIndex index.php(修改)
[root@localhost php-5.4.11]# cd /usr/local/apache2/htdocs/
[root@localhost htdocs]# rm -rf index.html
[root@localhost htdocs]# vim index.php
<?php
phpinfo();
?>
C.启动服务
[root@localhost htdocs]# /usr/local/apache2/bin/httpd
[root@localhost htdocs]# /etc/init.d/mysqlsource start
11.安装Discuz_7.2_FULL_SC_UTF8.zip
[root@localhost arvon]# unzip Discuz_7.2_FULL_SC_UTF8.zip
[root@localhost arvon]# mv upload/* /usr/local/apache2/htdocs/
mv: overwrite `/usr/local/apache2/htdocs/index.php'?
[root@localhost arvon]# cd /usr/local/apache2/htdocs/
[root@localhost htdocs]# chmod -R 777 *
[root@localhost htdocs]# vim /usr/local/php/etc/php.ini
short_open_tag = On(修改)
[root@localhost htdocs]# rm -rf index.php
[root@localhost htdocs]# cp /home/arvon/upload/index.php ./
[root@localhost htdocs]# pwd
/usr/local/apache2/htdocs
12.使用浏览器进行设置
ip/install
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。