小编Art*_*man的帖子

如何在Nginx中将index.html设置为根文件?

如何为域名设置index.html,例如https://www.example.com/ - 将用户引导到根目录中的index.html.

我尝试过不同的东西,比如:

server {
    # some configs

    location = / {
            index index.html;
            fastcgi_index index.html;
    }
or 
    location / {
            index index.html;
            fastcgi_index index.html;
    }

}
Run Code Online (Sandbox Code Playgroud)

什么都没有帮助我.

有一些其他配置与location关键字,但我也评论过它们.

server {条款中的其他"位置"配置:

location ~ .*(css|htc|js|bmp|jp?g|gif|ico|cur|png|swf|htm?|html)$ {
        access_log off;
        root $www_root;
}

location ~ \.php$
{
        include                         /etc/nginx/fastcgi_params;
        index                           index.html;
        fastcgi_index                   index.html;
        fastcgi_param SCRIPT_FILENAME   $www_root$fastcgi_script_name;
        fastcgi_param QUERY_STRING      $query_string;
        fastcgi_param PATH_INFO         $fastcgi_path_info;
        fastcgi_pass                    127.0.0.1:9000;
        # ????????? ?????????? ??? ?????? FastCGI-??????? ? ????? ?????? ??? ?????? 400
        # ?????????????? ?? …
Run Code Online (Sandbox Code Playgroud)

configuration nginx

48
推荐指数
4
解决办法
13万
查看次数

将cer转换为pem时OpenSSL编码错误

我试图通过openssl将.cer文件转换为.pem,命令是:

openssl x509 -inform der -in certnew.cer -out ymcert.pem
Run Code Online (Sandbox Code Playgroud)

这就是我得到的错误:

unable to load certificate
140735105180124:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319:
140735105180124:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=X509
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

linux openssl certificate ssl-certificate

18
推荐指数
3
解决办法
4万
查看次数

如何使PHP upload_progress SESSION工作?

我正在尝试在php.ini中进行一系列更改之后使工作成为upload_progress会话,如:

session.upload_progress.enabled = On

;session.upload_progress.cleanup = On

session.upload_progress.prefix = "upload_progress_"

session.upload_progress.name = "123"

session.upload_progress.freq =  "1%"

session.upload_progress.min_freq = "1"
Run Code Online (Sandbox Code Playgroud)

并创建基于html的页面,并使用表单提交文件:

<form action="upload_progress.php" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123" />
  <input type="file" name="file1" />
  <input type="file" name="file2" />
  <input type="submit" />
</form>
Run Code Online (Sandbox Code Playgroud)

然后正确上传文件的服务器端脚本:

session_start();
move_uploaded_file($_FILES['file1']['tmp_name'], './uploads/'.$_FILES['file1']['name']);
move_uploaded_file($_FILES['file2']['tmp_name'], './uploads/'.$_FILES['file2']['name']);
print_r($_SESSION);
Run Code Online (Sandbox Code Playgroud)

$_SESSION虽然文件上传正确完成,但全局变量中有一个空数组.会话设置有什么问题?

我使用的是PHP 5.4.5

Notice: Undefined index: upload_progress_123 in C:\apache\localhost\www\upload_progress.php on line 13

php

17
推荐指数
2
解决办法
7118
查看次数

如何使正则表达式不用引号挨饿?

如何让它不饿 - preg_match_all('/"[\p{L}\p{Nd}?-??-??? -_\.\+]+"/ui', $outStr, $matches);

php regex unicode

7
推荐指数
1
解决办法
3172
查看次数

如何在nivo滑块中设置不同的效果

我的网站上有一个nivo滑块,但除了slidesUp之外没有任何效果,即使我已经设置了默认安装.

         <div class="slider-wrapper theme-default">
      <div class="ribbon"></div>
      <div id="slider" class="nivoSlider">

  <img src="/upload/banners/image1.png" border="0" alt=""/>
  <img src="/upload/banners/image2.png" border="0" alt=""/>
  <img src="/upload/banners/image3.png" border="0" alt=""/>  

      </div>
     </div>
<script type="text/javascript">
$(window).load(function() {
    $('#slider').nivoSlider();
});
</script>   
Run Code Online (Sandbox Code Playgroud)

并在标题中:

    <script type="text/javascript" src="/scripts/jquery.js"></script>
<script type="text/javascript" src="/scripts/jquery.nivo.slider.pack.js"></script>  
<link rel="stylesheet" type="text/css" href="/css/nivo-slider.css"/>
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能让它正常工作?

javascript plugins

6
推荐指数
1
解决办法
6万
查看次数

Android HTTP POST请求错误 - 套接字失败EACCES(权限被拒绝)

我正在尝试从Eclipse下的Android应用程序向我的localhost发送POST请求,但是我收到此错误:

套接字失败EACCES(权限被拒绝).

我是通过apache.commons库做的.我以前试过通过HttpClient连接,但是有一个类似的错误:

连接到myhost被拒绝.

这是代码:

    public void onClick(View v) {
        login = (EditText) findViewById(R.id.entry_login);
        userLogin = login.getText().toString();

        pwd = (EditText) findViewById(R.id.entry_password);
        userPwd = pwd.getText().toString();

        BufferedReader br = null;

        HttpClient httpclient = new HttpClient();

        PostMethod method = new PostMethod("http://127.0.0.1/testPost.php");
        method.addParameter("name", "Arthur");

        System.out.println("Login: " + userLogin);

        try {
            httpclient.executeMethod(method);

            int returnCode = httpclient.executeMethod(method);

            if (returnCode == HttpStatus.SC_NOT_IMPLEMENTED) {
                System.err.println("The Post method is not implemented by this URI");

                // Still consume the response body
                method.getResponseBodyAsString();
            }
            else {
                br …
Run Code Online (Sandbox Code Playgroud)

java android

6
推荐指数
1
解决办法
2万
查看次数

有没有Java多媒体转换库

我想知道是否有一个库,例如 Apache Commons 或类似的东西可以帮助将媒体文件(例如 avi、mkv、mp4 等)进行任意到任意的转换?例如,输入文件的格式为 .avi,输出文件的格式为 mp4。

java

5
推荐指数
2
解决办法
8446
查看次数

在巨大的表大小33M行中优化mysql中的长查询

查询:

SELECT users.id as uid, name, avatar, avatar_date, driver, messages.id AS mid,messages.msg, messages.removed, messages.from_anonym_id, messages.t
    o_anonym_id, (messages.date DIV 1000) AS date, from_id = 162077 as outbox, !(0 in (SELECT read_state FROM messages as msgs 
WHERE (msgs.from_id = messages.from_id or msgs.from_id = messages.user_id) and msgs.user_id = 162077 and removed = 0)) as read_state 
FROM dialog, messages, users 
WHERE messages.id = dialog.mid and ((uid1 = 162077 and users.id = uid2) or (uid2 = 162077 and users.id = uid1) ) 
ORDER BY dialog.mid …
Run Code Online (Sandbox Code Playgroud)

mysql sql

5
推荐指数
1
解决办法
235
查看次数

如何在iPad/Safari上将蓝色手机链接/锚点设置为其他颜色?

我创建了一个网站,屏幕顶部的电话号码通常是通过CSS的棕色,但是当我在iPad上打开它时它会变成蓝色,我知道有很多功能可以调用它,但我怎么能改变它的行为(只是改变颜色)?

safari ipad

2
推荐指数
2
解决办法
3745
查看次数

Android以编程方式将图像设置为TextView的背景

我有一个应用程序,需要以编程方式将图像放到后台,但它不起作用,代码是(BankMenuParser的2个方法):

    public void getProviderFields(String file, String providerId) throws DocumentException, IOException {

        String xml = readFile(file);
        Document doc = DocumentHelper.parseText(xml);

        System.out.println("field name start");

        List list = doc.selectNodes("//root/operators/operator[@id='" + providerId + "']/fields/field/name");
        for (Iterator itr = list.iterator(); itr.hasNext();) {
//          Attribute attr = (Attribute) itr.next();
//          outList.add(attr.getValue());
            Element el = (Element) itr.next();
            Node elNode = (Node) itr.next();
//          elNode.getText();
            System.out.println("in array");
            System.out.println("field name: " + elNode.getText().toString());
        }
        System.out.println("field name end");
    }

public String getProviderImg(String file, String providerName) throws DocumentException, IOException {

    String …
Run Code Online (Sandbox Code Playgroud)

java android image textview

2
推荐指数
1
解决办法
1万
查看次数