Nginx
nginx-1.9.12.tar.gz 编译安装
[root@localhostlocal]# tar zxvf nginx-1.9.12.tar.gz
[root@localhostlocal]# cd nginx-1.9.12
[[email protected]]# yum install gcc openssl-devel pcre-develzlib-devel wget -y
[[email protected]]#./configure --user=www --group=www --prefix=/usr/local/nginx--with-http_stub_status_module --with-http_ssl_module
[[email protected]]# make && make install
[root@localhostnginx]# ./sbin/nginx 启动服务器
[[email protected]]#ps –ef | grep nginx
php
php-5.6.19.tar.gz编译安装
[root@localhostlocal]#tar zxvf php-5.6.19.tar.gz
[root@localhostlocal]#cd php-5.6.19
[[email protected]]#yum install libxml2-devel openssl-devel bzip2-devel libmcrypt-devel–y
[[email protected]]#./configure --prefix=/usr/local/php--with-config-file-path=/etc --enable-fpm --enable-cli --enable-pcntl --enable-sockets --enable-opcache --enable-sysvsem--enable-sysvmsg --enable-sysvshm --enable-shmop --enable-zip--enable-ftp --disable-rpath --disable-debug--with-pcre-regex --with-mcrypt --enable-xml--with-openssl --with-imap-ssl --enable-soap--with-iconv --with-curl --disable-fileinfo --with-xmlrpc --with-mhash --with-gd --with-freetype-dir--with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr--disable-rpath --enable-bcmath --enable-inline-optimization--enable-mbregex --enable-mbstring --enable-gd-native-ttf --with-ldap-sasl --enable-pdo--with-pdo-mysql --with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config --with-pear --with-libdir=lib64
[root@localhost php-5.6.19]#make
[root@localhost php-5.6.19]#make install
[root@localhost php-5.6.19]# cpphp.ini-production /etc/php.ini 配置文件拷贝
[root@localhost php-5.6.19]# cpsapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm 启动文件拷贝
[root@localhost php-5.6.19]# chmod +x/etc/rc.d/init.d/php-fpm 设置权限
[root@localhost php-5.6.19]# chkconfig --addphp-fpm
[root@localhost php-5.6.19]# chkconfigphp-fpm on 开机自起
[root@localhost php-5.6.19]# cp /usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
[root@localhost etc]# /etc/init.d/php-fpmstart
[root@localhost etc]# netstat –anpt
Mysql 编译安装
(1)先安装cmake(mysql5.5以后是通过cmake来编译的)
[root@localhostlocal]#tar -zxvf cmake-3.5.0.tar.gz
[root@localhost local]#cd cmake-3.5.0
[[email protected]]#./configure
[root@localhost cmake-3.5.0]# make
[root@localhost cmake-3.5.0]# make install
(2)创建mysql的安装目录及数据库存放目录
[root@localhostlocal]#mkdir -p /usr/local/mysql //安装mysql
[root@localhost local]#mkdir -p /usr/local/mysql/data //存放数据库
(3)创建mysql用户及用户组
[root@localhostlocal]#groupadd mysql
[root@localhost local]#useradd -r -g mysql mysql
(4)安装mysql
[root@localhostlocal]# tar xf mysql-5.6.29.tar.gz
[root@localhost local]# cd mysql-5.6.29
[root@localhostlocal]#yum -y install gcc-c++ make cmakebison-devel ncurses-devel
[root@localhost mysql-5.6.29]# 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\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci\
-DMYSQL_USER=mysql\
-DEXTRA_CHARSETS=all\
-DWITH_DEBUG=0 \
-DWITH_ZLIB=system\
-DWITH_SSL=system
[root@localhost mysql-5.6.29]# make && makeinstall
2.配置
(1)设置目录权限
[root@localhostlocal]# cd /usr/local/mysql
[root@localhost mysql]# chown -R root:mysql . //把当前目录中所有文件的所有者所有者设为root,所属组为mysql
[root@localhost mysql]# chown -R mysql:mysql data
(3)创建系统数据库的表
[root@localhostmysql]# cd /usr/local/mysql
[root@localhost mysql]# scripts/mysql_install_db --user=mysql
2)
[root@localhostmysql]# cp my.cnf /etc/my.cnf //将mysql的启动服务添加到系统服务中
(4)拷贝启动脚本
[root@localhostmysql]# cp support-files/mysql.server /etc/init.d/mysql //将mysql的启动服务添加到系统服务中
(4)开机自动启动
[root@localhostmysql]# chkconfig mysql on
(5) 启动mysql
[root@localhostmysql]# /etc/init.d/mysql start
(6)检查启动端口
[root@localhostmysql]# netstat -anpt
(7)查看数据库
[root@localhostmysql]# ./bin/mysql
mysql> showdatabases;
(8)环境变量设置
[root@localhostmysql]# vim /etc/profile
加入变量设置
内容最下面
#MYSQL
exportMysql_HOME=/usr/local/mysql
exportPATH=$Mysql_HOME/bin:$PATH
(9)直接进入mysql
[root@localhostmysql]# source /etc/profile
[root@localhostmysql]# mysql
(10)mysql 路径
[root@localhostmysql]# which mysql
(11)设置mysql 密码
[root@localhostmysql]# mysqladmin -uroot -p password '123456'
直接enter