我有EV证书.我正在关注如何在Ubuntu上使用我的证书与NGINX的教程
当我试图重新启动我的nginx时,我得到:
**invalid number of arguments in "ssl_certificate_key" directive in /etc/nginx/sites-enabled/default
Run Code Online (Sandbox Code Playgroud)
到目前为止我做了什么:
sudo nano /etc/nginx/sites-enabled/default
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/home/zhall/zoulfia/shared/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name moneytree.space www.moneytree.space " " 178.62.19.65;
rewrite ^/(.*) https://moneytree.space/$1 permanent;
}
# HTTPS server
server {
listen 443;
server_name moneytree.space www.moneytree.space " " 178.62.19.65;
root /home/zhall/zoulfia/public;
ssl on;
ssl_certificate /home/zhall/moneytree.space.chained.crt;
**ssl_certificate_key /home/zhall/ moneytree.space.key**
ssl_session_timeout 10m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers …Run Code Online (Sandbox Code Playgroud) 我在安装rmagick时遇到问题.我正在使用ruby on rails框架开发我的项目.我在我的gemfile中包含了rmagick gem.我收到以下错误消息:
checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.
Run Code Online (Sandbox Code Playgroud)
我使用brew安装了imagemagick:
imagemagick-6.8.9-8 already installed
Run Code Online (Sandbox Code Playgroud)
imagemagick文件夹位于/ usr/local/Cellar目录中
在我的终端:
Zoulfias-iMac:Myapp zoulfiahall $ rvm使用ruby-2.0.0-p481
Using /Users/zoulfiahall/.rvm/gems/ruby-2.0.0-p481
Zoulfias-iMac:Myapp zoulfiahall$ sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... yes
checking for Magick-config... yes
checking for ImageMagick …Run Code Online (Sandbox Code Playgroud) 我想从一个文件(图像或视频)
<input type='file' id='file_i'/>
// Not this <input type='submit'/>
Run Code Online (Sandbox Code Playgroud)
使用XMLHttpRequest这样的
function img() {
var fd = new FormData();
fd.append('file', document.getElementById("file_i").files[0]);
var req;
if (window.ActiveXObject) {
req=new ActiveXObject();
} else {
req=new XMLHttpRequest();
}
req.open("post", "Image", true);
req.send(fd);
}
Run Code Online (Sandbox Code Playgroud)
例如.
然后在servlet中执行此操作:
new FileInputStream(new File(request.getParameter("file")))
Run Code Online (Sandbox Code Playgroud)
我该如何检索该文件?提前致谢.
$("#colour").change(function(event) {
console.log($(this).val());
});Run Code Online (Sandbox Code Playgroud)
input[type=color] {
width: 100px;
height: 100px;
border-radius: 50%;
overflow: hidden;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type='color' value='#fefefe' class='bar' id='colour'>Run Code Online (Sandbox Code Playgroud)
即使我做了<input type='color'>四舍五入,当我输入一个值(至少在 safari 中)时,它会将圆改为正方形。我怎样才能做到这一点?谢谢。
我正在使用rails4处理Ruby on Rails项目.
场景:
我有一系列哈希.数组包含键相同的哈希值.
a = [{132=>[1000.0]}, {132=>[4000.0]}, {175=>[1000.0]}, {175=>[1000.0]}, {133=>[1200.0]}]
h = a.each {|key,value| key.each {|k| value}}
#{132=>[1000.0]}
#{132=>[4000.0]}
#{175=>[1000.0]}
#{175=>[1000.0]}
#{133=>[1200.0]}
Run Code Online (Sandbox Code Playgroud)
问题:
如何摆脱重复键,但将值添加到唯一键,如下所示:
{132=>[1000,4000]}
{175=>[1000,1000]}
{133=>[1200]}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我想使用该contains函数来获取所有具有title或question包含特定值的值。但是,我收到此错误:
java.sql.SQLException:几何字节字符串必须是小端字节序。在 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074) 在 com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120) 在 com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2076) )在 com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1932) 在 com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3426) 在 com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java: 488) 在 com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3131) 在 com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2299) 在 com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java) :2722)在com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)在com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)在com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement。 java:2322) 在 SQL.Select.getRecentQuestions(Select.java:447) 在 org.apache.jsp.Questions_jsp._jspService(Questions_jsp.java:198) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java :111)在javax.servlet.http.HttpServlet.service(HttpServlet.java:790)在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)在org.apache.jasper.servlet.JspServlet。 serviceJspFile(JspServlet.java:473)在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)在javax.servlet.http.HttpServlet.service(HttpServlet.java:790)在org.apache.catalina .core.StandardWrapper.service(StandardWrapper.java:1682) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) 在 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) )在 org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) 在 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) 在 com.sun.enterprise.web.WebPipeline。调用(WebPipeline.java:99)在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)在org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)在org.apache .catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283) 位于 com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459) 位于 com.sun.enterprise.v3.services .impl.ContainerMapper.service(ContainerMapper.java:167) 在 org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) 在 org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler) .java:180) 在 org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) 在 org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) 在 org.glassfish .grizzly.filterchain.DefaultFilterChain。
这是代码:
public String getRecentQuestions(String search) throws SQLException {
PreparedStatement ps=con.prepareStatement("select title, question_id from questions where …Run Code Online (Sandbox Code Playgroud) html ×2
java ×2
javascript ×2
arrays ×1
certificate ×1
colors ×1
css ×1
hash ×1
imagemagick ×1
input ×1
mysql ×1
nginx ×1
rmagick ×1
ruby ×1
sql ×1
sqlexception ×1
ssl ×1
ubuntu ×1