LAMP源码编译安装实录

[[email protected] ~]# rpm -ivh epel-release-6-8.noarch.rpm
[[email protected] ~]# yum install -y expat-devel openssl openssl-devel pcre pcre-devel

[[email protected] ~]# groupadd apache
[[email protected] ~]# useradd apache -g apache -s /bin/nologin
[[email protected] ~]# tar zxvf apr-1.6.3.tar.gz
[[email protected] ~]# cd apr-1.6.3
[[email protected] apr-1.6.3]# ./configure --prefix=/usr/local/apr 
[[email protected] apr-1.6.3]# make
[[email protected] apr-1.6.3]# make install
[[email protected] ~]# tar zxvf apr-util-1.6.1.tar.gz
[[email protected] ~]# cd apr-util-1.6.1
[[email protected] apr-util-1.6.1]# ./configure --with-apr=/usr/local/apr/bin/apr-1-config
[[email protected] apr-util-1.6.1]# make
[[email protected] apr-util-1.6.1]# make install
[[email protected] ~]# tar zxvf httpd-2.4.29.tar.gz 
[[email protected] ~]# cd httpd-2.4.29
[[email protected] httpd-2.4.29]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-ssl --enable-so --enable-cgi --enable-rewrite --with-pcre --with-zlib --enable-modules=most --enable-mods-shared=most --enable-mpms-shared=all --with-mpm=worker --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config

[[email protected] httpd-2.4.29]# make
[[email protected] httpd-2.4.29]# make install
[[email protected] ~]# vim /etc/httpd/httpd.conf
PidFile  "/var/run/httpd.pid"
ServerName 192.168.40.35:80
User apache
Group apache
[[email protected] ~]# vim /etc/man.config
MANPATH /usr/local/apache/man
[[email protected] ~]# vi /etc/init.d/httpd
#!/bin/bash
 #
 # httpd        Startup script for the Apache HTTP Server
 #
 # chkconfig: - 85 15
 # description: Apache is a World Wide Web server.  It is used to serve  #        HTML files and CGI.
 # processname: httpd
 # config: /etc/httpd/conf/httpd.conf
 # config: /etc/sysconfig/httpd
 # pidfile: /var/run/httpd.pid
# Source function library.
 . /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
         . /etc/sysconfig/httpd
 fi
# Start httpd in the C locale by default.
 HTTPD_LANG=${HTTPD_LANG-"C"}
# This will prevent initlog from swallowing up a pass-phrase prompt if
 # mod_ssl needs a pass-phrase from the user.
 INITLOG_ARGS=""
# Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
 # with the thread-based "worker" MPM; BE WARNED that some modules may not
 # work correctly with a thread-based MPM; notably PHP will refuse to start.
# Path to the apachectl script, server binary, and short-form for messages.
 apachectl=/usr/local/apache/bin/apachectl
 httpd=${HTTPD-/usr/local/apache/bin/httpd}
 prog=httpd
 pidfile=${PIDFILE-/var/run/httpd.pid}
 lockfile=${LOCKFILE-/var/lock/subsys/httpd}
 RETVAL=0
start() {
         echo -n $"Starting $prog: "
         LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
         RETVAL=$?
         echo
         [ $RETVAL = 0 ] && touch ${lockfile}
         return $RETVAL
 }
stop() {
   echo -n $"Stopping $prog: "
   killproc -p ${pidfile} -d 10 $httpd
   RETVAL=$?
   echo
   [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
 }
 reload() {
     echo -n $"Reloading $prog: "
     if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
         RETVAL=$?
         echo $"not reloading due to configuration syntax error"
         failure $"not reloading $httpd due to configuration syntax error"
     else
         killproc -p ${pidfile} $httpd -HUP
         RETVAL=$?
     fi
     echo
 }
# See how we were called.
 case "$1" in
   start)
   start
   ;;
   stop)
   stop
   ;;
   status)
         status -p ${pidfile} $httpd
   RETVAL=$?
   ;;
   restart)
   stop
   start
   ;;
   condrestart)
   if [ -f ${pidfile} ] ; then
     stop
     start
   fi
   ;;
   reload)
         reload
   ;;
   graceful|help|configtest|fullstatus)
   $apachectl [email protected]
   RETVAL=$?
   ;;
   *)
   echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
   exit 1
 esac
