Thursday, March 24, 2016

Apache httpd SSL Reverse Proxy

Generate a certificate:
# Generate private key 
openssl genrsa -out ca.key 2048 
# Generate CSR 
openssl req -new -key ca.key -out ca.csr
# Generate Self Signed Key
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt
See: https://wiki.centos.org/HowTos/Https">https://wiki.centos.org/HowTos/Https

Put the files here: /etc/httpd/conf.d/

Install mod_ssl:
ls -l /etc/httpd/modules/
yum install mod_ssl
Add this confirguration to the end of the /etc/httpd/conf.d/ssl.conf file:
NameVirtualHost *:443
<VirtualHost *:443>
  SSLEngine on
  SSLProxyEngine On
  ServerName yourhostname.com
  ProxyPass / https://yourserver/
  ProxyPassReverse / https://yourserver/
  SSLCertificateFile /etc/httpd/conf.d/ca.crt
  SSLCertificateKeyFile /etc/httpd/conf.d/ca.key
</VirtualHost>
Reivew:
httpd -S
Restart:
service httpd restart
Check for errors:
tail /var/log/httpd/ssl_error_log

Install node.js on AWS CentOs

[ec2-user@ip-0-0-0-0 ~]$ sudo su
[root@ip-0-0-0-0 ec2-user]# curl --silent --location https://rpm.nodesource.com/setup_4.x | bash -
[root@ip-0-0-0-0 ec2-user]# yum install -y install nodejs


From: https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora