Chinaunix首页 | 论坛 | 博客
  • 博客访问: 387106
  • 博文数量: 112
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-29 13:41
文章分类

全部博文(112)

文章存档

2020年(1)

2018年(10)

2017年(27)

2016年(18)

2015年(31)

2014年(25)

分类: 服务器与存储

2018-12-02 03:59:49

系统环境:CentOS6.5
软件包:httpd-2.4.37.tar.gz apr-1.6.5.tar.gz  apr-util-1.6.1.tar.gz
            mysql-5.5.32.tar.gz cmake-2.8.8.tar.gz
            php-5.6.38.tar.gz
            Discuz_SC_GBK.zip
1、apache源码安装

点击(此处)折叠或打开

  1. 关闭防火墙
  2. iptables -F
  3. chkconfig iptables off
  4. mkdir /tmp/lamp
  5. cd /tmp/lamp
  6. yum install apr apr-util apr-devel apr-util-devel -y
  7. tar -zxvf httpd-2.4.37.tar.gz
  8. cd httpd-2.4.37
  9. ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
  10. ---------------------------如果编译报以下错误----------------------------------
  11. checking for APR... configure: WARNING: APR version 1.4.0 or later is required, found 1.3.9
  12. configure:

  13. WARNING: skipped APR at apr-1-config, version not acceptable
  14. no
  15. configure: error: APR not found. ?Please read

  16. the documentation. 
  17. -------------------------需要更新apr apr-util版本到1.4以上---------------------
  18. tar -zxvf apr-1.6.5.tar.gz -C /tmp/lamp/httpd-2.4.37/srclib/
  19. tar -zxvf apr-util-1.6.1.tar.gz -C /tmp/lamp/httpd-2.4.37/srclib/
  20. cd /tmp/lamp/httpd-2.4.37/srclib
  21. mv apr-1.6.5 apr
  22. mv apr-util-1.6.1 apr-util
  23. -------------------------------------------------------------------------------
  24. 在进行编译:
  25. ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
  26. -----------------------又出现pcre-config报错----------------------------------
  27. configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
  28. ---------------------------------安装pcre-devel即可------------------------------------
  29. yum -y install pcre-devel
  30. wget -P /tmp/lamp ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
  31. tar -zxvf pcre-8.38.tar.gz
  32. ./configure --prefix=/usr/local/pcre
  33. 配置pcre过程C++报错
  34. configure: error: You need a C++ compiler for C++ support.
  35. 安装gcc-c++
  36. yum -y install gcc-c++
  37. 在编译pcre
  38. ./configure --prefix=/usr/local/pcre
  39. make
  40. make install
  41. --------------------------------------------------------------------------------------
  42. 在重新进行编译:
  43. ./configure --prefix=/usr/local/apache2 --with-included-apr --enable-rewrite --enable-so
  44. make
  45. make install
  46. ---------------------------------------apache安装完毕-------------------------------

2、mysql源码安装