exit $RETVAL

[[email protected] ~]# chmod a+x /etc/init.d/httpd
[[email protected] ~]# chkconfig --add httpd
[[email protected] ~]# chkconfig --level 345 httpd on
[[email protected] ~]# service httpd start
Starting httpd:                                            [  OK  ]
[[email protected] ~]# netstat -tupln |grep http
tcp        0      0 :::80                       :::*                        LISTEN      1974/httpd
[[email protected] ~]# yum install -y libaio* ncurses-devel cmake
[[email protected] ~]# echo "192.168.1.201   king01" >>/etc/hosts
[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.201   king01
[[email protected] ~]# useradd mysql
[[email protected] ~]# id mysql
uid=500(mysql) gid=500(mysql) groups=500(mysql)
[[email protected] ~]# cat >> /etc/security/limits.conf <<EOF
mysql            soft    nproc          2047
mysql            hard    nproc          16384
mysql            soft    nofile         1024
mysql            hard    nofile         65536
EOF
[[email protected] ~]# tar zxvf mysql-5.6.36.tar.gz 
[[email protected] ~]# cd mysql-5.6.36
[[email protected] mysql-5.6.36]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci

[[email protected] mysql-5.6.36]# make && make install

[[email protected] mysql-5.6.36]# cd support-files/
[[email protected] support-files]# cp mysql.server /etc/init.d/mysqld
[[email protected] support-files]# chmod a+x /etc/init.d/mysqld
[[email protected] ~]# vim /etc/my.cnf 
[mysqld]
port = 3306
user = mysql
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /tmp/mysql.sock
pid-file = /usr/local/mysql/data/mysql.pid
log_error = /usr/local/mysql/data/mysql.err
explicit_defaults_for_timestamp
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
open-files-limit = 65535
max_connections = 500
max_connect_errors = 10000
key_buffer_size = 256M
max_allowed_packet = 16M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
sort_buffer_size = 1M
join_buffer_size = 1M
tmp_table_size = 256M
max_heap_table_size = 256M
table_open_cache = 512
thread_cache_size = 64
slow_query_log = 1
long_query_time = 5
log-queries-not-using-indexes
slow-query-log-file = /usr/local/mysql/data/slow-query.log
log_bin = mysql-bin
binlog_format = row
sync_binlog = 1
binlog_cache_size = 16M
max_binlog_cache_size = 32M
max_binlog_size = 512M
expire_logs_days = 7
relay_log = relay-bin
relay_log_recovery = 1
master_info_repository = table
relay_log_info_repository = table
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 2
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_log_buffer_size = 16M
innodb_undo_logs= 128
innodb_undo_tablespaces = 3
innodb_file_format = Barracuda
innodb_strict_mode = 1
innodb_data_file_path = ibdata1:1024M:autoextend
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
socket = /tmp/mysql.sock
[client]
socket = /tmp/mysql.sock
[[email protected] ~]# cd /usr/local/mysql
[[email protected] mysql]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[[email protected] ~]# vim /etc/profile
PATH=$PATH:/usr/local/mysql/bin
[[email protected] ~]# source /etc/profile
[[email protected] ~]# chkconfig --add mysqld
[[email protected] ~]# chkconfig --level 345 mysqld on
[[email protected] ~]# chkconfig --list |grep mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off
[[email protected] ~]# service mysqld start
Starting MySQL.......                                      [  OK  ]

[[email protected] ~]# service mysqld status
MySQL running (15612)                                      [  OK  ] 

[[email protected] ~]# netstat -tupln |grep mysqld
tcp        0      0 :::3306                     :::*                        LISTEN      10101/mysqld

[[email protected] ~]# echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
[[email protected] ~]# ldconfig

[[email protected] ~]# mysql_secure_installation
[[email protected] ~]# mysql -uroot -pabcd.1234 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
 
mysql> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *8E329B15E3C0FF9DDF7597B748CCE9473593BF60 |
| root | 127.0.0.1 | *8E329B15E3C0FF9DDF7597B748CCE9473593BF60 |
| root | ::1       | *8E329B15E3C0FF9DDF7597B748CCE9473593BF60 |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)


