首先得申明一下使用的工具有:
1. putty https://pan.baidu.com/s/1i4Ix8Hn
2. fileZilla https://pan.baidu.com/s/1nvJR8al
如果是抢购阿里云免费的就按照下面执行下去就行了,如果花钱买的主机,会顺手送你一个Apache服务器,你的手动卸载Apache,卸载的步骤
rpm -qa|grep -i php
yum remove -y
https://yq.aliyun.com/ziliao/75561 https://www.kafan.cn/edu/49420412.html 也可以联系我hjjuny@163.com
下面先配置Nginx
yum install epel-release -y
yum install https://centos7.iuscommunity.org/ius-release.rpm -y
yum install pcre pcre-devel
yum install zlib zlib-devel
yum install gcc gcc-c++
yum install openssl openssl-devel
yum install libxml2 libxml2-devel
yum install curl curl-devel
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.10.3.tar.gz
tar -zxvf nginx-1.10.3.tar.gz
cd nginx-1.10.3
./configure --prefix=/usr/local/nginx
make
make install
/usr/local/nginx/sbin/nginx
yum install mysql mysql-server –y
service mysqld start
Failed to restart mysqld.service: Unit not found.
CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
|
成功安装之后重启mysql服务
# service mysqld restart
|
初次安装mysql是root账户是没有密码的
设置密码的方法
# mysql -uroot
mysql> set password for ‘root’@‘localhost’ = password('mypasswd');
mysql> exit
|
搞定!
或者 : http://www.cnblogs.com/huangjinwen/p/6264089.html
centos7下yum安装mysql与卸载mysql :
http://www.hongyanliren.com/2015m05/33475.html
然后配置PHP环境
cd /usr/local/src
wget http://cn2.php.net/get/php-5.6.24.tar.gz/from/this/mirror
mv mirror php-5.6.24.tar.gz
tar -zxvf php-5.6.24.tar.gz
cd php-5.6.24
./configure --prefix=/usr/local/php --enable-fpm --with-curl --with-zlib --with-openssl --with-iconv --with-pdo-mysql=mysqlnd --enable-soap
make
make test
make install
cp php.ini-development /usr/local/php/etc/php.ini
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vi /usr/local/nginx/conf/nginx.conf
vi 退出命令:
按ESC键 跳到命令模式,然后:
:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi
:wq! 强制保存文件,并退出vi
q: 不保存文件,退出vi
:q! 不保存文件,强制退出vi
:e! 放弃所有修改,从上次保存文件开始再编辑
cd /usr/local/src/php-5.6.24
cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod a+x /etc/init.d/php-fpm
/etc/init.d/php-fpm start
/usr/local/nginx/sbin/nginx -s reload
vi /usr/local/nginx/html/aa.php
配置用户 (ftp服务软件)
先执行两步:
yum install vsftpd
service vsftpd start
在执行:
第一步:useradd -d /usr/local/html hjjtest
第二步(改密):passwd hjjtest
然后就是输入新密码: hjj,123
Linux中如何添加删除FTP用户并设置权限
http://www.lanmps.com/?spm=5176.100239.blogcont66397.22.5hpE4e