<?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>botsko &#187; Apache</title>
	<atom:link href="http://www.botsko.net/blog/category/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.botsko.net/blog</link>
	<description>continuing education</description>
	<lastBuildDate>Sat, 24 Jul 2010 21:42:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Apache VirtualHosts on Internal Network (No DNS)</title>
		<link>http://www.botsko.net/blog/2009/08/18/apache-virtualhosts-on-internal-network-no-dns/</link>
		<comments>http://www.botsko.net/blog/2009/08/18/apache-virtualhosts-on-internal-network-no-dns/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 04:21:12 +0000</pubDate>
		<dc:creator>Michael Botsko</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Systems]]></category>

		<guid isPermaLink="false">http://www.botsko.net/blog/?p=437</guid>
		<description><![CDATA[It&#8217;s quite common for web engineers to develop applications on either a local machine, or a server running on the local network. In many situations one does not have the luxury of a domain name service to base everything off of, and it becomes a matter of using the IP address or an internal host [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s quite common for web engineers to develop applications on either a local machine, or a server running on the local network. In many situations one does not have the luxury of a domain name service to base everything off of, and it becomes a matter of using the IP address or an internal host file.</p>
<p>For example, I have an internal server that we do most of our development on and we&#8217;ve typically placed everything in the default htdocs directory. That tends to be a problem if we&#8217;re working on a pre-existing application that was designed to work only from the root level.</p>
<p>In the following steps I&#8217;ll describe setting up a virtual host and how to trick your computer into simulating the domain service.<br />
<span id="more-437"></span><br />
On your remote machine, edit the apache configuration file (locations may vary). By default, it&#8217;s typically found in /usr/local/apache2/conf/httpd.conf.</p>
<p>Search for and uncomment the following section:</p>
<p><code># Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf</code></p>
<p>Save the file, and then proceed with editing that include file:</p>
<p><code>vi /usr/local/apache2/conf/extra/httpd-vhosts.conf</code></p>
<p>The first step is to create a new virtual host. In the following example, we tell apache that any traffic to this server under the domain name &#8220;myfakedomain&#8221; should be treated as a request for the files under the new DocumentRoot.</p>
<p>The second virtual host describes the original default server configuration. Paths to folders will vary depending on how apache was originally installed and configured.</p>
<p><code>&lt;virtualhost *:80&gt;<br />
DocumentRoot "/usr/local/apache2/virt/myfakedomain.com"<br />
ServerName myfakedomain.com<br />
&lt;/virtualhost&gt;</code></p>
<p><code>&lt;virtualhost *:80&gt;<br />
DocumentRoot "/usr/local/apache2/htdocs"<br />
ServerName localhost<br />
&lt;/virtualhost&gt;<br />
</code></p>
<p>After saving your changes, you need to edit the hosts file on the remote machine so that when apache restarts, it doesn&#8217;t go looking for the real domain name you&#8217;ve provided.</p>
<p>Using either root or a sudo account, edit the hosts file:</p>
<p><code>/etc/hosts</code></p>
<p>Add a new line that follows the pattern of the existing examples:</p>
<p><code>127.0.0.1 myfakedomain.com</code></p>
<p>Then, restart apache:</p>
<p><code>/usr/local/apache2/bin/apachectl restart</code></p>
<p>You also need to edit your local hosts file so that your system redirects any traffic to myfakedomain.com to your network server, rather than trying to search the internet for it.</p>
<p>For Mac OS X 10.5 users, you may do this by using the same method as the remote server:</p>
<p><code>sudo vi /etc/hosts</code><br />
<code>127.0.0.1 myfakedomain.com</code></p>
<p>Save the file and then flush out any cache:</p>
<p><code>dscacheutil -flushcache</code></p>
<p>Open your web browser and try to access myfakedomain.com. You should see whatever was in your apache document root.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.botsko.net/blog/2009/08/18/apache-virtualhosts-on-internal-network-no-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Apache, MySQL, and PHP on OS X (10.5)</title>
		<link>http://www.botsko.net/blog/2007/11/19/install-apache-mysql-and-php-on-os-x-105/</link>
		<comments>http://www.botsko.net/blog/2007/11/19/install-apache-mysql-and-php-on-os-x-105/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 23:53:09 +0000</pubDate>
		<dc:creator>Michael Botsko</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tech-Tidbit]]></category>

		<guid isPermaLink="false">http://www.botsko.net/blog/2007/11/19/install-apache-mysql-and-php-on-os-x-105/</guid>
		<description><![CDATA[While I was at zendcon I needed to setup my macbook with a typical apache/php/mysql server, but I was unsatisfied with both the default server that apple included and with the install system provided by XAMPP. I&#8217;ve since setup a server on both my MacBook and my iMac. In order to get support for mysql [...]]]></description>
			<content:encoded><![CDATA[<p>While I was at zendcon I needed to setup my macbook with a typical apache/php/mysql server, but I was unsatisfied with both the default server that apple included and with the install system provided by XAMPP. I&#8217;ve since setup a server on both my MacBook and my iMac.</p>
<p>In order to get support for mysql as well as tools necessary for compiling, you need to install the <a href="http://developer.apple.com/tools/download/">apple developer tools</a>. Check your original mac disc as you may already have a copy.</p>
<p>Anyway, on with our install:</p>
<p><strong>Apache</strong></p>
<p>First, download the latest version of the <a href="http://httpd.apache.org/download.cgi">apache httpd web server</a>.</p>
<p><code>./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite</code></p>
<p>Then, run the standard <code>make, sudo make install.</code></p>
<p><strong>MySQL</strong></p>
<p>Then download the <a href="http://dev.mysql.com/downloads/mysql/5.0.html#source">latest mysql source file</a>. Make sure you download the source &#8220;Compressed GNU TAR archive (tar.gz)&#8221; as we&#8217;ll need to custom compile it.</p>
<p>However, PHP5 no longer includes mysql shared libraries needed during the configure process. To get these, download the source file for the mysql version you just installed. Once downloaded, decompress it and run the following:</p>
<p><code>./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/run/mysql_socket  --with-mysqld-user=mysql --with-comment --with-debug</code></p>
<p><code>make</code></p>
<p><code>sudo make install</code></p>
<p><code>sudo /usr/local/mysql/bin/mysql_install_db --force</code></p>
<p><code>sudo mkdir /usr/local/mysql/run</code><br />
<code>sudo mkdir /usr/local/mysql/data</code></p>
<p><code>sudo chgrp -R mysql /usr/local/mysql</code></p>
<p><code>sudo chown -R mysql /usr/local/mysql/run /usr/local/mysql/var /usr/local/mysql/data</code></p>
<p>Then start the server with:</p>
<p><code>sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &#038;</code></p>
<p><strong>zlib</strong></p>
<p>Then, <a href="http://www.zlib.net/">install zlib</a> if it&#8217;s not already installed on your system. Download zlib, and it should be a basic <code>./configure, make, sudo make install</code> process. </p>
<p>Once zlib is installed, make sure you know the path as we&#8217;ll need it during the php configure process.</p>
<p><strong>PHP</strong></p>
<p>Next, download the <a href="http://www.php.net/downloads.php">latest php package</a>. Decompress it, and now we&#8217;re ready to configure.</p>
<p><code>./configure --prefix=/usr/local/apache --enable-cli --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local --with-apxs2=/usr/local/apache/bin/apxs</code></p>
<p>Then, run <code>make</code> and<code> sudo make install</code> to complete the process.</p>
<p>Restart apache and test everything out. If php didn&#8217;t do it automatically, add in <code>AddType application/x-httpd-php .php</code> to your httpd.conf file &#8211; commonly located in <code>/usr/local/apache/conf/httpd.conf</code>.</p>
<p>Then, start your webserver.</p>
<p><code>sudo /usr/local/apache/bin/apachectl start</code></p>
<p>And finally, once everything is done you&#8217;ll want to setup your account to properly allow access to mysql and apache commands. Just run the following to add their paths to your bash profile:</p>
<p><code>echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile<br />
echo 'export PATH=/usr/local/apache/bin:$PATH' >> ~/.bash_profile</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.botsko.net/blog/2007/11/19/install-apache-mysql-and-php-on-os-x-105/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