原文地址:http://blog.51cto.com/13598811/2104461

时间: 2024-12-18 04:57:12

LAMP源码编译安装实录的相关文章

详解LAMP源码编译安装

实战:LAMP源码编译安装 家住海边喜欢浪:zhang789.blog.51cto.com 目录 详解LAMP源码编译安装 LAMP简介 一.准备工作 二.编译安装 Apache 三.编译安装 MySQL 四.编译安装 PHP 测试LAMP搭建开源数据web管理程序phpMyadmin 详解LAMP源码编译安装 LAMP简介 LAMP是当下非常流行的一套Web架构,我们可以在GNU/Linux下通过其他人打包的程序包来进行安装; 但是在生产环境中,很多时候都需要我们自己定制安装AMP,编译安装L

lamp源码编译安装及优化

lamp源码编译安装及优化

LAMP源码编译安装配置

系统环境CentOS6.5 一.编译安装Apache 关闭selinux和防火墙 1.解决依赖关系 [[email protected] ~]# yum install gcc gcc-c++ openssl openssl-devel 编译安装apr(The mission of the Apache Portable Runtime (APR) project is to create and maintain software libraries that provide a predic

LAMP源码编译安装

原文地址:http://blog.51cto.com/jiazuzhao/2071181

LNMP源码编译安装实录

Nginx [[email protected] ~]# rpm -ivh epel-release-6-8.noarch.rpm  [[email protected] ~]# yum install -y pcre pcre-devel openssl openssl-devel [[email protected] ~]# useradd nginx -s /sbin/nologin -M [[email protected] ~]# tar zxvf nginx-1.10.3.tar.g

LAMP纯源码编译安装日志

一.LAMP构架的安装与经验技巧(源码安装好处.是便于管理,可以选定参数,可以使用新版本) 相关软件列表: # ls /soft/ | grep -E "*.gz|*.zip|*.xz|*.bz2"    apr-1.4.5.tar.gz    apr-util-1.3.12.tar.gz    autoconf-2.61.tar.gz    freetype-2.3.12.tar.gz    httpd-2.4.18.tar.bz2    jpegsrc.v6b.tar.gz    

源码编译安装 httpd2.4+MariaDB5.5+php5.4 全新的LAMP

操作环境: http主机,php主机,MariaDB主机,操作系统CentOS6.5 x86_64 全部安装包组:Development tools  ServerPlatform Development httpeth0 IP:172.16.32.11 MariaDBeth0 IP:172.16.32.10 phpeth0 IP:172.16.32.12 httpd2.4新特性:解释下面安装用到的几个 event不再是测试状态,而是可以直接编译进去,mpm模块可以动态装载卸载 分了多个配置文件

源码编译安装分离式LAMP平台

前言: LAMP是指:Linux(操作系统),Apache(Web服务器),MySQL/MariaDB(数据库),PHP/Perl/Python(脚本语言),所有组成产品各自独立的开源软件,组合在一起使用,就组成了目前互联网中流行的Web框架:与Java/J2EE架构相比,LAMP具有Web资源丰富,轻量,开发快速等特点,与微软的.NET架构相比,LAMP具有通用.跨平台.高性能.低价格的优势,因此LAMP无论是性能.质量还是价格都是企业搭建网站的首选平台. 工作原理: 分离式的LAMP架构,A

LAMP环境官方最新源码编译安装

前言 Linux+Apache+Mysql/MariaDB+Perl/PHP/Python一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台.随着开源潮流的蓬勃发展,开放源代码的LAMP已经与J2EE和.Net商业软件形成三足鼎立之势,并且该软件开发的项目在软件方面的投资成本较低,因此受到整个IT界的关注.从网站的流量上来说,70%以上的访问流量是LAMP来提供的,LAMP是最强大的网站解决