2017-01-27

HTTPS搭建过程中的几点心得

一点心得:单纯将Blog切换到HTTPS,说实话只是顺应时代的一个趋势罢了,其实必要性并没有那么强,无论是国内还是国外,鲜有几家BLOG是跑在HTTPS下的。只是看到Google Chrome新版将对输入密码的HTTP界面全部进行提示,我也就借着这事,将服务器部署上了SSL。

1、有关证书的获取

实话说,对于纯粹的个人用户而言,「Let's Encrypt」是一个非常不错的选择。但是因为其证书的有效期只有90天,需要通过Git下载且需要定时续期。最初想弄,结果HTTPS未成,反而把整个Apache和PHP系统搞崩溃了,感叹自己实力实属有限。

突然想到腾讯云官方免费提供Trust Asia(亚洲诚信,背后是赛门铁克的授权)一年SSL证书,且官方有相关的参考指南,便从腾讯云方面获取证书并部署。
Let's Encrypt 请参考:http://www.laozuo.org/7676.html
腾讯云用户请参考:https://www.qcloud.com/document/product/400/6813
「第一部分获取证书」

具体操作参考不同证书提供商指南。

2、修改完httpd.conf、httpd-ssl.conf,启动apache报错及解决方案:
① "Syntax error on line 80 of c:/apache/conf/extra/httpd-ssl.conf:ErrorLog takes one argument,The filename of the error log"或者"Syntax error on line 99 of c:/apache/conf/extra/httpd-ssl.conf:SSLCertificateFile takes one argument,SSL Server Certificate file ('/path/to/file' -PEM or DER encoded)"

解决方案:文件路径加双引号

② "Syntax error on line 76 of C:/apache/conf/extra/httpd-ssl.conf:SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?)."

解决方案:打开httpd.conf,找到 LoadModule socache_shmcb_module modules/mod_socache_shmcb.so,把前面的注释去掉。

参考自:apache配置https协议(zt)
「http://wyllife.blog.163.com/blog/static/4116390120141130111926688/」

3、固定链接404报错

很纠结的一个问题是,设置完后整个页面基本没什么问题了,但是固定链接开始搞事情。所有的内页全部404报错,我刚开始以为是.htaccess文件的缘故,在设置里重新生成一份就好,结果失败。接下来以为是目录权限问题导致.htaccess文件生成失败?但是WordPress并没有报错,而且可以正常的改为?p形式,于是便更加纠结,到底是什么鬼?

结果是一行参数忘记修改的缘故,应激活AllowOverride ,搜索httpd.conf中所有的的AllowOverride None,全部改为AllowOverride all。

因为我之前在HTTP下是正常的,如果你之前在HTTP下固定链接都有问题的话,请确保Apache的设置中已经装载URL rewrite模块。一般apache的配置文件位于/etc/httpd/conf/httpd.conf,使用vi或emacs等编辑器打开httpd.conf,搜索rewrite_module,确保文件中包含有下面的代码,且前面没有#,确保正确装载url重写模块。
LoadModule rewrite_module modules/mod_rewrite.so

参考自:Wordpress中固定链接不能修改的问题
「http://www.cnblogs.com/dajianshi/archive/2013/05/06/3062816.html」

以上是我的一点收获,感谢万能的互联网和前辈们的无私奉献!

2017-01-22

Trump 就职演讲

Chief Justice Roberts, President Carter, President Clinton, President Bush, President Obama, fellow Americans, and people of the world: thank you.

We, the citizens of America, are now joined in a great national effort to rebuild our country and to restore its promise for all of our people.
join in a effort to do sth. 共同努力,一起参与努力

restore promise 恢复承诺,兑现承诺

Together, we will determine the course of America and the world for years to come.
the course of XX的道路

for years to come 未来多年

We will face challenges. We will confront hardships. But we will get the job done.
face challenges 面对挑战

confront hardships 面对困难

注意face和confront,以后如果在一个句子里想用两个“面对”,这两个词可以替换

Every four years, we gather on these steps to carry out the orderly and peaceful transfer of power, and we are grateful to President Obama and First Lady Michelle Obama for their gracious aid throughout this transition. They have been magnificent.
carry out 进行,执行,实行

carry out the transfer of power 进行权力交接

be grateful to 注意这里是to而不是for

transition 交接

throughout this transition 交接过程始终

Today's ceremony, however, has very special meaning. Because today we are not merely transferring power from one Administration to another, or from one party to another – but we are transferring power from Washington, D.C. and giving it back to you, the American People.

For too long, a small group in our nation's Capital has reaped the rewards of government while the people have borne the cost.
reap 收割,获得

reaped the rewards 得到报偿

borne bear的过去分词

bear 承担承受

Washington flourished – but the people did not share in its wealth.
share in 分享,分担

Politicians prospered – but the jobs left, and the factories closed.
prosper 繁荣,成功,这里指赚大钱,发展好

The establishment protected itself, but not the citizens of our country.
establishment 权威;当权者;权势集团

Their victories have not been your victories; their triumphs have not been your triumphs; and while they celebrated in our nation's Capital, there was little to celebrate for struggling families all across our land.
victory=triumph

all across our land 全国各地

That all changes – starting right here, and right now, because this moment is your moment: it belongs to you.

It belongs to everyone gathered here today and everyone watching all across America.

This is your day. This is your celebration.

And this, the United States of America, is your country.

What truly matters is not which party controls our government, but whether our government is controlled by the people.
What truly matters 真正重要的

