linux上传项目

来源:互联网 发布:合肥晨飞网络 编辑:程序博客网 时间:2024/06/06 08:54

用winscp工具连接,sftp协议,22端口,用户名,密码(这用户名是服务器的用户名和密码,不是ftp工具的账号密码)

阿里云服务器项目根目录:

/usr/local/nginx/html/

数据库目录:

/usr/local/mysql/bin/

输入指令:

./mysql -uroot -p密码    登录数据库

 

创建数据库:

create  库名;

导入数据库:

source   后面是sql文件路径;

在服务器vhost.conf文件中配置域名指向(把下面这段代码修改好后,添加到vhost.conf文件后面就行了):

#user  nobody;

 

    server {

        listen       80;

        server_name  120.77.65.70; //这里ip改成相应的域名

 

        #charset koi8-r;

 

        access_log  logs/120.77.65.70.access.log;  //这里ip改成相应的域名

 

        location / {

            root   /usr/local/nginx/html/www;   //www改成项目根目录文件名

            index  index.php index.html index.htm;

   if(!-e $request_filename) {   rewrite  ^(.*)$ /index.php?s=$1  last;   break;   }

        }

 

        error_page  404 /404.html;

 

        # redirect server error pages to thestatic page /50x.html

        #

        #error_page   500 502 503 504  /50x.html;

       # location = /50x.html {

        #   root  /usr/local/nginx/html/www;  //www改成项目根目录文件名

       # }

 

        # proxy the PHP scripts to Apachelistening on 127.0.0.1:80

        #

        #location ~ \.php$ {

        #   proxy_pass   http://127.0.0.1;

        #}

 

        # pass the PHP scripts to FastCGIserver listening on 127.0.0.1:9000

        #

        location ~ \.php$ {

            root           /usr/local/nginx/html/www;   //www改成项目根目录文件名

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

 

        # deny access to .htaccess files, ifApache's document root

        # concurs with nginx's one

        #

        #location ~ /\.ht {

        #   deny  all;

        #}

}

原创粉丝点击