Last active
December 15, 2015 04:59
-
-
Save aquaxp/5205575 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, install need stuff | |
$ apt-get install php5-cgi autoconf automake autotools-dev curl libapr1 libtool curl libcurl4-openssl-dev php-pear php-xml-parser php5 php5-cli php5-common php5-curl php5-dev php5-gd php5-sqlite php5-fpm | |
To generate private (dummy) certificates you can perform the following list of openssl commands. | |
First change directory to where you want to create the certificate and private key, for example: | |
$ cd /usr/local/nginx/conf | |
Now create the server private key, you'll be asked for a passphrase: | |
$ openssl genrsa -des3 -out server.key 1024 | |
Create the Certificate Signing Request (CSR): | |
$ openssl req -new -key server.key -out server.csr | |
Remove the necessity of entering a passphrase for starting up nginx with SSL using the above private key: | |
$ cp server.key server.key.org | |
$ openssl rsa -in server.key.org -out server.key | |
Finally sign the certificate using the above private key and CSR: | |
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
Update Nginx configuration by including the newly signed certificate and private key: | |
$ cat /etc/nginx/sites-enabled/baikal.nginx | |
server { | |
listen 80; | |
server_name ololo.com; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} | |
server { | |
listen 443 ssl; | |
server_name ololo.com; | |
root /var/www/;#baikal placed in /var/www/baikal, after install please test on adress https://ololo.com/baikal/http/admin | |
index index.php; | |
ssl_certificate /usr/local/nginx/conf/server.crt; | |
ssl_certificate_key /usr/local/nginx/conf/server.key; | |
charset utf-8; | |
location ~ /baikal/(\.ht|Core|Specific) { | |
deny all; | |
return 404; | |
} | |
location ~ ^(.+\.php)(.*)$ { | |
try_files $fastcgi_script_name =404; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_pass 127.0.0.1:9000;#unix:/var/run/php-fpm/php-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
include /etc/nginx/fastcgi_params; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /var/www/nginx-default; | |
} | |
} | |
Client setup | |
Apple iCal (OSX): | |
* username: the username you just created (in our example, jerome) | |
* password: the password you just defined | |
* In server address (replace domain and username): http://dav.mydomain.com/cal.php/principals/jerome | |
Apple Calendar (iOS): | |
* in Settings > Mail, Contacts, Calendar > Add an account > Other | |
* Select "CalDAV" | |
* Server: http://dav.mydomain.com/cal.php/principals/jerome | |
* username: the username you just created (in our example, jerome) | |
* password: the password you just defined | |
Apple Address Book (OSX): | |
* username: the username you just created (in our example, jerome) | |
* password: the password you just defined | |
* In server address (replace domain and username): http://dav.mydomain.com/card.php/addressbooks/jerome/default | |
Apple Contacts (iOS): | |
* in Settings > Mail, Contacts, Calendar > Add an account > Other | |
* Select "CardDAV" | |
* Server: dav.mydomain.com/card.php (note: no http:// nor https://, and no trailing slash) | |
* username: the username you just created (in our example, jerome) | |
* password: the password you just defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment