<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SysAdmin Valley &#187; apache</title>
	<atom:link href="http://www.sysadminvalley.com/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sysadminvalley.com</link>
	<description>I might as well write this stuff down so I remember it tomorrow</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:06:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting up a Maintenance page with Apache and Cookies</title>
		<link>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/</link>
		<comments>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/#comments</comments>
		<pubDate>Sat, 16 May 2009 11:39:04 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=85</guid>
		<description><![CDATA[There are times when you want to make changes to your website and you do not want your visitors to see the site before you have finished deploying and testing the website.  Here is an example using Apache, mod_rewrite and a cookie set by a PHP page. First, create your maintenance webpage called maintenance.html.  Second, [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you want to make changes to your website and you do not want your visitors to see the site before you have finished deploying and testing the website.  Here is an example using Apache, mod_rewrite and a cookie set by a PHP page.</p>
<p>First, create your maintenance webpage called maintenance.html.  Second, create a file called set_cookie.php with the following contents</p>
<blockquote><p>&lt;?php<br />
setcookie(&#8220;testing&#8221;, &#8220;testing&#8221;, time()+36000);  /* expire in 600 minutes */<br />
?&gt;</p></blockquote>
<p>Next, create a file called .htaccess in your main web directory with the following contents</p>
<blockquote><p>RewriteEngine on<br />
RewriteCond %{HTTP_COOKIE} !testing<br />
RewriteCond %{REQUEST_URI} !/maintenance.html$<br />
RewriteCond %{REQUEST_URI} !/set_cookie.php$<br />
RewriteCond %{REQUEST_URI} !/logo\.jpg$<br />
RewriteRule ^(.*) /maintenance.html [NC,L]</p></blockquote>
<p>Lastly, in your web browser, go to http://www.yourdomain.com/set_cookie.php.  From that point on, you will be able to browse your website, but your visitors will be redirected to your maintenance.html webpage</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/05/16/setting-up-a-maintenance-page-with-apache-and-cookies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a self-signed SSL Certificate</title>
		<link>http://www.sysadminvalley.com/2009/02/17/creating-a-self-signed-ssl-certificate/</link>
		<comments>http://www.sysadminvalley.com/2009/02/17/creating-a-self-signed-ssl-certificate/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:16:24 +0000</pubDate>
		<dc:creator>mshields</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mini how-to]]></category>

		<guid isPermaLink="false">http://www.sysadminvalley.com/?p=72</guid>
		<description><![CDATA[For this you will need the openssl package.  First we want to start by generating a private key. root@localhost# openssl genrsa -out www.mydomain.com.key 1024 Generating RSA private key, 1024 bit long modulus &#8230;&#8230;&#8230;&#8230;.++++++ &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++++++ e is 65537 (0&#215;10001) Then, we need to generate the certificate request and fill in the appropriate information.  Make sure that [...]]]></description>
			<content:encoded><![CDATA[<p>For this you will need the openssl package.  First we want to start by generating a private key.</p>
<blockquote><p>root@localhost# openssl genrsa -out www.mydomain.com.key 1024<br />
Generating RSA private key, 1024 bit long modulus<br />
&#8230;&#8230;&#8230;&#8230;.++++++<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++++++<br />
e is 65537 (0&#215;10001)</p></blockquote>
<p>Then, we need to generate the certificate request and fill in the appropriate information.  Make sure that the &#8220;Common Name&#8221; matches the domain you want to protect via SSL, so if you domain was www.mydomain.com, use that.  If you wanted to protect mydomain.com (without the www.) then use that.</p>
<blockquote><p>root@localhost# openssl req -new -key www.mydomain.com.key -out www.mydomain.com.csr<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter &#8216;.&#8217;, the field will be left blank.<br />
&#8212;&#8211;<br />
Country Name (2 letter code) [GB]:<br />
State or Province Name (full name) [Berkshire]:<br />
Locality Name (eg, city) [Newbury]:<br />
Organization Name (eg, company) [My Company Ltd]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server&#8217;s hostname) []:www.mydomain.com<br />
Email Address []:email@mydomain.com</p>
<p>Please enter the following &#8216;extra&#8217; attributes<br />
to be sent with your certificate request<br />
A challenge password []:<br />
An optional company name []:</p></blockquote>
<p>Next, generate the self-signed certificate. You can specify the number of days the cert is valid for.</p>
<blockquote><p>root@localhost# openssl x509 -req -days 365 -in www.mydomain.com.csr -signkey www.mydomain.com.key -out www.mydomain.com.crt<br />
Signature ok<br />
subject=/C=/ST=/L=/O=/CN=www.mydomain.com/emailAddress=email@mydomain.com<br />
Getting Private key</p></blockquote>
<p>Next, move the certificate and keyfile into apache&#8217;s SSL directory.</p>
<blockquote><p>mv www.mydomain.com.key /etc/httpd/conf/ssl.key/<br />
mv www.mydomain.com.crt /etc/httpd/conf/ssl.crt/</p></blockquote>
<p>Finally, we configure our SSL virtual host in Apache.  The simplest way to do this is to copy the virtual host for the site you want to make SSL, then add/change the following bits.</p>
<blockquote><p>&lt;VirtualHost 192.168.1.100:443&gt;<br />
&#8230;<br />
SSLEngine on<br />
SSLCertificateFile /etc/httpd/conf/ssl.key/www.mydomain.com.key<br />
SSLCertificateKeyFile /etc/httpd/conf/ssl.crt/www.mydomain.com.crt<br />
&#8230;<br />
&lt;/VirtualHost&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sysadminvalley.com/2009/02/17/creating-a-self-signed-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