点击(此处)折叠或打开

  1. cd /tmp/lamp
  2. 安装cmake
  3. tar xf cmake-2.8.8.tar.gz
  4. cd cmake-2.8.8
  5. ./configure
  6. gmake
  7. gmake install
  8. 安装依赖包
  9. yum install ncurses-devel -y
  10. 创建用户和组
  11. groupadd mysql
  12. 添加mysql用户 指定不能用来登录;
  13. useradd mysql -s /sbin/nologin -M -g mysql
  14. tar -zxvf mysql-5.5.32.tar.gz
  15. cd mysql-5.5.32
  16. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5.32 \
  17. -DMYSQL_DATADIR=/usr/local/mysql-5.5.32/data \
  18. -DMYSQL_UNIX_ADDR=/usr/local/mysql-5.5.32/tmp/mysql.sock \
  19. -DDEFAULT_CHARSET=utf8 \
  20. -DDEFAULT_COLLATION=utf8_general_ci \
  21. -DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
  22. -DENABLED_LOCAL_INFILE=ON \
  23. -DWITH_INNOBASE_STORAGE_ENGINE=1 \
  24. -DWITH_FEDERATED_STORAGE_ENGINE=1 \
  25. -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
  26. -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
  27. -DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
  28. -DWITH_FAST_MUTEXES=1 \
  29. -DWITH_ZLIB=bundled \
  30. -DENABLED_LOCAL_INFILE=1 \
  31. -DWITH_READLINE=1 \
  32. -DWITH_EMBEDDED_SERVER=1 \
  33. -DWITH_DEBUG=0

  34. make
  35. make install
  36. ln -s /usr/local/mysql-5.5.32 /usr/local/mysql
  37. cd /usr/local/mysql/support-files
  38. cp my-small.cnf /etc/my.cnf
  39. echo 'export PATH=/usr/local/mysql/bin:$PATH' >> /etc/profile
  40. tail -1 /etc/profile
  41. source /etc/profile
  42. cd /usr/local/
  43. chown -R mysql.mysql mysql/
  44. 防止/tmp下文件被非所有者删除
  45. chmod -R 1777 /tmp/
  46. cd mysql/scripts/
  47. mysql初始化
  48. ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --user=mysql
  49. cd ../support-files/
  50. cp mysql.server /etc/init.d/mysqld
  51. chmod +x /etc/init.d/mysqld
  52. /etc/init.d/mysqld start
  53. netstat -nltup|grep 3306
  54. chkconfig mysqld on
  55. chkconfig --list mysqld
  56. 清理一些不必要的库和user信息
  57. mysql
  58. mysql> select user,host from mysql.user;
  59. +------+-------------+
  60. | user | host |
  61. +------+-------------+
  62. | root | 127.0.0.1 |
  63. | root | ::1 |
  64. | | localhost |
  65. | root | localhost |
  66. | | songhyunmin |
  67. | root | songhyunmin |
  68. +------+-------------+
  69. 6 rows in set (0.00 sec)
  70. mysql> delete from mysql.user where user=''
  71. mysql> delete from mysql.user where host='songhyunmin';
  72. mysql> delete from mysql.user where host='::1';
  73. mysql> select user,host from mysql.user;
  74. +------+-----------+
  75. | user | host |
  76. +------+-----------+
  77. | root | 127.0.0.1 |
  78. | root | localhost |
  79. +------+-----------+
  80. 2 rows in set (0.00 sec)
  81. mysql> show databases;
  82. +--------------------+
  83. | Database |
  84. +--------------------+
  85. | information_schema |
  86. | mysql |
  87. | performance_schema |
  88. | test |
  89. +--------------------+
  90. 4 rows in set (0.00 sec)
  91. mysql> drop database test;
  92. Query OK, 0 rows affected (0.00 sec)

  93. mysql> show databases;
  94. +--------------------+
  95. | Database |
  96. +--------------------+
  97. | information_schema |
  98. | mysql |
  99. | performance_schema |
  100. +--------------------+
  101. 3 rows in set (0.00 sec)
  102. 创建密码
  103. mysqladmin -uroot password '123456'
  104. mysql -uroot -p123456
  105. 查看系统字符集
  106. cat /etc/sysconfig/i18n
  107. LANG="zh_CN.UTF-8"
  108. ----------------------------------mysql安装完毕----------------------------------------
3、PHP源码安装

点击(此处)折叠或打开

  1. cd /tmp/lamp/
  2. tar -zxvf php-5.6.38.tar.gz
  3. cd php-5.6.38
  4. ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php/etc --with-

  5. apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
  6. --------------------------------------报错---------------------------------
  7. configure: error: xml2-config not found. Please check your libxml2 installation.
  8. ---------------------------安装libxml2 libxml2-devel-------------------------
  9. yum install libxml2 libxml2-devel -y
  10. 在重新配置
  11. ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php/etc --with-

  12. apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/
  13. make
  14. make install

  15. 整合apache+php环境,修改/usr/local/apache2/conf/httpd.conf
  16. 修改
  17. ServerName localhost:80
  18. 添加
  19. AddType application/x-httpd-php .php
  20. DirectoryIndex index.php index.html

  21. 编译index.php配置文件
  22. cat >> /usr/local/apache2/htdocs/index.php << EOF
  23. php
  24. phpinfo();
  25. ?>
  26. EOF
  27. 启动apache
  28. /usr/local/apache2/bin/apachectl start

IE访问


4、安装discuz


点击(此处)折叠或打开

  1. cd /tmp/lamp
  2. unzip Discuz_SC_GBK.zip -d /usr/local/apache2/htdocs/
  3. cd /usr/local/apache2/htdocs/
  4. mv dir_SC_GBK/upload/* .
  5. chmod -R 777 data/ uc_server/ config/ uc_client/
  6. /usr/local/apache2/bin/apachectl restart
  7. 创建discuz数据库
  8. mysql -uroot -p123456
  9. mysql> create database discuz;
  10. mysql> grant all on discuz.* to discuz@'localhost' identified by '123456'

IE访问









阅读(744) | 评论(0) | 转发(0) |
0

上一篇:ntpd服务器搭建

下一篇:脚本部署LAMP_DISCUZ

给主人留下些什么吧!~~