Archive

Posts Tagged ‘apache’

Apache 啟動SSH

March 5th, 2009

安裝平台:CentOS 5.x + Server version: Apache/2.2.3

(本來是想寫透過PHP使用GMail寄信,不過發現需要啟動SSH的功能)

基本上要先安裝APACHE+OPENSSL

yum install apache
yum install openssl

首先需要產生SSL憑證:

$ openssl genrsa -out yourname.key 1024
Generating RSA private key, 1024 bit long modulus
......++++++
........++++++
e is 65537 (0x10001)

設定憑證的一些資訊:

$ openssl req -new -key yourname.key -out yourname.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:TW
State or Province Name (full name) [Berkshire]:Taipei County
Locality Name (eg, city) [Newbury]:Taipei City
Organization Name (eg, company) [My Company Ltd]:Squall
Organizational Unit Name (eg, section) []:Squall
Common Name (eg, your name or your server's hostname) []:www.l-penguin.idv.tw
Email Address []:steven@ms.ntcb.edu.tw
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

憑證簽署:

$ openssl x509 -req -days 365 -in yourname.csr -signkey

編輯ssl.conf

$ vim /etc/httpd/conf.d/ssl.conf

找到下面兩行,將路徑改成您存放crt及key的地方即可

SSLCertificateFile yourname.crt #112行
SSLCertificateKeyFile yourname.key #119行

重新啟動Apache即可,只要將原本網址http://xxx.xx.xxx 改成 https://xxx.xxx.xxx

Blogged with the Flock Browser

Squall Linux, OS/Server , , ,

讓 Apache 2 支援 Silverlight 元件

February 19th, 2009

除了IIS 7以外的Web Server都沒有設定Silverlight相關的MIME Type(.xaml/.xap) ,所以會造成Web Server無法正確執行Silverlight元件.

修改你的Apache的設定檔,加入MIME Type即可

Ubuntu 8.04

$ vim /etc/apache2/mods-enabled/mine.conf

加上下面兩行即可

AddType application/xaml+xml .xaml
AddType application/x-silverlight-app .xap

參考資料:http://blogs.msdn.com/tims/archive/2008/03/18/configuring-a-web-server-to-host-silverlight-content.aspx

Blogged with the Flock Browser

Squall Silverlight , ,