January 20th 2017, will be remembered as the day the people became the rulers of this nation again.

The forgotten men and women of our country will be forgotten no longer.
no longer 不再

Everyone is listening to you now.

You came by the tens of millions to become part of a historic movement the likes of which the world has never seen before.
the likes of which 诸如此类的事

At the center of this movement is a crucial conviction: that a nation exists to serve its citizens. Americans want great schools for their children, safe neighborhoods for their families, and good jobs for themselves.
conviction 理念,信念

 a nation exists to serve its citizens 国家是为了服务公民而存在的

These are the just and reasonable demands of a righteous public.

But for too many of our citizens, a different reality exists: Mothers and children trapped in poverty in our inner cities; rusted-out factories scattered like tombstones across the landscape of our nation; an education system, flush with cash, but which leaves our young and beautiful students deprived of knowledge; and the crime and gangs and drugs that have stolen too many lives and robbed our country of so much unrealized potential.

This American carnage stops right here and stops right now.
carnage 残杀,屠杀,川普总统这里用的词很重了。

We are one nation – and their pain is our pain. Their dreams are our dreams; and their success will be our success. We share one heart, one home, and one glorious destiny.

The oath of office I take today is an oath of allegiance to all Americans.
allegiance 效忠,忠贞,忠诚

For many decades, we've enriched foreign industry at the expense of American industry;

Subsidized the armies of other countries while allowing for the very sad depletion of our military;
subsidize 资助

depletion 消耗,损耗

We've defended other nation's borders while refusing to defend our own;

And spent trillions of dollars overseas while America's infrastructure has fallen into disrepair and decay.
infrastructure 基础设施,公共建设设施

We've made other countries rich while the wealth, strength, and confidence of our country has disappeared over the horizon.

One by one, the factories shuttered and left our shores, with not even a thought about the millions upon millions of American workers left behind.

The wealth of our middle class has been ripped from their homes and then redistributed across the entire world.

But that is the past. And now we are looking only to the future.

We assembled here today are issuing a new decree to be heard in every city, in every foreign capital, and in every hall of power.
assemble 聚集

decree 法令,法典

From this day forward, a new vision will govern our land.

From this moment on, it's going to be America First.

Every decision on trade, on taxes, on immigration, on foreign affairs, will be made to benefit American workers and American families.

We must protect our borders from the ravages of other countries making our products, stealing our companies, and destroying our jobs. Protection will lead to great prosperity and strength.
ravage 破坏,蹂躏

I will fight for you with every breath in my body – and I will never, ever let you down.

America will start winning again, winning like never before.

We will bring back our jobs. We will bring back our borders. We will bring back our wealth. And we will bring back our dreams.

We will build new roads, and highways, and bridges, and airports, and tunnels, and railways all across our wonderful nation.

We will get our people off of welfare and back to work – rebuilding our country with American hands and American labor.

We will follow two simple rules: Buy American and Hire American.

We will seek friendship and goodwill with the nations of the world – but we do so with the understanding that it is the right of all nations to put their own interests first.

We do not seek to impose our way of life on anyone, but rather to let it shine as an example for everyone to follow.
impose on 把...强加于

We will reinforce old alliances and form new ones – and unite the civilized world against Radical Islamic Terrorism, which we will eradicate completely from the face of the Earth.
eradicate 摧毁,完全根除

At the bedrock of our politics will be a total allegiance to the United States of America, and through our loyalty to our country, we will rediscover our loyalty to each other.

When you open your heart to patriotism, there is no room for prejudice.

The Bible tells us, "how good and pleasant it is when God's people live together in unity."

We must speak our minds openly, debate our disagreements honestly, but always pursue solidarity.
solidarity 团结

When America is united, America is totally unstoppable.

There should be no fear – we are protected, and we will always be protected.

We will be protected by the great men and women of our military and law enforcement and, most importantly, we are protected by God.

Finally, we must think big and dream even bigger.

In America, we understand that a nation is only living as long as it is striving.

We will no longer accept politicians who are all talk and no action – constantly complaining but never doing anything about it.

The time for empty talk is over.

Now arrives the hour of action.

Do not let anyone tell you it cannot be done. No challenge can match the heart and fight and spirit of America.

We will not fail. Our country will thrive and prosper again.

We stand at the birth of a new millennium, ready to unlock the mysteries of space, to free the Earth from the miseries of disease, and to harness the energies, industries and technologies of tomorrow.

A new national pride will stir our souls, lift our sights, and heal our divisions.

It is time to remember that old wisdom our soldiers will never forget: that whether we are black or brown or white, we all bleed the same red blood of patriots, we all enjoy the same glorious freedoms, and we all salute the same great American Flag.

And whether a child is born in the urban sprawl of Detroit or the windswept plains of Nebraska, they look up at the same night sky, they fill their heart with the same dreams, and they are infused with the breath of life by the same almighty Creator.

So to all Americans, in every city near and far, small and large, from mountain to mountain, and from ocean to ocean, hear these words:

You will never be ignored again.

Your voice, your hopes, and your dreams, will define our American destiny. And your courage and goodness and love will forever guide us along the way.

Together, We Will Make America Strong Again.

We Will Make America Wealthy Again.

We Will Make America Proud Again.

We Will Make America Safe Again.

And, Yes, Together, We Will Make America Great Again. Thank you, God Bless You, And God Bless America.

 
作者:恶魔奶爸Sam
来源:http://t.cn/RxzChCv