»

SSL Certificate Installation on Nginx or Apache

Log — Tags: , , — Posted by Starck on January 11, 2014

SSL Certificate

Before we can sign up for a certificate we have to generate a RSA private key

You will be prompted to provide a passphrase(required). The key file is secured with this passphrase but we will eventually remove this protection.

Then, we will use this private key to generate a certificate signing request which is then submitted to the CA.

Remove the encryption from the RSA private key

Before we start configuring HTTPS Server we have to make sure to remove the passphrase from our RSA key. Otherwise you have to provide the password every time server started.

The unencrypted private key should only be readable by the owner of the Nginx or Apache master process. Most of the time this is the root user:

Generate SSL Certificate

Setting up server

Nginx
Apache

Nginx with Apache + FastCGI + PHP-FPM

Coding — Tags: , , , — Posted by Starck on January 10, 2014


Install Apache2 + FastCGI + PHP-FPM

Apache Settings

/etc/apache2/sites-availabe/test.server.com.conf:

/etc/apache2/ports.conf:

Install Nginx

sudo apt-get install nginx

/etc/nginx/sites-available/test:

sudo ln -s /etc/nginx/sites-available/test /etc/nginx/sites-enabled/test

sudo rm /etc/nginx/sites-enabled/default

Restart Server

sudo service nginx restart

sudo service apache2 restart

sudo service php5-fpm restart

Install Mod-FastCGI and PHP5-FPM on Ubuntu

Log — Tags: , , , , — Posted by Starck on August 22, 2013

Installation

Configuration

edit /etc/apache2/mods-enabled/fastcgi.conf:

Restart Apache2 and PHP5-FPM

— Updated 2014-01-09 (Ubuntu 13.10)–

mkdir /var/www/cgi-bin

touch /var/www/cgi-bin/php5.fcgi

chown -R www-data:www-data /var/www/cgi-bin

edit /etc/apache2/mods-enabled/fastcgi.conf:

Virtual host setting example :

References

Continue Reading

Nginx with Apache + FastCGI + PHP-FPM

Upgrading PHP on MacOS

Log — Tags: , , , — Posted by Starck on March 29, 2013

所需工具

使用 Brew 讓在 MacOS 安裝管理套件變得容易許多, 而 HomeBrew-PHP 則是讓你在 MacOS 上安裝 PHP 和管理 extensions 的 Brew 套件.

Brew

安裝 Brew:

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

如果之前已經安裝過 Brew, 依據習慣, 我會將 Brew 更新到最後的版本:

brew update

brew upgrade

Installation

Tap the homebrew/dupes repository into your brew installation:

brew tap homebrew/dupes

Tap the repository into your brew installation:

brew tap josegonzalez/homebrew-php

安裝參數說明

brew options php54

安裝 php 5.4

brew install php54

安裝時可能會出現的問題

jpeg8-d:

jpeg8-d is already installed, it's just not linked
    Could not symlink file: /usr/local/Cellar/jpeg/8d/bin/wrjpgcom
    Target /usr/local/bin/wrjpgcom already exists. You may need to delete it.
    To force the link and delete this file, do:
    brew link --overwrite formula_name

解法: brew link --overwrite jpeg

reference

Apache httpd.conf 設定

先檢查 /usr/local/Cellar/php54/ 下的 php 版本號是多少, 例如: 5.4.12

** Update 2013-08-07 **

在 Moutain Lion Server 下, 修改 php module 讀取路徑要到 /Library/Server/Web/Config/apache2/httpd_server_app.conf

** Update 2013-10-26 **

After updating Mavericks Server, please also upgrade to the latest Xcode and make sure you re-install Command-line Tools: xcode-select --install

Edit /Library/Server/Web/Config/apache2/httpd_server_app.conf:

如果使用 FPM, 請在 Terminal 下達:

Command-line

If you would like to swap the PHP you use on the command line, you should update the $PATH variable in either your .bashrc or .bash_profile:

(c) 2024 Starck Lin | powered by WordPress