找回密码
 立即注册
搜索
热搜: 生活 中国

阿里云一键安装包:

[复制链接]
admin 发表于 2016-7-15 19:08:07 | 显示全部楼层 |阅读模式
  1. 下载一键安装包:
  2. http://market.aliyun.com/product/12-121590002-cmgj000262.html?spm=5176.7150518.1996836753.5.ZoE32o
  3. 在服务器安装rz命令
  4. yum install lrzsz
  5. rz 选择要上传文件sh.zip
  6. 安装解压命令:
  7. yum install unzip #本机已经安装了.所以这里不安装
  8. 解压
  9. unzip -x sh.zip #解压后脚本的权限不够
  10. chmod -R 755 sh #-R 递归将目录里面所有文件权限都改为755
  11. 在sh目录下执行
  12. ./install.sh
  13. 安装完毕后,检查
  14. ps -ef|grep nginx
  15. ps -ef|grep mysql
  16. 在sh目录下执行
  17. cat account.log #查看mysql账号密码
  18. FTP:
  19. account:www
  20. password:zzzzzz
  21. MySQL:
  22. account:root
  23. password:zzzzzz
  24. netstat -nat #查看3306端口有没有listen
  25. rpm -q mysql #查询发现是mysql-server没有安装
  26. yum install mysql-server #安装mysql-server服务
  27. service mysqld restart
  28. mysql #查看mysql信息
  29. mysql -p3306 -u用户名 -p密码 #登录mysql
  30. mysql -p3306 -uroot -pzzzzzzz
  31. use mysql #进入mysql这个数据库
  32. show tables
  33. desc user
  34. select Host,User,Password from user; #查看数据库用户
  35. exit #退出
  36. mysql -p3306 -u用户名 -p密码 #登录mysql
  37. use mysql
  38. update user set Host='%' where Host='localhost' #%表示任意的,这样就可以在其他电脑连接ip
  39. flush privileges #刷新
  40. 在外部电脑:
  41. 浏览器输入:服务器ip #对phpwind进行设置
  42. Nginx添加网站:
  43. 在服务器目录: /alidata/server 有下面目录:
  44. mysql mysql-5.6.21 nginx nginx-1.4.4 php php-5.5.7
  45. 进入目录: /alidata/server/nginx/conf
  46. cat nginx.conf #这个文件找到最后一行
  47. include /alidata/server/nginx/conf/vhosts/*.conf;
  48. #包含了vhosts下面所有配置文件,一个网站一个conf
  49. 进入目录:alidata/server/nginx/conf/vhosts/
  50. 查看文件: cat phpwind.conf
  51. 文件开始:::::
  52. server {
  53. listen 80;
  54. server_name localhost; #这里localhost,所以浏览器输入ip可以访问,如果输入www.xxx.com,浏览器就只能输入相关域名
  55. index index.html index.htm index.php;
  56. root /alidata/www/phpwind;
  57. location ~ .*\.(php|php5)?$
  58. {
  59. #fastcgi_pass unix:/tmp/php-cgi.sock;
  60. fastcgi_pass 127.0.0.1:9000;
  61. fastcgi_index index.php;
  62. include fastcgi.conf;
  63. }
  64. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  65. {
  66. expires 30d;
  67. }
  68. location ~ .*\.(js|css)?$
  69. {
  70. expires 1h;
  71. }
  72. #伪静态规则
  73. include /alidata/server/nginx/conf/rewrite/phpwind.conf;
  74. access_log /alidata/log/nginx/access/phpwind.log;
  75. 文件结束:::::::::
  76. 添加站点:www.paidaxue.com
  77. cp default.conf.bak paidaxue.conf
  78. 修改文件:vim paidaxue.conf
  79. 修改: server_name localhost;
  80. 修改为:
  81. server_name www.paidaxue.com;
  82. 修改: root /alidata/www/phpwind;
  83. 修改为:
  84. root /alidata/www/paidaxue.com;
  85. 修改: 如果原来没有这一段就忽略修改
  86. log_farmat aliyun '$remote_addr - $remote_user [$time_local] "$request" '
  87. '$status $body_bytes_sent "$http_referer" '
  88. ' "$http_user_agent" "$http_x_forwarded_for"';
  89. 修改为:
  90. log_farmat paidaxue '$remote_addr - $remote_user [$time_local] "$request" '
  91. '$status $body_bytes_sent "$http_referer" '
  92. ' "$http_user_agent" "$http_x_forwarded_for"';
  93. 修改:
  94. access_log /alidata/log/nginx/access/default.log;
  95. 修改为:
  96. access_log /alidata/log/nginx/access/paidaxue.com;
  97. 保存
  98. 进入目录:
  99. /alidata/server/nginx/sbin/nginx -s reload #重启nginx
  100. 浏览器输入:www.paidaxue.com #会显示404not found 因为没有对应目录
  101. 新建目录:alidata/www/paidaxue.com
  102. mkdir -p /alidata/www/paidaxue.com
  103. 查看新建的目录: #paidaxue.com是在root的用户,root用户组中
  104. drwxr-xr-x 2 root root 4096 Jan 13 17:00 paidaxue.com
  105. drwxr-xr-x 26 www www 4096 Jan 13 16:15 phpwind
  106. 浏览器输入:www.paidaxue.com #会显示403Forbidden 因为没有权限访问
  107. 所以要对 paidaxue.com的权限进行更改,变成和下面一样的www
  108. cd /alidata/www/
  109. chown -R www:www /alidata/www/paidaxue.com
  110. 浏览器输入:www.paidaxue.com #会显示403Forbidden 因为里面没有文件
  111. cd /alidata/www/paidaxue.com
  112. 在上面文件夹新建index.html
  113. 浏览器输入:www.paidaxue.com #正常
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|生活导航|生活导航 ( 新ICP备12003026-1号 )

GMT+8, 2024-5-20 18:03 , Processed in 0.078254 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表