<?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>OpenBSD and FreeBSD resources &#187; Apache</title>
	<atom:link href="http://purebsd.com/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://purebsd.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 06:01:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>PHP and OpenBSD</title>
		<link>http://purebsd.com/php-and-openbsd.html</link>
		<comments>http://purebsd.com/php-and-openbsd.html#comments</comments>
		<pubDate>Tue, 01 Jun 2010 05:37:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://purebsd.com/?p=65</guid>
		<description><![CDATA[PHP (4.0.6) installation process I followed: Download the PHP source package: wget 'http://www.php.net:8000/distributions/php-4.0.6.tar.gz' Extract the sources: tar xvfz php-4.0.6.tar.gz And cd to the php-4.0.6 directory. Configure PHP: ./configure --with-apxs --with-mysql=/usr/local \ --with-config-file-path=/var/www/conf --disable-xml \ --disable-pear --enable-bcmath --enable-magic-quotes Leave out the --with-mysql=/usr/local option if you don&#8217;t want MySQL support or MySQL is not installed. Compile PHP: make &#62; /dev/null [...]]]></description>
			<content:encoded><![CDATA[<p>PHP (4.0.6) installation process I followed:</p>
<ol type="1">
<li>Download the PHP source package:
<p><code> wget 'http://www.php.net:8000/distributions/php-4.0.6.tar.gz'</code></li>
<li>Extract the sources:
<p><code> tar xvfz php-4.0.6.tar.gz</code></p>
<p>And <code>cd</code> to the <code>php-4.0.6</code> directory.</li>
<li>Configure PHP:
<p><code> ./configure --with-apxs --with-mysql=/usr/local \<br />
--with-config-file-path=/var/www/conf --disable-xml \<br />
--disable-pear --enable-bcmath --enable-magic-quotes<br />
</code><br />
Leave out the <code>--with-mysql=/usr/local</code> option if you don&#8217;t want MySQL support or MySQL is not installed.</li>
<li>Compile PHP:
<p><code> make &gt; /dev/null</code></li>
<li>Stop Apache:
<p><code> /usr/sbin/apachectl stop</code></li>
<li>Install the PHP module:
<p><code> make install</code></p>
<p>or copy the <code>libphp4.so.0.0</code> in the <code>.libs/</code> directly to<code>/usr/lib/apache/modules/libphp4.so</code> if you like that better (-:</li>
<li>Edit <code>/var/www/conf/httpd.conf</code>:
<p>Make sure that the following line is present and commented out:</p>
<p><code>LoadModule php4_module /usr/lib/apache/modules/libphp4.so</code></p>
<p>Search for &#8220;<code>#AddType application/x-httpd-php .php</code>&#8221; and remove the # in front of it, thereby telling Apache the line isn&#8217;t a comment anymore.</p>
<p>I added also the .php3 extenstion to it, so files ending in .php3 are also processed by the PHP engine. The end result:</p>
<p><code> AddType application/x-httpd-php .php .php3</code></li>
<li>Start Apache:
<p><code> /usr/sbin/apachectl start</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://purebsd.com/php-and-openbsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache and OpenBSD</title>
		<link>http://purebsd.com/apache-and-openbsd.html</link>
		<comments>http://purebsd.com/apache-and-openbsd.html#comments</comments>
		<pubDate>Tue, 01 Jun 2010 05:07:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Daemons]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://purebsd.com/?p=43</guid>
		<description><![CDATA[General Configuration directory: /var/www/conf Most important configuration file: /var/www/conf/httpd.conf Setting the default e-mail address as seen on the 404 pages, edit the ServerAdmin directive inhttpd.conf: ServerAdmin alex@purebsd.com If you want users being able to have a homepage like http://purebsd.com/~alex enable and set the UserDir directive in httpd.conf: UserDir public_html If you&#8217;d like to have Apache see index.php too as a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>General</strong></p>
<p>Configuration directory:<br />
<code>/var/www/conf</code></p>
<p>Most important configuration file:<br />
<code>/var/www/conf/httpd.conf</code></p>
<p>Setting the default e-mail address as seen on the 404 pages, edit the <code>ServerAdmin</code> directive in<code>httpd.conf</code>:<br />
<code>ServerAdmin alex@purebsd.com</code></p>
<p>If you want users being able to have a homepage like <code>http://purebsd.com/~alex</code> enable and set the <code>UserDir</code> directive in <code>httpd.conf</code>:<br />
<code>UserDir public_html</code></p>
<p>If you&#8217;d like to have Apache see <code>index.php</code> too as a valid index file, edit and/or set the<code>DirectoryIndex</code> directive in <code>httpd.conf</code>:<br />
<code>DirectoryIndex index.php index.html</code></p>
<p>If you&#8217;d like Apache to resolve IP addresses, for usage in logfiles, the REMOTE_HOST variable,<code>/server-status</code> page, etcetera, set the <code>HostnameLookups</code> in <code>httpd.conf</code> to this:<br />
<code>HostnameLookups On</code></p>
<p>If you don&#8217;t like Apache to report its version number and the hostname in 404 error pages, set the <code>ServerSignature</code> directive to <code>Off</code> in <code>httpd.conf</code>:<br />
<code>ServerSignature Off</code></p>
<p><strong>Virtual hosts/domains</strong></p>
<p>If you&#8217;d like Apache to serve up name-based virtual hosts you first you need to define on which IP address(es) Apache will receive requests for them. Your name-based virtual host names usually resolve to this/these IP(s). So, edit <code>httpd.conf</code> to have something like this:<br />
<code> NameVirtualHost 192.168.0.1<br />
NameVirtualHost 42.2.1.21<br />
</code><br />
Now, adding the so called virtual hosts (names) to Apache is rather easy. An purely arbitrary example:</p>
<p><code> # (www.)purebsd.com<br />
&lt;VirtualHost 42.2.1.21&gt;<br />
ServerName www.purebsd.com<br />
ServerAlias purebsd.com<br />
ServerAdmin webmaster@purebsd.com<br />
DocumentRoot /var/www/htdocs/www.purebsd.com<br />
ErrorLog logs/www.purebsd.com-ERROR<br />
CustomLog logs/www.purebsd.com-ACCESS combined<br />
&lt;/VirtualHost&gt;<br />
</code><br />
<code>ServerName</code> is the name of the virtual host you&#8217;d like to have Apache serve pages for.</p>
<p><code>ServerAlias</code> is an optional directive, indicating all possible aliases for the same content (set of pages).</p>
<p>The <code>ServerAdmin</code> sets the e-mail address (only) for this particular virtual host.</p>
<p><code>DocumentRoot</code> is very important. It tells Apache where to grab the pages/content of the virtual host. More accurately, it betrays the location of the directory holding the pages for the virtual host. <code>http://purebsd.com/hoeba.html</code> is translated into<code>/var/www/htdocs/www.purebsd.com/<em>hoeba.html</em></code></p>
<p>The <code>ErrorLog</code> directive dictates to Apache to which file it should log occurring errors.</p>
<p><code>CustomLog</code> tells Apache about the whereabouts of the file where it should write the non-error events off our virtual host.</p>
<p>Sidenote: as to where the root of the <code>DocumentRoot</code> should be is mostly personal taste. Some like to put websites in <code>/var/www/htdocs/</code>, some in <code>/vol/www/</code>, others in <code>/home/httpd/</code>. Others mix it with a previously mentioned place for their own sites/special sites and use<code>/home/user/htdocs-www.example.org</code> for 3rd party users.</p>
]]></content:encoded>
			<wfw:commentRss>http://purebsd.com/apache-and-openbsd.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

