Difference between revisions of "Apache"
Line 34: | Line 34: | ||
3. I generated a cert. A *.pem file contains both public and private key. This will ask you a bunch of questions too. | 3. I generated a cert. A *.pem file contains both public and private key. This will ask you a bunch of questions too. | ||
> openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/httpd/ssl/httpd.pem -keyout /etc/httpd/ssl/httpd.key | > openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/httpd/ssl/httpd.pem -keyout /etc/httpd/ssl/httpd.key | ||
+ | |||
+ | Resources | ||
+ | http://cs.uccs.edu/~cs526/secureWebAccess/secureWebAccess.htm | ||
+ | http://www.apachelounge.com/viewtopic.php?t=3571 | ||
+ | https://www.linode.com/docs/security/ssl/ssl-certificates-with-apache-2-on-fedora-14 |
Revision as of 16:06, 6 March 2015
Virtual Host This is how you setup apache for Virual Hosts. example if you have more domain names and only one server. The serverAlias is used in case people don't put in the "www" before the URL.
<VirtualHost *:80> DocumentRoot /home/{user}/public_html ServerName www.{domainname}.com ServerAlias {domainname}.com </VirtualHost>
Virtual Host ProxyPass
This will pass any http request along. It helps when you want to pass a connection to another server, example apache -> tomcat:8080.
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ ServerName www.{domainname}.com ServerAlias {domainname}.com </VirtualHost>
SSL Setup
I'm playing around with SSL setup for Apache. My overall goal would be to set up an SSL web address that would be only accessed with a single private key that would have to be imported into a browser and not handed off from the server.
1. Install SSL module for Apache on Fedora
> yum install mod_ssl
2. I create a folder for housing any newly created certs to be used by Apache.
> mkdir /etc/httpd/ssl
3. I generated a cert. A *.pem file contains both public and private key. This will ask you a bunch of questions too.
> openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/httpd/ssl/httpd.pem -keyout /etc/httpd/ssl/httpd.key
Resources http://cs.uccs.edu/~cs526/secureWebAccess/secureWebAccess.htm http://www.apachelounge.com/viewtopic.php?t=3571 https://www.linode.com/docs/security/ssl/ssl-certificates-with-apache-2-on-fedora-14