===================================================
安装NGINX
===================================================
wget http://nginx.org/download/nginx-1.9.15.tar.gz
减压
tar -zxvf nginx-1.9.15.tar.gz
安装依赖包
yum install gcc gcc-gcc+ automake pcre pcre-devel zlib zlib-decel openssl openssl-devel
进入
cd nginx-1.9.15.tar.gz
安装配置的位置
./configure --prefix=/usr/local/nginx
执行安装
make && make install
启动nginx
sbin/nginx
====================================================
php安装
====================================================
yum安装
yum -y install libxml2
yum -y install libxml2-devel
下载
wget http://am1.php.net/distributions/php-7.0.9.tar.gz
解压
tar -zxvf php-7.0.21.tar.gz
安装配置路径
./configure --prefix=/usr/local/php --enable-fpm
执行配置
make && make install
==========================================================
# cp php.ini-development /usr/local/php/lib/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
========================或者==============================
/usr/local/php查看生成文件
解压包里配置php.ini文件
cp php.ini-production /usr/local/php/etc/php.ini
创建/usr/local/php/etc/ php-fpm.conf文件
在生成文件里的etc下
cp php-fpm.conf.default php-fpm.conf
创建www.conf文件
在生成文件里的etc下
cd etc/php-fpm.d/
cp www.conf.default www.conf
nginx里的nginx.conf里添加
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
启动php-fpm
sbin/php-fpm &
查看
ps -ef | grep php-fpm
netstat -an | grep 9000 (端口号)
netstat -apn | grep 9000
/user/local/php/etc/php-fpm.d/www.conf
启动nginx
sbin/nginx
查看进程
ps -ef | grep nginx
============================================================
安装mysql
============================================================
| 卸载mysql |
| yum remove mysql*|
| rpm -qa|grep -i mysql|
| rpm -e -nodeps 包名删除mysql有关软件|
| 卸载后/etc/my.cnf需要进行手工删除,命令是:|
| rm -rf /etc/my.cnf|
| rpm -qa|grep -i mysql来确认卸载干净|
|_______________________________________________|
下载
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装包
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装
sudo yum install mysql-server
重置密码前登录
mysql -u root
登录时报错,加权限
sudo chown -R openscanner:openscanner /var/lib/mysql
重启服务
service mysqld restart
登录重置密码
mysql -u root
mysql > use mysql;
mysql > update user set password=password('123456') where user='root';====》(root是用户名)
mysql > exit;
开放3306端口号
sudo vim /etc/sysconfig/iptables
添加内容
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
保存后重启防火墙
sudo service iptables restart
==========================================================================
--------------------------------安装mysql---------------------------------
==========================================================================
#下载地址
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
#解压
tar -zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
#复制到/usr/local/mysql
cp -r mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql
#创建用户组合用户名
groupadd mysql
useradd -g mysql mysql
#创建mysql
cd /usr/local/mysql/data
mkdir mysql
#给权限
chown -R mysql:mysql ./
安装
cd ../
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cp support-files/my-default.cnf /etc/my.cnf
#修改脚本
vim /etc/init.d/mysqld
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql
#开启mysql
service mysqld start
#测试mysql
./mysql/bin/mysql -uroot
#添加环境变量
vim ~/.base_profile
export PATH=$PATH:/usr/local/mysql/bin
source ~/.base_profile
#启动mysql
service mysqld start
#关闭mysql
service mysqld stop
#查看运行状态
service mysqld status
mysql远程连接
grant all on *.* to 'root'@'%' identified by '123456';
杀死mysql
pkill /use/local/mysql/bin/mysql
再次启动不了
这时操作同目录下的mysqld_safe
./use/local/mysql/bin/mysqld_safe &