你可以到网上下载一个建站程序,你去百度搜吧,主要是一些cms,你就搜网站cms程序有一大把看你习惯使用哪种,如果觉的界面不好看你可以下载一些相应的模板.
有中文版的免费的吗?操作简单点的
本回答由提问者推荐
你可以到网上下载一个建站程序,你去百度搜吧,主要是一些cms,你就搜网站cms程序有一大把看你习惯使用哪种,如果觉的界面不好看你可以下载一些相应的模板.
有中文版的免费的吗?操作简单点的
本回答由提问者推荐
这个的云服务器的话,你要下载在你的手机上,然后注册就可以用了。
还是不错的,高效低价
网站名称已经加载出来了 证明上传目录正确 检查你的配置是否正确 文件是上传到htdoc
部署java的要用tomcat类,用IIS+PHP+mysql不管用啊
不过要部署java网站,还是建议阿里云服务器采用liunx系统,用Linux+Nginx(或者apache)+tomcat+mysql
使用阿里云搭建个人网盘
Nextcloud 是一款自由 (开源) 的类 Dropbox 软件,由 ownCloud 分支演化形成。它使用 PHP 和 JavaScript 编写,支持多种数据库系统,比如 MySQL/MariaDB、PostgreSQL、Oracle 数据库和 SQLite。它可以使你的桌面系统和云服务器中的文件保持同步,Nextcloud 为 Windows、Linux、Mac、安卓以及苹果手机都提供了客户端支持。Nextcloud 并非只是 Dropbox 的克隆,它还提供了很多附加特性,如日历、联系人、计划任务以及流媒体 Ampache。
本文简单讲述如何在云服务器配置Nextcloud实现个人网盘,仅供学习与交流,请勿用于商业用途
系统环境:阿里云 Centos7 无防火墙,无SElinux
一,配置PHP7-FPM安装Nginx和php7
yum install epel-release -yyum install nginx -y
添加webtatic仓库,里面提供了php7
rpm -Uvh -y install php72w-fpm php72w-cli php72w-gd php72w-mysql php72w-pear php72w-mbstring php72w-pdo php72w-pecl-apcu php72w-pecl-apcu-devel php72w-intl.x86_64
配置php7-fpm
修改配置文件,修改其用户和组为nginx
vim /etc/php-fpm.d/www.conf; Start a new pool named 'www'.[www]; Unix user/group of processes; Note: The user is mandatory. If the group is not set, the default user's group;will be used.; RPM: apache Choosed to be able to access some dir as httpduser = nginx; RPM: Keep a group allowed to write in log dir.group = nginx
检查php-fpm使用端口
; The address on which to accept FastCGI requests.; Valid syntaxes are:;'ip.add.re.ss:port'- to listen on a TCP socket to a specific IPv4 address on;a specific port;;'[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on;a specific port;;'port'- to listen on a TCP socket to all addresses;(IPv6 and IPv4-mapped) on a specific port;;'/path/to/unix/socket' - to listen on a unix socket.; Note: This value is mandatory.listen = 127.0.0.1:9000
启动php-fpm
systemctl start php-fpmsystemctl enable php-fpm二,配置 mariadb数据库
安装mariadb
yum install mariadb-server -y
启动服务并初始化
systemctl start mariadbsystemctl enable mariadbmysql_secure_installation
创建nextcloud数据库并授权给普通用户
create database nextcloud;create user moulongxiong@localhost identified by 'long123';grant all privileges on nextcloud.* to moulongxiong@localhost identified by 'long123';flush privileges;quit;三,下载nextcloud
网络好就去nextcloud官网下载,网速慢从我的阿里云下载,如下所示
wget
解压,并移动到web目录下
unzip nextcloud-18.0.3.zipmv nextcloud/ /var/www/
更改nextcloud文件夹拥有者为nginx
chown nginx:nginx /var/www/nextcloud/四,在nginx配置nextcloud虚拟主机
官网有样板,改成自己的配置即可,我这里是80端口,不使用ssl
upstream php-handler {server 127.0.0.1:9000;#server unix:/var/run/php/php7.2-fpm.sock;}server {listen 80;listen [::]:80;server_name pan.doragon.xyz;# Remove X-Powered-By, which is an information leakfastcgi_hide_header X-Powered-By;# Path to the root of your installationroot /var/www/nextcloud;location = /robots.txt {allow all;log_not_found off;access_log off;}# The following 2 rules are only needed for the user_webfinger app.# Uncomment it if you're planning to use this app.#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;# The following rule is only needed for the Social app.# Uncomment it if you're planning to use this app.#rewrite ^/.well-known/webfinger /public.php?service=webfinger last;location = /.well-known/carddav {return 301 $scheme://$host:$server_port/remote.php/dav;}location = /.well-known/caldav {return 301 $scheme://$host:$server_port/remote.php/dav;}# set max upload sizeclient_max_body_size 256M;fastcgi_buffers 64 4K;# Enable gzip but do not remove ETag headersgzip on;gzip_vary on;gzip_comp_level 4;gzip_min_length 256;gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;# Uncomment if your server is build with the ngx_pagespeed module# This module is currently not supported.#pagespeed off;location / {rewrite ^ /index.php;}location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {deny all;}location ~ ^/(?:.|autotest|occ|issue|indie|db_|console) {deny all;}location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+).php(?:$|/) {fastcgi_split_path_info ^(.+?.php)(/.*|)$;set $path_info $fastcgi_path_info;try_files $fastcgi_script_name =404;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param PATH_INFO $path_info;# fastcgi_param HTTPS on;# Avoid sending the security headers twicefastcgi_param modHeadersAvailable true;# Enable pretty urlsfastcgi_param front_controller_active true;fastcgi_pass php-handler;fastcgi_intercept_errors on;fastcgi_request_buffering off;}location ~ ^/(?:updater|oc[ms]-provider)(?:$|/) {try_files $uri/ =404;index index.php;}# Adding the cache control header for js, css and map files# Make sure it is BELOW the PHP blocklocation ~ .(?:css|js|woff2?|svg|gif|map)$ {try_files $uri /index.php$request_uri;add_header Cache-Control "public, max-age=15778463";# Optional: Don't log access to assetsaccess_log off;}location ~ .(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ {try_files $uri /index.php$request_uri;# Optional: Don't log access to other assetsaccess_log off;}}
测试nginx文件正确性
nginx -t
启动nginx服务
systemctl start nginxsystemctl enable nginx六,配置nextcloud
浏览器访问域名
输入数据库用户名,数据库用户密码,数据库名称,数据库端口号
即可完成配置
学生的话,阿里推出了一个叫云翼计划的产品,通过学生认证之后可以享受超便宜的价格,我的账号是支付宝账号,之前就有过学生认证。
配置服务器如果我是学生,我如何通过¥9.9买到价值¥117的服务?答:用¥9.9购买云服务器ECS是阿里云学生专属活动。首先,你需要在阿里云官网注册账号,然后在阿里云官网首页点击校园扶持如果我不是学生,我如何通过¥30买到价值¥117的服务?答:首先,你需要在阿里云官网注册账号。然后点击阿里云官网首页的最新活动即可看到活动特价云服务器,此时你便可以通过¥30买到阿里云服务器。活动内容如下图1.2。部署helloworld并访问要看以下教程,请先确保你把上面的东西都做好了:Java和Tomcat环境搭好,购买了域名并且可以使用,本地有Java开发环境和IDEA
不过上面的教程之涉及到在服务器上配置Java与Tomcat环境,相当于你只是搭了一个房子,但是里面还没有任何家具,不能入住,所以接下来我们来买一些家具,首先打开IDEA,新建一个项目,选择web application。
在web目录下找到index.jsp 在
标签下写一句hello world
因为部署到网站上的时候我们需要一个war包,所以我们现在想办法弄一个出来
点击右上角的这个图标
按照图中步骤点击(还有要先点击绿色的加号才能出来那个菜单)
然后添加一个content,存放路径选择它默认的就行,一般都是在war包的相同目录
这样就设置好了,下面我们来生成一个war包 执行Build->Build Artifacts->build命令
build之后在这个out目录下找war包
打开xshell和xftp工具,连接到云服务器,将webhelloworld_war.war放到云服务器的/usr/java/tomcat/apache-tomcat-8.5.20/webapps/下
好,我们要稍微修改一些东西 ,不要怕,很简单的一行而已,不要每次提到修改配置就头大。
修改/usr/java/tomcat/apache-tomcat-8.5.20/conf/下的server.xml:
修改host节点的name为你的云服务器的域名,如www.example.com在host节点下加一个节点其中webhelloworld_war这个就是你的war包的包名,也就是你的项目名
顺便提一下,如果要修改这个xml文件,你可以在xshell中用vi修改,非常秀操作,当然也有非常接地气的方法,可以用xftp将server.xml下载到本地然后用sublime text来改,然后再上传上去。
好了修改完配置文件之后还有一件重要的事情别忘了,就是重启一下Tomcat
用xshell进入/usr/java/tomcat/apache-tomcat-8.5.20/bin/
执行
./shutdown.sh
然后再执行
./startup.sh
这里提一下,如果停止Tomcat时出现停止失败,提示 java.net.ConnectException: Connection refused SEVERE: Could not contact localhost:8005. Tomcat may not be running.报错的,原因是Tomcat的内存太小了,需要设置一下虚拟内存
好,现在返回正题,在浏览器中输入 你的云服务器的域名:8080 比如(www.example.com:8080)就可以访问到你刚才部署上去的程序啦,像这样子
前言函数计算支持以无服务器架构快速构建企业和开发者的软件系统,以其全托管事件触发模式、超弹性伸缩以及低廉的计费方式,相对于传统服务器架构,在开发效能和运维模式上都取得了明显优势。另外还提供了各种服务间的触发功能,作为云端各种产品的黏合剂,适用于各种应用场景。
本节,将带领大家利用函数计算,快速搭建一个功能完整的网盘服务。网盘服务的项目见(即将开源):
apissiteui网盘服务简介功能
网盘服务功能详细介绍请参考文章网盘服务系统和相应的项目 repo 。
本文重点不是介绍网盘功能,所以,请大家通过已经搭建好的网盘 demo 自行体验,这里不做过多赘述。
网盘系统无服务器架构
网盘服务功能集较多,这里就以上传文件功能为例,展现其网盘的实现架构。
网盘服务自身模块以及资源依赖
网盘服务的模块实现分为三个部分,如下图所示:
apis : 提供了网盘的 API 接口功能,这部分功能是 serverless 架构实现的核心,使用 FC+API Gateway 架构模式实现主体功能,如上图无服务器架构图中展现的。Site : 提供了网盘实例的管理控制台,还有对应的网盘宣传、使用文档以及 api 文档等。UI : 提供用户使用和维护网盘的客户端。这里,Site 和 UI 这两个子模块的实现都是静态网站模式,可以直接使用 OSS bucket 的 website 特性实现。为了简化整个部署流程和自动化资源编排过程,将 Site 和 UI 的部署方式也整合到 FC 中统一维护,见下面的详细的部署流程描述。
网盘服务功能后台依赖资源罗列如下:
fun 介绍fun 是 have Fun with Serverless 的缩写,是一款 Serverless 应用开发的工具,可以帮助用户定义函数计算、API 网关、日志服务等资源,旨在与阿里云 ROS 兼容(尽管到目前为止 ROS 还不支持函数计算。但是,fun 作为 ROS 的子集是我们的目标)。
使用 fun 能够解决复杂服务的资源依赖维护问题,能够快速部署、更新,简化资源编排运维。针对该网盘服务的众多资源依赖,使用 fun 能够很方便、迅速的解决各种资源的搭建和维护过程。下面我们将演示如何使用 fun 部署网盘服务系统。
具体部署过程网盘服务目前实现了三种身份登录验证功能: 钉钉、支付宝和特殊账号密码(用于测试)。
因为钉钉、支付宝登录方式需要走一些申请流程获取对应的 appID 和 appSecret ,这里为了简化流程,我们仅仅使用特殊账号密码方式。
部署的具体步骤如下:
准备工作:云账号准备代码准备fun 下载和配置配置 fun 的 template.yml部署 template.yml 定义资源,获取二级域名等信息更新 apis function部署 Site ,创建 groupID 实例部署 UI,配置 storage 实例准备工作
云账号准备
首先,准备一个能够登录阿里云官网的云账号, 登录控制台获取这个账号的 UID ( accountID )、 accessKeyID 和 accessKeySecret 。部署演示使用的资源全部在华东 2 ( cn-shanghai )。也可以使用其他 region 资源,但是必须保证所有的服务都在同一个 region 中。
然后开通如下服务:
代码准备
函数计算支持多种代码上传方式,这里统一打包成 zip 文件,并上传到该云账号的某个 bucket 上(用户自行在华东 2 创建即可)。参考代码如下连接:
apis.zip注意: apis 使用 nodejs 实现,在打包之前需要执行 tnpm i 命令安装项目依赖。解压后目录结构如下:site.zip
解压后文件结构如下:ui.zip
解压后文件结构如下:fun 下载和配置
如果您的系统已经安装有 node 8 及以上的环境配置,那么可以直接执行如下命令进行 fun 的安装
npm install @alicloud/fun -g
如果您不想安装 node 运行环境,那么可以直接下载 fun 的 binary 执行,参考各种环境 fun 的 release binary 。
然后设置 accountID、accessKeyID 和 accessKeySecret 以及 region,请使用准备步骤中的已经申请的云账号的参数进行配置,本示例中 region 选择 cn-shanghai :
# 如果是 binary ,执行 ./${binary_name} config
fun config
template.yml 配置
template.yml 模板配置是本部署中最重要的部分,因为网盘服务依赖的资源项比较多(主要是 API网关资源和表格存储资源), 建议下载参考模板直接修改,需要修改的内容已经使用 "TODO" 标识。
template.yml 的语法规范参考 fun 规范文档。
这面具体介绍配置中的相关部分:
ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Resources:
apsaradrivefc:
Type: 'Aliyun::Serverless::Service'
Properties:
Description: apsara drive
Policies:
- AliyunOTSFullAccess
- AliyunSTSAssumeRoleAccess
- AliyunLogFullAccess
- AliyunFCInvocationAccess
LogConfig:
Project: log-yunpan # TODO replace sls project name
Logstore: fclog
apis:
Type: 'Aliyun::Serverless::Function'
Description: apis
Runtime: nodejs8
Timeout: 30
MemorySize: 128
Handler: index.handler
CodeUri: # TODO replaced the code location
EnvironmentVariables: # TODO replace all the values which has 'TODO' tag
ENV_CONFIG: '...'
DeploySite: # function name which deploys site
Handler: 'deploy.my_handler'
Runtime: 'python2.7'
Description: 'function to deploy site'
CodeUri: '' # TODO replaced by the code location
DeployUI: # function name witch deploys ui
Description: 'function to deploy ui'
apsaradriveapis:
Type: 'Aliyun::Serverless::Api'
...
ts-yunpan: # TODO replace ots instance name
Type: 'Aliyun::Serverless::TableStore'
ClusterType: HYBRID
Description: for apsaradrive
log-yunpan: # TODO replace sls project name
Type: 'Aliyun::Serverless::Log'
Description: log
fclog:
Type: 'Aliyun::Serverless::Log::Logstore'
TTL: 10
ShardCount: 1
上面定义的 yaml 文件主要做了以下几件事情:
创建一个名为 'apsaradrivefc' 的 Service , 并且为这个 Service 创建一个具有 AliyunOTSFullAccess 、AliyunSTSAssumeRoleAccess 、 AliyunOTSFullAccess 、 AliyunLogFullAccess 和AliyunFCInvocationAccess 这几大权限的 Service Role。然后在这个 Service 下面创建三个 Function ,分别名为 'apis', 'DeploySite' 和 'DeployUI' 。创建一个 LOG Project名为 'log-yunpan' , 然后在这个LOG Project 下面创建一个名为 'fclog' 的 Logstore ,作为 apsaradrivefc 这个 Service 下 Function 执行的日志收集 store 。创建一个名为 'ts-yunpan' 的 OTS Instance , 并且在这面生成各种 Table 。创建一个 API 网关分组: apsaradriveapis ,以及其下的各种 API 定义。需要修改的内容:
OTS Instance name: 全局有三处地方需要修改,请统一,因为 OTS Instance 在 region 范围全局唯一,尽量保持命名唯一性,注意: OTS Instance 命名规范。LOG Project name: 全局有两处地方需要修改,请统一,因为 LOG Project在region范围全局唯一,尽量保持命名唯一性,注意: LOG Project 命名规范。三处 CodeUri ,分别是 apis ,Site 和 UI 三个模块的代码位置,目前 template.yml 中的默认配置可用,可以不修改。apis 这个 Function 中的 EnvironmentVariables 属性内部需要配置 API 网关分组的二级域名,因为当前步骤还没有生成这个参数,这里先不修改。部署 template.yml 定义资源
直接执行如下命令:
这个时候,你可以在 OTS、SLS、RAM、API 网关和 FC 的控制台上分别看到 fun 为网盘服务创建的各种资源,如下图:
更新 apis function
从上一步 fun 的部署输出日志中可以找到对应的 API 网关分组的二级域名,如下:
修改 apis 这个 Function 中的 EnvironmentVariables 属性内部需要配置 API 网关分组的二级域名,如下图位置:
仍然执行如下命令,进行function的环境变量更新
fun deploy
至此,apis 模块部署完毕。
部署 Site ,创建 groupID 实例
Site 模块的实现其实就是一个静态网站,我们可以利用 OSS 的静态网站功能实现,步骤如下:
修改 static/global.js 中的 endpoint ( apis 的二级域名)和 ui_endpoint (如果在华东2, 那么就是 ${uid}-ui.oss-cn-shanghai.aliyuncs.com )创建 ${uid}-site 这个 bucket ,并设置为 public-read ACL设置这个 bucket 的 website 的默认首页和 404 页面上传整个代码目录将所有的步骤按照函数计算编程模型封装如下,并创建为 Function: DeploySite 。封装的 Function 实现如下所示:
import oss2
import logging
import json
import shutil
import os
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from oss2.models import BucketWebsite
def delete_file(filePath):
if os.path.exists(filePath):
for fileList in os.walk(filePath):
for name in fileList[2]:
os.remove(os.path.join(fileList[0],name))
shutil.rmtree(filePath)
def my_handler(event, context):
# event is json string, parse it
evt = json.loads(event)
logger = logging.getLogger()
endpoint = 'oss-cn-shanghai-internal.aliyuncs.com'
creds = context.credentials
auth = oss2.StsAuth(creds.accessKeyId, creds.accessKeySecret, creds.securityToken)
# create bucket for site named ${uid}-site, and set the ACL to public read
bucket_name = '%s-site' % (evt['uid'])
bucket = oss2.Bucket(auth, endpoint, bucket_name)
try:
bucket.create_bucket(permission=oss2.BUCKET_ACL_PUBLIC_READ)
except oss2.exceptions.BucketAlreadyExists:
logger.info("Bucket %s is already exist" % bucket_name)
# set static website
bucket.put_bucket_website(BucketWebsite('index.html', '404.html'))
# modify the config for site
code_dir = '/tmp/site/'
delete_file(code_dir)
shutil.copytree('/code/site/', code_dir)
data = u''
with open(os.path.join(code_dir, 'static/global.js')) as f:
for line in f.readlines():
if line.startswith('var endpoint = '):
line = u'var endpoint = '%s'; ' % (evt['endpoint'])
elif line.startswith('var ui_endpoint = '):
line = u'var ui_endpoint = 'http://%s.oss-cn-shanghai.aliyuncs.com'; ' % (bucket_name)
data += line
with open(os.path.join(code_dir, '/tmp/site/static/global.js'), "w") as f:
f.writelines(data)
# put all the static code to the bucket
for root,dirs,files in os.walk(code_dir):
for filespath in files:
full_file_name = os.path.join(root,filespath)
bucket.put_object_from_file(full_file_name[len(code_dir):], full_file_name)
所以,只需要 Invoke 这个 Function 就能够完成 Site 模块的部署。接下来演示一下 Invoke 的过程。
登录函数计算控制台,找到对应的 Function: DeploySite ,修改触发事件,然后点击执行:
{
"uid": "replace with you accountID",
"endpoint": "replace with the SLD"
}
然后打开 Site 页面(如果 uid 为 apsaradrive 的话,那么 Site 的 URL 为: ),登录之后(使用默认的 username: admin, password: 1234 登录),创建 group 实例。
部署 UI,配置 storage 实例
部署 UI 的过程和 Site 类似,同样在控制台上找到 DeployUI,修改触发事件,注意事件格式定义如下:
点击执行之后,就可以通过刚刚 Site 页面的 Group 入口进入 UI 页面:
在 UI 页面配置相关的 Storage :
接下来,您就可以对您的网盘进行各种文件操作了。