Apache运维架构之Apache+PHP(2)

2、安装编译apache
[root@ansible tools]# useradd -s /sbin/nologin -M www
[root@ansible tools]# tar xf httpd-2.4.18.tar.bz2 
[root@ansible tools]# cd httpd-2.4.18
[root@ansible httpd-2.4.18]# ./configure --prefix=/usr/local/apache2  --enable-mods-shared=all --enable-so --enable-proxy-ajp --enable-rewrite --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
[root@ansible httpd-2.4.18]# make && make install

3、安装编译mysql
[root@ansible mysql-5.6.17]# useradd -s /sbin/nologin -M mysql
[root@ansible mysql-5.6.17]# yum install cmake -y
[root@ansible tools]# tar xf mysql-5.6.17.tar.gz 
[root@ansible tools]# cd mysql-5.6.17
[root@ansible mysql-5.6.17]# cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DMYSQL_TCP_PORT=3306 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
[root@ansible mysql-5.6.17]# make && make install
 
[root@ansible mysql-5.6.17]# chown -R mysql.mysql /usr/local/mysql/
[root@ansible scripts]# pwd
/tools/mysql-5.6.17/scripts
[root@ansible scripts]# chmod +x mysql_install_db
[root@ansible scripts]# ./mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql
 
 
Installing MySQL system tables...2016-08-19 13:13:18 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-19 13:13:18 64062 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-19 13:13:18 64062 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-19 13:13:18 64062 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-19 13:13:18 64062 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-19 13:13:18 64062 [Note] InnoDB: Not using CPU crc32 instructions
2016-08-19 13:13:18 64062 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-19 13:13:18 64062 [Note] InnoDB: Completed initialization of buffer pool
2016-08-19 13:13:18 64062 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-08-19 13:13:18 64062 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-08-19 13:13:18 64062 [Note] InnoDB: Database physically writes the file full: wait...
2016-08-19 13:13:19 64062 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-08-19 13:13:21 64062 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-08-19 13:13:23 64062 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-08-19 13:13:23 64062 [Warning] InnoDB: New log files created, LSN=45781
2016-08-19 13:13:23 64062 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-08-19 13:13:23 64062 [Note] InnoDB: Doublewrite buffer created
2016-08-19 13:13:23 64062 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-19 13:13:23 64062 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-08-19 13:13:23 64062 [Note] InnoDB: Foreign key constraint system tables created
2016-08-19 13:13:23 64062 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-08-19 13:13:23 64062 [Note] InnoDB: Tablespace and datafile system tables created.
2016-08-19 13:13:23 64062 [Note] InnoDB: Waiting for purge to start
2016-08-19 13:13:23 64062 [Note] InnoDB: 5.6.17 started; log sequence number 0
2016-08-19 13:13:24 64062 [Note] Binlog end
2016-08-19 13:13:24 64062 [Note] InnoDB: FTS optimize thread exiting.
2016-08-19 13:13:24 64062 [Note] InnoDB: Starting shutdown...
2016-08-19 13:13:24 64062 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK
 
Filling help tables...2016-08-19 13:13:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-08-19 13:13:24 64085 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-08-19 13:13:24 64085 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-19 13:13:24 64085 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-08-19 13:13:24 64085 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-19 13:13:24 64085 [Note] InnoDB: Not using CPU crc32 instructions
2016-08-19 13:13:24 64085 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-19 13:13:24 64085 [Note] InnoDB: Completed initialization of buffer pool
2016-08-19 13:13:24 64085 [Note] InnoDB: Highest supported file format is Barracuda.
2016-08-19 13:13:24 64085 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-19 13:13:25 64085 [Note] InnoDB: Waiting for purge to start
2016-08-19 13:13:25 64085 [Note] InnoDB: 5.6.17 started; log sequence number 1625977
2016-08-19 13:13:25 64085 [Note] Binlog end
2016-08-19 13:13:25 64085 [Note] InnoDB: FTS optimize thread exiting.
2016-08-19 13:13:25 64085 [Note] InnoDB: Starting shutdown...
2016-08-19 13:13:26 64085 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK
 
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
 
  /usr/local/mysql/bin/mysqladmin -u root password 'new-password'
  /usr/local/mysql/bin/mysqladmin -u root -h ansible password 'new-password'
 
Alternatively you can run:
 
  /usr/local/mysql/bin/mysql_secure_installation
 
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
 
See the manual for more instructions.
 
You can start the MySQL daemon with:
 
  cd . ; /usr/local/mysql/bin/mysqld_safe &
 
You can test the MySQL daemon with mysql-test-run.pl
 
  cd mysql-test ; perl mysql-test-run.pl
 
Please report any problems at
 
The latest information about MySQL is available on the web at
 
 
 
Support MySQL by buying support/licenses at
 
New default config file was created as /usr/local/mysql/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings 
 
注:在启动MySQL服务时,会按照一定次序搜索my.cnf,先在/etc目录下找,找不到则会搜索"$basedir/my.cnf",
在本例中就是 /usr/local/mysql/my.cnf,这是新版MySQL的配置文件的默认位置!
 
[root@ansible httpd-2.4.18]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@ansible httpd-2.4.18]# chmod +x /etc/init.d/mysqld 
[root@ansible httpd-2.4.18]# /etc/init.d/mysqld start
Starting MySQL....... SUCCESS!

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4e2f08e7121d2b8a1ada5eba254c2ccc.html