赞
踩
ssh root@123.124.124.125 -p 22 (22是访问云主机默认端口不加也可访问)
or
ssh root@123.124.124.125 (也可登录云主机)
之后便要输入云主机密码(这里使用假设的密码:123456)
密码输入无误后便成功登录云主机了,显示如下欢迎文案(本文基于阿里云主机ESC为基础,如下为ESC云主机欢迎文案):
至此,登录云主机成功!
yum install nginx -y
pwd (查看当前路径)
cd /etc/nginx/conf.d (进入 nginx 的配置目录)
> default.conf (清空原 default.conf 文件)
vim default.conf (vim 编辑 default.conf 文件)
server { listen 80 default_server; # listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }
nginx
chkconfig nginx on
nginx -v
yum install mysql-server -y(默认的版本5.1,很低,不推荐)
# 更新 yum 源
yum update
# 添加 mysql5.6 yum 源
# centos6
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# centos7
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql-server
service mysqld restart
/usr/bin/mysqladmin -u root password '123'
chkconfig mysqld on
mysql -V
php -v (查看当前php版本信息)
or
rpm -qa|grep php (查看当前php相关软件版本及相关信息)
yum remove php* php-common
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum list --enablerepo=webtatic | grep php (这条指令很重要,可做以后安装对应版本php扩展依据,显示当前源包含的所有php包)
yum search php56w
yum install php56w php56w-fpm php56w-mbstring php56w-mysqlnd php56w-pecl-redis php56w-mcrypt php56w-opcache -y
yum install php56w-gd
yum install php php-fpm php-mysql -y (不推荐,推荐上面方式)
Error: Package: php71w-common-7.1.14-1.w6.x86_64 (webtatic)
Requires: libgmp.so.3()(64bit)
–遇到这个问题说明linux系统缺少libgmp.so.3的依赖库,参考安装libgmp.so.3依赖库解决,简单说一下(教程里都有):
(1).先下载下来libgmp.so.3库到本地;
(2).使用filezlla将文件上传到云主机上;
(3).使用:yum install libgmp.so.3 命令在云主机上安装libgmp.so.3依赖库;
(4).之后继续上面安装php的步骤,问题解决。
service php-fpm start
netstat -nlpt | grep php-fpm
chkconfig php-fpm on
php -v (查看当前php版本信息)
or
rpm -qa|grep php (查看当前php相关软件版本及相关信息)
pwd
cd /etc/nginx/conf.d
ls
touch php.conf
vim php.conf
server {
listen 8000;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
# root /usr/share/php;
root /data/topay;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
service nginx restart (重启nginx)
or
nginx -s reload (重新读取nginx配置文件)
pwd
cd ~/../
mkdir data
cd data
mkdir topay
cd topay
pwd
ls
cd /data/topay
touch info.php
vim info.php
<?php phpinfo(); ?> (打印当前php版本信息)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。