<?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>OSX Hosting &#187; Server</title>
	<atom:link href="http://osxhosting.com/osxhosting/tag/server/feed" rel="self" type="application/rss+xml" />
	<link>http://osxhosting.com/osxhosting</link>
	<description>Anything to do with hosting from mac OS X servers!</description>
	<lastBuildDate>Fri, 13 Aug 2010 17:21:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing MySQL on on Mac OS X</title>
		<link>http://osxhosting.com/osxhosting/installing-mysql-on-on-mac-os-x#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/installing-mysql-on-on-mac-os-x#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:04:28 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/30/installing-mysql-on-on-mac-os-x/</guid>
		<description><![CDATA[MySQL has become one of the most popular databases for Web applications. The database is well suited for common Web-related tasks like content management, and for implementing Web features like discussion boards and guestbooks. For a time, some developers avoided MySQL for commercial applications because it did not implement certain features, such as transactions. But [...]]]></description>
			<content:encoded><![CDATA[<h1><img src="http://developer.apple.com/internet/images/title_osdb.gif" alt="MySQL on Mac OS X" height="33" width="680" /></h1>
<p>MySQL has become one of the most popular databases for Web applications. The database is well suited for common Web-related tasks like content management, and for implementing Web features like discussion boards and guestbooks. For a time, some developers avoided MySQL for commercial applications because it did not implement certain features, such as transactions. But this is no longer the case, and MySQL is a great choice for just about any Web-based application.<span id="more-14"></span></p>
<p>In this article I’ll give you an overview of MySQL’s features and drawbacks, show you how to install MySQL on Mac OS X, and introduce you to some of MySQL’s notable technical aspects.</p>
<h2>MySQL Features</h2>
<p>Perhaps the most prominent feature of MySQL is its speed when running SQL SELECT statements. MySQL was built for speed. The core of the MySQL engine is very small and streamlined, and the default table type (a modified ISAM table) was designed specifically for running SELECTs quickly. If your application calls for the advantages of a relational structure but the database contents are relatively static — as is often the case with Web content — MySQL’s speed is a great advantage.</p>
<p>MySQL is also undeniably stable. In both your production and serving environments, you can be reasonably confident that MySQL will be up and processing queries as long as power flows to your machine.</p>
<p>Another important benefit is that MySQL is relatively easy to learn. Even if you’re new to relational databases, you can learn MySQL and create very sophisticated Web applications in a short period of time.</p>
<p>The popularity of MySQL is a benefit as well, because if you run into difficulty, you can lean on the active community that supports MySQL. There are many mailing lists dedicated to MySQL, and most questions find quick and thorough answers.</p>
<h2>MySQL Drawbacks</h2>
<p>If you are an advanced database user, you should be aware of some of MySQL’s limitations. MySQL’s implementation of standard query language is missing support for sub-selects, foreign key constraints (for some table types), stored procedures, and views. If you feel you need these features, you’re probably better off looking into PostgreSQL, FrontBase, or another database.</p>
<p>Lack of support for transactions <i>used</i> to be a drawback of MySQL, but this has been addressed. Now, on Mac OS X, you can use the MySQL InnoDB table type and have access to row-level locking and robust transaction support, as well as foreign key constraints.</p>
<h2>Installing MySQL</h2>
<p>If you’re running Mac OS X Server, you are in luck — MySQL is already there. Just go to Applications/Server/MySQL Manager to access it. If you are running Mac OS X Client, you’ll have to install MySQL. if you have already installed a version of MySQl and want to upgrade, I can recommend the <a href="http://www.entropy.ch/software/MacOSx/mysql/">upgrade instructions</a> from http://www.entropy.ch. For a new installation, follow the Mac OS X installation instructions for the MySQL provided binary distribution ( a true Mac OS X installer package file) at <a href="http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html">http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html</a> and be done with it. However, sometimes you want to compile and install directly from the source, either because you are changing the default build settings, or you want the latest and greatest version before there’s a binary installer. The following will help you through that process.</p>
<p>When installing MySQL, you need to be aware of the potential effect this will have on the security of your system, as a database server can open an avenue of attack. In the example below, I show how to install MySQL on Mac OS X while maintaining the security of your system.</p>
<p>One basic security tenet is that of “least 				privilege.” In short, this means that everyone and 				everything should have only the privileges required for 				it to complete its task(s). Those privileges should be 				available for the least amount of time possible—ideally, once the task is completed, the privileges 				should be revoked.</p>
<p>I’m also 				choosing to build MySQL from source, rather than install 				a pre-built binary. This gives greater control over the 				installation, as you’ll see below.</p>
<h2>Configuring and Compiling MySQL</h2>
<p>I plan to install mysql in <code>/usr/local/mysql</code>. I also plan to locate the mysql UNIX socket under the <code>/usr/local/mysql/</code> directory as <code>/usr/local/mysql/run/mysql_socket</code> so that it will be publicly available, but associated with the MySQL installation. Note that in a standard installation, the socket file would be placed in <code>/tmp</code>.</p>
<p>You can now <a href="http://www.mysql.com/downloads/">download the source</a> via a Web browser.</p>
<p>Once you have the source, you can pretty much follow the <a href="http://dev.mysql.com/doc/refman/5.0/en/quick-install.html">quick install directions</a> from the mysql documentation pages, adding only debug support (<code> — with-debug</code>) and the build environment comment (<code> — with-comment</code>). The <code>configure</code> command should look like:</p>
<pre>./configure --prefix=/usr/local/mysql
--with-unix-socket-path=/usr/local/mysql/run/mysql_socket
--with-mysqld-user=mysql --with-comment --with-debug</pre>
<p>Once the configuration completes, running <code>make</code>, and then <code>sudo make install</code>, installs mysql in <code>/usr/local/mysql</code>. Running <code>sudo /usr/local/mysql/bin/mysql_install_db --force</code> adds the <code>var/</code> space for databases and creates the default databases (mysql and test). You also need to add the <code>run/</code> directory where the mysql UNIX socket will live, with <code>sudo mkdir /usr/local/mysql/run</code>. Once all of that is done, a directory listing should look like:</p>
<pre>% ls -Fla /usr/local/mysql/
total 26
drwxr-xr-x 13 root wheel 1024 Jun 5 13:42 ./
drwxr-xr-x 11 root wheel 1024 Jun 5 12:19 ../
drwxr-xr-x  2 root wheel 1024 Jun 5 12:20 bin/
drwxr-xr-x  3 root wheel 1024 Jun 5 12:19 include/
drwxr-xr-x  2 root wheel 1024 Jun 5 12:19 info/
drwxr-xr-x  3 root wheel 1024 Jun 5 12:19 lib/
drwxr-xr-x  2 root wheel 1024 Jun 5 12:20 libexec/
drwxr-xr-x  3 root wheel 1024 Jun 5 12:20 man/
drwxr-xr-x  6 root wheel 1024 Jun 5 12:21 mysql-test/
drwxr-xr-x  2 root wheel 1024 Jun 5 13:42 run/
drwxr-xr-x  3 root wheel 1024 Jun 5 12:20 share/
drwxr-xr-x  7 root wheel 1024 Jun 5 12:21 sql-bench/
drwx------  4 root wheel 1024 Jun 5 13:37 var/</pre>
<p>Note that at this point everything is owned by root — meaning the mysql account won’t be able to write to the databases under <code>var/</code> nor be able to create the mysql UNIX socket in the <code>run/</code> directory. Since we want to run the MySQL database under the mysql account, and <b>not</b> under the root account, we need to change the group association of <code>/usr/local/mysql</code> to the group mysql, and the ownership of <code>/usr/local/mysql/run</code> and <code>/usr/local/mysql/var</code> to the mysql account, as follows:</p>
<pre>sudo chgrp -R mysql /usr/local/mysql
sudo chown -R mysql /usr/local/mysql/run /usr/local/mysql/var</pre>
<p>The directory listing now looks like:</p>
<pre>% ls -Fla /usr/local/mysql
total 26
drwxr-xr-x 13 root  mysql 1024 Jun 5 13:42 ./
drwxr-xr-x 11 root  wheel 1024 Jun 5 12:19 ../
drwxr-xr-x  2 root  mysql 1024 Jun 5 12:20 bin/
drwxr-xr-x  3 root  mysql 1024 Jun 5 12:19 include/
drwxr-xr-x  2 root  mysql 1024 Jun 5 12:19 info/
drwxr-xr-x  3 root  mysql 1024 Jun 5 12:19 lib/
drwxr-xr-x  2 root  mysql 1024 Jun 5 12:20 libexec/
drwxr-xr-x  3 root  mysql 1024 Jun 5 12:20 man/
drwxr-xr-x  6 root  mysql 1024 Jun 5 12:21 mysql-test/
drwxr-xr-x  2 mysql mysql 1024 Jun 5 13:42 run/
drwxr-xr-x  3 root  mysql 1024 Jun 5 12:20 share/
drwxr-xr-x  7 root  mysql 1024 Jun 5 12:21 sql-bench/
drwx------  4 mysql mysql 1024 Jun 5 13:37 var/</pre>
<p>You can now start mysql and perform a few important tasks, like setting a mysql password to protect the database itself. Note that, while starting the database requires system root privileges, actions within the database itself do not require system root privileges, but database root privileges. It is somewhat confusing that MySQL uses the account name “root” for its all-powerful account, just as the system does, even though they are completely separate entities.</p>
<p>Starting mysql is accomplished with:</p>
<pre>sudo /usr/local/mysql/bin/mysqld_safe --user=mysql &amp;</pre>
<p>Now you can run through some of the basic tests — but first, go ahead and secure the database by adding a password for the database “root” user, as follows:</p>
<pre>/usr/local/mysql/bin/mysqladmin -u root password sniggle</pre>
<p>Here “sniggle” is the password you are assigning to the database root account. In MySQL, a single user is associated with a username and a host. Most often on your development machine you will be connecting to the database locally, so the host will be “localhost”. However, if you are attempting to connect from a different machine, you will have to assign permissions based on both username and hostname. For more information on users and passwords within MySQL, <a href="http://dev.mysql.com/doc/mysql/en/GRANT.html">read about</a> MySQL’s grant tables, and the <code>grant</code> and <code>revoke</code> statements.</p>
<h2>Conclusion</h2>
<p>MySQL is a great database for Web applications and a great complement to a Mac OS X development environment. Install it on your machine and create applications in Perl, PHP, JSP, or whatever languages you like best. To administer a MySQL installation on Mac OS X, you can look to popular tools such as the Web-based <a href="http://www.phpmyadmin.net/home_page/">phpMyAdmin</a> from <a href="http://www.phpwizard.net/">phpwizard.net</a>, or <a href="http://www.rtlabs.com/macsql/">MacSQL</a> from <a href="http://www.rtlabs.com/">Runtime Labs</a>.</p>
<p>For information about starting MySQL on startup, see <a href="http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Startup/index.ws">this article</a> from macosxfaq.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/installing-mysql-on-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up an OS X development server</title>
		<link>http://osxhosting.com/osxhosting/setting-up-an-os-x-development-server#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/setting-up-an-os-x-development-server#comments</comments>
		<pubDate>Tue, 29 Jan 2008 21:34:47 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/29/setting-up-an-os-x-development-server/</guid>
		<description><![CDATA[Okay, so this was very much a case of fumbling around in the dark until stuff worked, lot&#8217;s of Googling and breaking stuff. The end result is a dev server on OS X that is running Textpattern with clean URLs and a copy of WordPress for good measure. These notes are primarily so I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so this was very much a case of fumbling around in the dark until stuff worked, lot&#8217;s of Googling and breaking stuff. The end result is a dev server on OS X that is running Textpattern with clean URLs and a copy of WordPress for good measure. These notes are primarily so I don&#8217;t forget how I did it, if they are useful to someone else, great! Be warned, though, I have no idea how secure this set up is and what flaws it has, so you <b>follow these instructions at your own risk</b>! Also, I am using OS 10.3.9 so I don&#8217;t know if this would work on Tiger.<span id="more-13"></span></p>
<h3>Turn off Personal Web Sharing</h3>
<p>OS X does, as you probably know, ship with Apache and it&#8217;s real easy to switch on and for a while I did use it. I am quite interested in learning a bit more about the whole serving up websites business, so first job is to do away with all the pre-installed Mac stuff.</p>
<p>Go to System Preferences &gt; Sharing and make sure Personal Web Sharing is stopped.</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/190.jpg" alt=" " /></p>
<h3>Software</h3>
<p>I started off with <a href="http://www.webedition-cms.com/english/downloads/mamp.php">Mamp</a> and that is probably good enough for a basic set up but I wanted to run Textpattern with clean URLs. Getting mod_rewrite to work on Mamp just wouldn&#8217;t happen for me. So after a bit of Googling I came up with these downloads in preparation for my mission&#8230; gulp!</p>
<ul>
<li><a href="http://www.serverlogistics.com/mysql.php">Complete MySQL</a></li>
<li><a href="http://www.serverlogistics.com/apache2.php">Complete Apache2</a></li>
<li><a href="http://www.serverlogistics.com/php4.php">Complete PHP4 </a></li>
<li><a href="http://cocoamysql.sourceforge.net/">CocoaMySQL</a></li>
<li><a href="http://homepage.mac.com/darkshadow02/apps.htm">Web Control</a> (Scroll down the page a bit)</li>
</ul>
<h3>Terminal</h3>
<p>You will need to have at hand Terminal in order to do some of the stuff. This is located in Applications &gt; Utilities. This is the best bit actually because you get to feel like <a href="http://www.imdb.com/title/tt0133093/">Neo</a> for five minutes! Be careful though, I am told you can do some serious damage with Terminal.</p>
<h3>Show hidden files</h3>
<p>Having already had a play with <a href="http://www.webedition-cms.com/english/downloads/mamp.php">Mamp</a>, I noticed that I couldn&#8217;t see .htaccess files. Also when installing Complete MySQL there was another hidden file I needed to get to. Eventually I found a note on <a href="http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/additionalfeatures/chapter_10_section_7.html">Apple&#8217;s developer site</a> that describes how to show hidden files. It&#8217;s gonna make your Mac look at little messier than before but it&#8217;s kind of essential:</p>
<p>Open up Terminal and type in the following:</p>
<p><code>defaults write com.apple.Finder AppleShowAllFiles true</code></p>
<p>And that should be that.</p>
<h3>Complete installs</h3>
<p>The links to the three Complete packages are self explanatory. Each comes with a detailed Install document, follow them and you can&#8217;t go wrong, much.</p>
<p>The only problem I ran into was creating a .bash_profile document in the home directory. With hidden files now showing I could see that my home directory (the house with my name on it) had no .bash_profile in it, so I created one with TextEdit. Again, something to watch out for is TextEdit saving it with an extension e.g. .bash_profile.rdf. If this happens click on the file and press COMMAND + I which will bring up the File Info panel and you can simply delete the .rdf from the Name &amp; Extensions panel</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/185.jpg" alt=" " /></p>
<p>In truth this had little effect for me when trying to access mysql via Terminal, unless I used the complete path i.e. /Library/MySQL/bin/mysql. Given that I have no intention of using Terminal for accessing MySQL I didn&#8217;t worry about it and it has not had any impact on this setup thus far. <b>Note:</b> If anyone <i>does</i> know why I was getting a command not found error, I&#8217;d love to know.</p>
<p>One other note with these complete installs is the location they end up in. Obvious now but it caused me a bit of confusion, they are in the root library file and not the library file in you home directory. To find this spot open up your hard drive and look for the Library folder</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/187.jpg" alt=" " /></p>
<h3>phpMyAdmin versus CocoaMySQL</h3>
<p>I had a bash at installing phpMyAdmin but to be honest they may as well have written the instructions in Wookie. I stumbled across CocoaMySQL after a bit of Googling, opened it up, it found the path to my MySQL server and within five minutes I had created a database as was running a local copy of Joshuaink. I thoroughly recommend it for the less technically minded.</p>
<p>Also worth noting is that which ever way you access MySQL, you can use your root account and the password you set when setting up MySQL for all your databases which is pretty damn convenient.</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/186.jpg" alt=" " /></p>
<h3>Httpd.config</h3>
<p>Certainly if you are going to be experimenting, the httpd.config file will come into play. I started off with the Web Control app because it makes back ups, reverts easily back to the original file if you mess it up and it can check your syntax for you and if you aren&#8217;t feeling confident it&#8217;s a great way to start. It soon started to get a bit frustrating though because I couldn&#8217;t do a find search to locate bits of the document.</p>
<p>I ended up going back to TextEdit but found I could no longer save the file from that app (though I could from Web Control). I am not sure if this happens by default or whether Web Control did it when it first ran but it turned out that the conf directory, located at /Library/Apache2/conf was locked, so again clicking on the directory and COMMAND + I brings up the info and I changed the Ownership &amp; Permissions details from Owner: system to Owner: [my username]. I also did the same to the httpd.conf file for good measure and made sure they were both set to Read &amp; Write for owners.</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/189.jpg" alt=" " /></p>
<h3>Virtual hosts</h3>
<p>Virtual hosts were one of the big things I wanted to get done and I found two tutorials. <a href="http://mezzoblue.com/archives/2004/08/05/virtual_host/index.php">One over at Mezzoblue</a> and <a href="http://www.sitepoint.com/article/os-x-web-development">one over at SitePoint</a> (scroll down the tutorial a bit). In the end I opted for the SitePoint one because it was getting late and my head seemed to manage with it a little better, though the URLs it produces are no where near as cool as Dave&#8217;s. Again something to consider if you do use the SitePoint one, be careful with your naming conventions because it can impact how you use the web. For example I had a directory called joshuaink and where I used to just type joshuaink &#8212; as opposed to the full URL &#8212; into Firefox to reach my live site, I was now being taken to my localhost.</p>
<h3>DirectoryIndex</h3>
<p>It wasn&#8217;t until I opened up the WordPress admin that I noticed I was getting a directory listing and had to manually click on index.php to get to the login page. This seems to be something to do with the DirectoryIndex bit of httpd.conf. Initially I was dropping the .htaccess file that ships with Textpattern into each and every directory with an index.php as it&#8217;s starting point and it <i>did</i> solve the problem but that was getting a bit tiresome. Eventually I found out that there is something called DirectoryIndex in the httpd.conf file and having located it I changed it to this so that Apache recognises an index.php:</p>
<p><code>DirectoryIndex index.html index.htm index.php index.html.var</code></p>
<p>I really don&#8217;t know if that is correct but it seems to have solved the problem.</p>
<h3>Deleting .htaccess files</h3>
<p>My final problem was deleting those .htaccess files I had spread everywhere and OS X wouldn&#8217;t let me because it is a hidden file. To solve this I renamed it to .htaccess.txt and then I could delete it.</p>
<p><img src="http://joshuaink2006.johnoxton.co.uk/images/188.jpg" alt=" " /></p>
<h3>Conclusions</h3>
<p>I have got a lot to learn about Apache but it was an interesting start and well worth the effort. With my iBook mostly offline, security is not a big deal for me. No doubt I will continue to fiddle until it breaks. If you have any tips or see something very wrong with the way I have setup, please do say.</p>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/setting-up-an-os-x-development-server/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mac OSX Server FTP Server Administration</title>
		<link>http://osxhosting.com/osxhosting/mac-osx-server-ftp-server-administration#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/mac-osx-server-ftp-server-administration#comments</comments>
		<pubDate>Tue, 29 Jan 2008 21:15:27 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Xserve]]></category>
		<category><![CDATA[accounts]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftpchroot]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[lukemftpd]]></category>
		<category><![CDATA[NetInfo]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/29/mac-osx-server-ftp-server-administration/</guid>
		<description><![CDATA[FTP Only Accounts Under Mac OS X The following howto describes how to set up ftp only accounts using Apple Mac&#8217;s built in ftp server (lukemftpd). This outline requires you to use the terminal, NetInfo Manager and have admin privileges on the machine in question. Warning: You can muck things up quite seriously using NetInfo [...]]]></description>
			<content:encoded><![CDATA[<h2>FTP Only Accounts Under Mac OS X</h2>
<p>The following howto describes how to set up ftp only accounts using Apple Mac&#8217;s built in ftp server (lukemftpd).</p>
<p>This outline requires you to use the terminal, NetInfo Manager and have admin privileges on the machine in question.</p>
<p><b>Warning:</b> You can muck things up quite seriously using NetInfo Manager. At the very least make sure you have a recent, full back-up of the machine you&#8217;re planning to setup before going any further.</p>
<p>To create ftp only accounts we need to:</p>
<ol>
<li>Create an ftp login shell</li>
<li>Restrict our prospective ftp user to their folder</li>
<li>Create the user account</li>
<li>Create a folder for the new user</li>
<li>Give the user a password</li>
</ol>
<h3>Create An FTP Login Shell</h3>
<p>To create an ftp login shell we need to copy or link /sbin/nologin to /sbin/ftplogin. We&#8217;ll create a symbolic link from /sbin/nologin to /sbin/ftplogin. To do this:</p>
<ol>
<li>Fire up Terminal</li>
<li>Type &#8220;sudo ln -s /sbin/nologin /sbin/ftplogin&#8221; (without the quotes)</li>
<li>Hit return</li>
<li>Type in your admin user&#8217;s password when prompted</li>
</ol>
<p>Now we need to add the new &#8220;shell&#8221; to the list of shells available to the system. To do this we need to add &#8220;/sbin/ftplogin&#8221; to the list of shells given in the file found at /etc/shells. In Terminal:</p>
<ol>
<li>Type &#8220;sudo pico /etc/shells&#8221;. This&#8217;ll open up the file &#8220;shells&#8221; in a simple text editor in Terminal</li>
<li>Hit return</li>
<li>Type in your admin user&#8217;s password if prompted</li>
<li>Add the string &#8220;/sbin/ftplogin&#8221; (without the quotes) on a new line at the end of the list of shells available. This&#8217;ll give you a final list similar to:
<p>/bin/bash<br />
/bin/csh<br />
/bin/sh<br />
/bin/tcsh<br />
/bin/zsh<br />
/sbin/ftplogin</li>
<li>Type ctl + &#8220;o&#8221;. That&#8217;s the letter &#8220;o&#8221; while holding down the control key</li>
<li>Hit return</li>
<li>Type ctl + &#8220;x&#8221; to eXit Pico</li>
</ol>
<h3>Restrict User To Their Folder</h3>
<p>We&#8217;re setting this up now so that as soon as the user we&#8217;re creating gains access to our machine, they&#8217;re restricted to their log-in or root folder. All we have to do is create the file /etc/ftpchroot if it doesn&#8217;t exist and then add the prospective user&#8217;s username to the file.</p>
<ol>
<li>In Terminal, type &#8220;cd /etc&#8221; (without the quotes. From here on in, I&#8217;ll assume you&#8217;re ignoring the quotes)</li>
<li>Check to see whether the file &#8220;ftpchroot&#8221; exists. If it doesn&#8217;t, type &#8220;sudo touch ./ftpchroot&#8221; and give you admin password if prompted for it</li>
</ol>
<p>Now we need to add the username to the created file. Using pico:</p>
<ol>
<li>In Terminal type &#8220;sudo pico ./ftpchroot&#8221;. This&#8217;ll open up the file &#8220;ftpchroot&#8221; in a simple text editor in Terminal</li>
<li>Type in your prospective ftp user&#8217;s username. Ours is &#8220;fred&#8221;. For safety, make the username all lowercase letters only &#8211; although we&#8217;ll let you have the underscore (&#8220;_&#8221;) too.</li>
<li>Type ctl + &#8220;o&#8221;. That&#8217;s the letter &#8220;o&#8221; while holding down the control key</li>
<li>Hit return</li>
<li>Type ctl + &#8220;x&#8221; to eXit Pico</li>
</ol>
<h3>Create User Account</h3>
<p>We do this in NetInfo Manager. I&#8217;m going to talk you through doing this the long winded way &#8211; but once you&#8217;ve got one account set-up, I&#8217;d suggest you duplicate an existing account and modify it as appropriate.</p>
<ol>
<li>Fire up NetInfo Manager</li>
<li>At the bottom of the pane, click the little lock symbol and supply your admin username and password to unlock NetInfo Manager</li>
<li>In the lefthand column, select &#8220;/&#8221;</li>
<li>In the middle column select &#8220;users&#8221;</li>
<li>Click the &#8220;New&#8221; icon at the top of the pane. This will create a new user called &#8220;new_directory&#8221;.</li>
</ol>
<p>Now we need to modify this user account to give it the properties we&#8217;re after. Some of these properties will depend on your setup and how you want to administer your machine. We&#8217;ll use some reasonable settings but you may want to change these.</p>
<p>Before we go further, we do need to check what the next available user id (uid) is. To do this, click through your users in NetInfo Manager (ignoring the system users if you know what these are) making a note of the highest uid. In my case it&#8217;s 503. This means that my next user is going to be 504. Alternatively, start a new series for ftp users starting at 601.</p>
<p>Having done this, with the user &#8220;new_directory&#8221; selected in NetInfo Manager:</p>
<ol>
<li>Select the &#8220;name&#8221; property in the bottom half of the pane. Double click on the Value &#8220;new_directory&#8221; to select it and type in your username. In our example our username, as added to the ftpchroot file is &#8220;fred&#8221; &#8211; so that&#8217;s what we&#8217;ll type here.</li>
<li>Create a new property by clicking in the &#8220;New&#8221; icon at the top of the pane. This will create a new property called &#8220;new_property&#8221;. Change the property value to &#8220;uid&#8221;. Now change its value &#8220;new_value&#8221; to the next available uid &#8211; or, if you&#8217;re starting a new series, 601.</li>
<li>Add a new property for the group id &#8211; &#8220;gid&#8221;. We&#8217;ll set this to &#8220;20&#8243;. i.e. Create the new property, select &#8220;new_property&#8221; and type &#8220;gid&#8221;. Select &#8220;new_value&#8221; and type &#8220;20&#8243;.</li>
<li>Follow this procedure to add:<br />
<table border="0" cellpadding="0" cellspacing="0" width="222">
<tr>
<th>Property</th>
<th></th>
<th>Value(s)</th>
</tr>
<tr>
<td>expire</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>change</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>shell</td>
<td>&nbsp;</td>
<td>/sbin/ftplogin</td>
</tr>
<tr>
<td>home</td>
<td>&nbsp;</td>
<td>/Users/&lt;username&gt;</td>
</tr>
</table>
<p>Where the text &#8220;&lt;username&gt;&#8221; in the last property (&#8220;home&#8221;) is the username of the user you&#8217;re adding. In our example &#8220;fred&#8221;. So the value for the property &#8220;home&#8221; would be &#8220;/Users/fred&#8221;. This means the bottom of your NetInfo Manager pane should end up looking something like:</p>
<table border="0" cellpadding="0" cellspacing="0" width="222">
<tr>
<th>Property</th>
<th></th>
<th>Value(s)</th>
</tr>
<tr>
<td>home</td>
<td>&nbsp;</td>
<td>/Users/fred</td>
</tr>
<tr>
<td>shell</td>
<td>&nbsp;</td>
<td>/sbin/ftplogin</td>
</tr>
<tr>
<td>change</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>expire</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>gid</td>
<td>&nbsp;</td>
<td>20</td>
</tr>
<tr>
<td>uid</td>
<td>&nbsp;</td>
<td>504</td>
</tr>
<tr>
<td>name</td>
<td>&nbsp;</td>
<td>fred</td>
</tr>
</table>
<p><b>2006-04-18</b>: We&#8217;ve been contacted by Esben Sørensen and Antoine Durr over the weekend, both of whom make the observation that &#8220;realname&#8221; needs to be added to the properties listed here. i.e. we should end up with:</p>
<table border="0" cellpadding="0" cellspacing="0" width="222">
<tr>
<th>Property</th>
<th></th>
<th>Value(s)</th>
</tr>
<tr>
<td>home</td>
<td>&nbsp;</td>
<td>/Users/fred</td>
</tr>
<tr>
<td>shell</td>
<td>&nbsp;</td>
<td>/sbin/ftplogin</td>
</tr>
<tr>
<td>change</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>expire</td>
<td>&nbsp;</td>
<td>0</td>
</tr>
<tr>
<td>gid</td>
<td>&nbsp;</td>
<td>20</td>
</tr>
<tr>
<td>uid</td>
<td>&nbsp;</td>
<td>504</td>
</tr>
<tr>
<td>name</td>
<td>&nbsp;</td>
<td>fred</td>
</tr>
<tr>
<td>realname</td>
<td>&nbsp;</td>
<td>Fred</td>
</tr>
</table>
<p>So, add the &#8220;realname&#8221; property &#8220;else the account&#8217;s system preference pane will henceforth come up blank due to an incorrect/invalid realname&#8221; (Antoine Durr).</p>
<p>Thanks to Esben and Antoine.</li>
<li>Make sure you remember the uid as you&#8217;ll need it in a sec.</li>
<li>Close NetInfo Manager saving and confirming the save as you go.</li>
</ol>
<h3>Create A User Folder</h3>
<p>We need to create a user folder and then change its ownership (and permissions) to reflect those of the newly created user.</p>
<ol>
<li>In Terminal, type &#8220;cd /Users&#8221;. Typing &#8220;ls&#8221; will give you a list of all the users on your machine</li>
<li>Type &#8220;mkdir &lt;username&gt;&#8221; where &lt;username&gt; is the new user&#8217;s username. We&#8217;ll be typing &#8220;mkdir fred&#8221;</li>
<li>Change the owner of this file by typing &#8220;sudo chown &lt;uid&gt;:20 ./&lt;username&gt;. Where &lt;uid&gt; is the uid for the user you added (and made a mental note of) and &lt;username&gt; is the username&#8230;. OK. You&#8217;ve got the idea. Oh. If your prompted for a password, give your admin password.</li>
<li>Change the permissions of this file so that we can all access it (if you know what you&#8217;re doing here, set the permissions as you see fit). &#8220;sudo chmod 777 ./&lt;username&gt;&#8221;</li>
</ol>
<p>Now we&#8217;re on the home stretch.</p>
<h3>Give The User A Password</h3>
<p>The next step is to give the newly created user a password. To do this, in Terminal:</p>
<ol>
<li>Type &#8220;sudo passwd &lt;username&gt;&#8221;. (So we&#8217;ll be typing &#8220;sudo passwd fred&#8221;).</li>
<li>Type in the new password at the prompt.</li>
<li>Retype it as prompted.</li>
</ol>
<h3>NAT?</h3>
<p>If you&#8217;re behind a router or firewall which does Network Address Translation (NAT), there&#8217;s one more thing. Passive FTP requires the machine offering the FTP service to return its IP address and a port on which it&#8217;ll be listening. If you&#8217;re on a NATed network, it&#8217;s likely that the FTP server is going to return its internal IP number rather than the external address you&#8217;d prefer it to give. To get around this:</p>
<p>Create the file /etc/ftpd.conf</p>
<p>Add the line &#8220;advertise all &lt;host&gt;&#8221; where &lt;host&gt; is either the host name or external IP address for the FTP server.</p>
<h3>Done</h3>
<p>Restart the FTP server to ensure that all the caches are flushed and then see whether you can log-in via ftp as the new user. The easiest way of doing this is to turn FTP off and then on again in System Preferences -&gt; Sharing.</p>
<h3></h3>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/mac-osx-server-ftp-server-administration/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac OSX Server 10.4</title>
		<link>http://osxhosting.com/osxhosting/mac-osx-server-104#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/mac-osx-server-104#comments</comments>
		<pubDate>Thu, 24 Jan 2008 18:02:44 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Xserve]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[BSD]]></category>
		<category><![CDATA[Darwin]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mach]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/24/mac-osx-server-104/</guid>
		<description><![CDATA[Darwin: Kernel and BSD Mac OS X Server starts with Darwin, the same open source foundation used in Mac OS X, Apples operating system for desktop and mobile computers. Darwin is built around the Mach 3.0 microkernel, which provides features critical to server operations, such as fine-grained multi-threading, symmetric multiprocessing (SMP), protected memory, a unified [...]]]></description>
			<content:encoded><![CDATA[<p><b>Darwin: Kernel and BSD</b></p>
<p><b></b>Mac OS X Server starts with Darwin, the same open source foundation used in Mac OS X, Apples operating system for desktop and mobile computers. Darwin is built around the Mach 3.0 microkernel, which provides features critical to server operations, such as fine-grained multi-threading, symmetric multiprocessing (SMP), protected memory, a unified buffer cache (UBC), 64-bit kernel services and system notifications. Darwin also includes the latest innovations from the open source BSD community, particularly the FreeBSD development community.</p>
<h4>Next-Generation Computing Power</h4>
<p>Mac OS X Server v10.4 brings the power of 64-bit computing to mainstream servers opening up opportunities to process exponentially larger problems. Now with 64-bit addressing, Mac OS X Server can access massive amounts of memory, transcending the 4GB memory limitation of 32-bit systems. Its high-performance 64-bit file system enables you to create very large, exabyte-sized volumes for enormous databases and media storage. And its 64-bit optimized math libraries enable extremely accurate mathematical calculations. While Mac OS X Server is the ideal platform for next-generation networking applications and services, it also runs todays 32-bit applications natively no modification required.</p>
<h4>Advanced BSD Networking</h4>
<p>To increase the performance and security of your server deployments, Mac OS X Server incorporates industry-standard protocols and the latest in security standards such as multilink multihoming, IPv6, IPSec, IP over FireWire and 802.1X network authentication. New in Mac OS X Server v10.4 is Ethernet link aggregation and network interface failover (IEEE 802.3ad) for higher aggregated throughput and increased server availability. And with Mac OS X Server on Xserve G5, you also get support for Virtual Local Area Network (VLAN) tags and Ethernet Jumbo Frames. Using the time-tested BSD sockets and TCP/IP stack, these advanced networking features ensure compatibility and integration with IP-based networks.</p>
<h4>Secure from the Start</h4>
<p>Thanks to its UNIX foundation, Mac OS X Server contains robust security features in its core. To protect your server, your network and your organizations data, it also includes state-of-the-art technologies such as a built-in firewall with stateful packet analysis, strong encryption and authentication services, data security architectures and support for access control lists (ACLs) for fine-grained control of file system permissions. Simple interfaces and configuration tools allow you to set up systems easily and securely. In fact, when you take an Apple server out of the box, its already configured with the most secure settings.</p>
<h4>Standards-Based Directory Services Architecture</h4>
<p>Mac OS X Server features Open Directory, Apples directory and authentication services architecture. Open Directory allows you to integrate your server with any LDAP directory, leveraging the infrastructure you already have in place. It even integrates with proprietary services such as Microsofts Active Directory or Novell eDirectory. Also integrated is MITs Kerberos tcehnology, enabling single sign-on support in both Open Directory and Active Directory environments.</p>
<h4>Optimized for Business-Critical Server Deployments</h4>
<p>While Mac OS X Server has the same robust core as Mac OS X, it adds industrial-strength features required for server deployments. Designed for headless operation, Mac OS X Server enables you to install and configure services without connecting a monitor to the server. Powerful remote management tools allow you to securely manage services from anywhere on the network, and support for SSH2 provides secure access from the UNIX command line. To keep your systems up and running, Mac OS X Server has built-in tools for system monitoring, preventing accidental shutdown and recovering services quickly in case of network or power failure.</p>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/mac-osx-server-104/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing an Xserve for Web Hosting</title>
		<link>http://osxhosting.com/osxhosting/optimizing-an-xserve-for-web-hosting#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/optimizing-an-xserve-for-web-hosting#comments</comments>
		<pubDate>Thu, 24 Jan 2008 17:46:38 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Xserve]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[lasso]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/24/optimizing-an-xserve-for-web-hosting/</guid>
		<description><![CDATA[A single Xserve is ideally suited for smaller scale Web hosting, where the task is to host a handful of moderate-traffic sites. (With a fleet of Xserves, you could host an eBay or an Apple.com, but that’s a topic for another article.) The Xserve’s Apache Web server software has a multitude of configuration options. In [...]]]></description>
			<content:encoded><![CDATA[<p>A single Xserve is ideally suited for smaller scale Web hosting, where the task is to host a handful of moderate-traffic sites. (With a fleet of Xserves, you could host an eBay or an Apple.com, but that’s a topic for another article.) The Xserve’s Apache Web server software has a multitude of configuration options. In this article, I will go over how to set up Apache to serve multiple Web sites from the same machine—so-called “virtual hosting.” I will also look at ways to optimize the server’s setup for fast, robust Web hosting. This article assumes that you have already followed the steps in the Mac OS X Server Administrator’s Guide to start Web service.  (You can find the Guide on the <a href="http://docs.info.apple.com/article.html?artnum=50525">Mac OS X Server Manuals page</a>.)</p>
<h2>Hosting Multiple Domains on One Server</h2>
<p>The out-of-the-box behavior of Apache is to have one IP address and to serve one domain. However, it is quite easy to transparently host thousands of domains on a single Xserve, and the users need never know that it’s one machine behind the scenes and not a whole farm. There are two approaches to this sort of “virtual hosting”—IP-based and name-based. With IP-based hosting, each domain name is mapped to its own individual IP address. Name-based hosting uses a little trickery so that many domains can be served from the same IP address. IP-based hosting is a little more robust—it allows for secured HTTPS transactions, which are important for Web commerce, reverse DNS, and some other features; but IP addresses are scarce, so name-based hosting, which works perfectly well, is probably preferable for most applications. Name-based hosting depends on a certain header sent by the browser, and as a result it doesn’t work with some browsers released before 1997, but that is less and less of an issue as those browsers become increasingly scarce. I will go over how to set up both kinds of virtual hosting.</p>
<h2>IP-Based Hosting</h2>
<p>Assuming you have already acquired the domain names and IP addresses you’ll be using, the first step in creating an IP-based hosting setup is to configure the Xserve to have multiple IP addresses on the same Ethernet card. This can be done from System Preferences on the Xserve. Open the Network Preferences pane. Select “Active Network Ports” from the Show drop-down menu. Choose the port corresponding to the Ethernet card that you want to assign multiple IP addresses to, and click “Duplicate.” Then simply change the duplicate configuration to reflect the second IP address. It is necessary also to make sure that the Subnet Mask setting for all but one of the ports is 255.255.255.255. This will prevent conflicts in the routing tables.</p>
<p>On a headless Xserve, the same thing can be accomplished with the IPAliases startup item. If the file /etc/IPAliases.conf doesn’t exist, create it. For each additional IP address, this file should contain one line of the form</p>
<pre>interface:IPaddress:netmask</pre>
<p>For example, to add the IP address 192.168.50.210 to the en0 network interface, the following line would be used:</p>
<pre>en0:192.168.50.210:255.255.255.255</pre>
<p>The netmask should always be 255.255.255.255.</p>
<p>In addition, IP aliases must be turned on, by adding to /etc/hostconfig the line</p>
<pre>IPALIASES=-YES-</pre>
<p>Every time the system is booted, the aliases listed in /etc/IPAliases.conf will be added. The file can contain any number of aliases.</p>
<p>With multiple IP addresses configured, the next step is to add DNS entries.  For each domain that you want mapped to an IP address, create an A record in the DNS pointing the address to the site. In BIND, the A record might look like this:</p>
<pre>firstdomain.com.   A   10.151.90.2</pre>
<p>All of the records for the various domains can be in the same DNS file or in different ones, depending on the preferences of your users and whether you host your own DNS or not.</p>
<p>Finally, tell Apache how to deal with requests for the various addresses. In Server Settings, click Web in the Internet tab. Choose “Configure Web Service” from the drop-down menu. In the Sites tab, you can add as many sites as you like, just by entering the domain name and IP address for each one. The content for each site should be placed in the folder you specify in the “Web folder” field here.</p>
<h2>Name-Based Hosting</h2>
<p>Setting up name-based hosting is a bit simpler. Add DNS records for each domain to be hosted, such that each domain name resolves to the same single IP address—the one associated with your Xserve. When a user’s browser makes a request for one of the domains, it will send an HTTP Host header indicating which domain it is requesting. Apache interprets this header and returns the appropriate content.</p>
<p>After the DNS is configured, go to Server Settings’ Internet tab, and choose “Configure Web Service” from the Web drop-down menu. Go to the Sites tab. Here you can create an entry for each site you want to serve. Give each one the same IP address but different domain names. Content will be served from the location specified in the “Web folder” field.</p>
<p>If desired, name-based and IP-based hosting can co-exist.</p>
<h2>Handling A Lot Of Domains</h2>
<p>If you are hosting quite a few domains, or adding new ones frequently, it can be inconvenient to add an entry for each one in Server Settings. The process can be automated to a degree, so that simply adding a DNS entry and creating a new directory for content on the Xserve is sufficient to launch each new domain. NOTE that this method and that of adding sites via Server Settings are mutually exclusive—new domains added in this way will not be reflected in Server Settings, and adding or editing sites in Server Settings will alter the configuration of the automatically created domains with unpredictable results. This method also precludes turning the performance cache on and off on a per-domain basis. That said, here are the basic steps.</p>
<p>First, configure a single site in Server Settings, with the correct IP address. The domain name you give it doesn’t matter. Save the changes.</p>
<p>Edit /etc/httpd/httpd.conf to uncomment the two lines beginning:</p>
<pre>LoadModule vhost_alias_module</pre>
<p>and</p>
<pre>AddModule vhost_alias_module</pre>
<p>Also, change the line</p>
<pre>UseCanonicalName On</pre>
<p>to</p>
<pre>UseCanonicalName Off</pre>
<p>Next, edit /etc/httpd/httpd_macosXserver.conf. There should be a long comment section starting with the line:</p>
<pre>## The section below contains a block for each site (virtual host).</pre>
<p>Below this comment section is the stanza to edit. It looks something like this:</p>
<pre>#&lt;RAdmin 100&gt;NameVirtualHost 192.168.0.25:80

Listen 192.168.0.25:80

&lt;VirtualHost 192.168.0.25:80&gt;

#WebPerfCacheEnable Off

#SiteAutomaticallyDisabled Off

ServerName example.com

ServerAdmin webmaster@example.com

DocumentRoot "/Library/WebServer/Documents/"

DirectoryIndex index.html index.php

CustomLog "/private/var/log/httpd/access_log" "%{PC-Remote-Addr}i %l %u %t \"%r\" %&gt;s %b"

ErrorLog "/private/var/log/httpd/error_log"</pre>
<p>and so on.</p>
<p>The stanza may look somewhat different if performance caching is enabled.</p>
<p>There are just a few changes to make to this. First, on the ServerName line, you can place the fallback domain to which users of pre-1997 browsers will be sent. This line has to exist, but for users of modern browsers, it will be ignored.</p>
<p>Then modify the DocumentRoot line to look like this:</p>
<pre>VirtualDocumentRoot /Library/WebServer/Documents/%0</pre>
<p>and the CustomLog line to include %v :</p>
<pre>CustomLog "/private/var/log/httpd/access_log" "%v %{PC-Remote-Addr}i %l %u %t \"%r\" %&gt;s %b"</pre>
<p>Save the file and restart Apache.</p>
<p>The VirtualDocumentRoot directive tells Apache to interpolate information from the server name, which in this case is read on the fly from the user’s browser, into the pathname. “%0” is a specifier representing the requested domain name. Thus, a browser request for http://domain-ten.com/index.html will be answered with the file at /Library/WebServer/Documents/domain-ten.com/index.html.</p>
<p>As a result, to host a new domain, all that has to be done is to create a new directory corresponding to the domain name in /Library/WebServer/Documents, and to place content to be served in that directory.</p>
<p>The various specifiers understood by the VirtualDocumentRoot directive are explained on the <a href="http://httpd.apache.org/docs/mod/mod_vhost_alias.html">apache.org website</a>. For example, if you have hundreds of domains hosted, they can be sorted into 36 directories based on their first alphanumeric character with the following directive:</p>
<pre>VirtualDocumentRoot /Library/WebServer/Documents/%1.1/%0</pre>
<p>A side-effect of this aliasing technique is that log data for all the virtual domains is sent to the same file. Adding the “%v” specifier to the CustomLog line prepends the name of the domain to each log line. A simple script can be used to parse this master log file into individual files for each domain, if so desired. More information on CustomLog specifiers is available on the <a href="http://httpd.apache.org/docs/mod/mod_vhost_alias.html">apache.org website</a>.</p>
<h2>Tuning Web Server Performance</h2>
<p>When setting up an Xserve for use as a Web server, there are a number of things you can do to improve performance. Some of these techniques improve the performance of the machine in general; others involve examining where bottlenecks may be occurring and tuning the Web server to work around them.</p>
<p>First, it is important to make sure the hardware is up to speed. Even a low-end Xserve has a very nice feature set, including fast disk access, fast Ethernet, and a minimum of 256MB of RAM out of the box. The RAM allotment can be increased to 2 gigs: if the Web server at full-throttle seems to be using a lot of memory, buying more RAM could speed things up considerably.  In terms of hardware, there are several options that will increase reliability, including IP failover to a second server, which is described in detail in the Admin Guide, and adding an <a href="http://www.apple.com/xserve/raid/">Xserve RAID</a> for ultra-fast and reliable storage.</p>
<p>In addition to the hardware approaches, there are a number of software-based strategies for optimizing a Web server. I will detail some of these below.</p>
<h2>Apple’s Performance Cache</h2>
<p>Included in the OS X Server installation is Apple’s performance cache. This acts as an intermediary between the Apache Web server and the user: the cache stores a copy of commonly requested pages from the sites served, and, upon receiving a user request for one of these pages, sends it along. This involves much less overhead than invoking Apache each time the page is requested. Apache is still kept busy serving dynamic and less common pages. The cache can be enabled and disabled individually for each of the sites served from the machine. In general, the cache is very helpful for highish-traffic sites that consist primarily of static HTML pages. The total size of the site’s popularly requested static pages should be small enough to fit in the machine’s RAM; otherwise caching may actually slow things down. For sites with primarily dynamic content, the cache will not be helpful.</p>
<p>To turn the performance cache for a particular site on or off, go to the Internet tab in Server Settings and click Web. Choose “Configure Web Service,” and then select the Sites tab. Edit the site you want to change, and go to the Options tab. Check or uncheck “Enable performance cache” and save. The changes take effect when the Web server is restarted from the Web drop-down menu. Note that this cannot be done with a server configured with dynamic site addressing, as explained above.</p>
<p>Aspects of the behavior of the cache can be configured in the file /etc/webperfcache/webperfcache.conf. The default settings seem to work quite well, but they can be adjusted to make the cache work better with tweaked Apache settings (see below) or unusual server configurations.</p>
<h2>Tweaking Apache</h2>
<p>Apache has various settings which control how it handles requests. Tuning these can make a big difference in the performance of the server.</p>
<p>Apache’s performance can be monitored by viewing yourhosteddomain.com/server-status in a browser. Configure the &lt;Location /server-status&gt; section in /etc/httpd/httpd_macosXserver.conf to control who can view the status: it’s set by default to deny all but localhost.</p>
<h2>Eliminating Unnecessary Modules</h2>
<p>The first step in speeding up Apache is to remove any unnecessary modules. To see which modules are compiled in, do the following:</p>
<p>In httpd.conf, there is a section that looks like this:</p>
<pre>#&lt;Location /server-info&gt;#    SetHandler server-info

#    Order deny,allow

#    Deny from all

#    Allow from .your-domain.com

#&lt;/Location&gt;</pre>
<p>Remove the # from the beginning of each line to uncomment the directive. Change “.your-domain.com” to the actual domain(s) that you wish to access server information from, and then restart Apache.</p>
<p>Now http://yoursite.com/server-info should display a variety of detailed information about the server, including which modules are compiled in, and configuration information for each module.</p>
<p>Modules that are compiled in statically can’t be removed without recompiling the Web server. The out-of-the-box configuration of Apache on Xserve has almost every module compiled as dynamically loadable, so it is easy to turn off unnecessary ones without recompiling the Web server. Dynamic modules are loaded when Apache starts, according to the LoadModule and AddModule directives in the file /etc/httpd/httpd.conf.</p>
<p>The base installation of Apache that ships with OS X Server loads quite a few dynamic modules by default. Each of these takes up some memory, and some of them, such as mod_status, cause Apache to do extra work with every request. Any modules that aren’t necessary to the functioning of the sites you host should not be loaded. This can be controlled by commenting out (by prefixing a # on each line) the relevant LoadModule and AddModule directives for each module in /etc/httpd/httpd.conf. Every module has both a LoadModule and and AddModule directive—be sure to comment out both when disabling a module. Mod_include and mod_rewrite, among others, are notorious performance hogs.</p>
<h2>Adjusting Processes</h2>
<p>There are several directives that can be adjusted to modify how Apache handles traffic. Apache will spawn new versions of itself to handle requests. MaxClients sets the maximum number of these that will be spawned. The more of these there are, the faster Apache can handle a large number of requests—up to the limitations of the machine’s memory. The default is 500. Figure on about 1 MB of RAM for each httpd instance, and set MaxClients accordingly in Server Settings (or /etc/httpd/httpd_macosXserver.conf).</p>
<p>The MinSpareServers and MaxSpareServers directives, in /etc/httpd/httpd.conf, set how many spare server processes are running to handle sudden requests. StartServers sets how many are created when Apache first starts. You may want to increase StartServers and MaxSpareServers if Apache seems to be slowing down when it has to create new processes. When Apache spawns more than four child processes per second—a sign that it may need more spare servers—it logs that fact to its error log. Keep an eye on the log and tune if necessary.</p>
<p>MaxRequestsPerChild keeps a lid on potential memory leaks by killing off each child process after it has served a certain number of requests. The default setting on OS X Server is 100,000, which is reasonable. A setting of 0 means that Apache’s children are never killed.</p>
<p>The KeepAlive settings in /etc/httpd/httpd_macosXserver.conf control how each server process listens for new requests on a connection that has been established. Increasing KeepAlive requests reduces traffic from new connections, but increases server load with many Apache processes waiting around for orders.</p>
<h2>Removing Extra Steps</h2>
<p>Another key to speeding up Apache’s behavior is to minimize the number of things it has to do for each request. If the Web server is receiving a lot of requests, these extra tasks can bog it down tremendously.</p>
<p>HostnameLookups causes Apache to perform a DNS lookup for every incoming request, so it can log the domain name as well as the IP address in the access log. This should be turned off, as it is by default, if performance is an issue. The DNS lookups can be performed after the fact, on another machine, using a tool such as logresolve.</p>
<p>If AllowOverride is turned on, then Apache checks for the presence of .htaccess files containing overriding directives at every level of the hierarchy. This repetitive checking eats up server resources. For maximum performance, set AllowOverride None. (This is the default setting for OS X Server.)</p>
<p>FollowSymLinks is a directive that instructs Apache to follow symbolic links without performing an additional security check on them. If this is turned off, Apache slows down to check each symbolic link.</p>
<p>Finally, logging is very important for 95 percent of Web-hosting activities, but if you are not using it, turning it off will improve performance. All that file access slows things down considerably. Set TransferLog /dev/null in /etc/httpd/httpd.conf.</p>
<h2>Temporary Adjustments</h2>
<p>Sometimes, if you’re lucky, you have advance warning of a peak in Web traffic; say, a well-read news site is planning to link to one of the domains you host tomorrow. There are a few emergency preparations that can be made to allow for that kind of situation.</p>
<p>First, free up memory and CPU by offloading everything you can. If the Xserve is acting as a mail server, database server, or what-have-you, as well as a Web server, move those duties to another machine if possible. If there are other medium-traffic domains that could be hosted elsewhere temporarily, do it. Shut down unnecessary processes and cron jobs.</p>
<p>Second, make sure you have enough bandwidth. If you use a firewall, you may want to reconfigure its socket handling to maximize throughput.</p>
<p>If it is possible, making changes to the content of the<br />
domain to be served can be very effective. Remove images, reduce<br />
their file sizes, or simply move them to another server and<br />
serve them from there.</p>
<p>Apache’s MaxClients limit is hard-coded at 2048 in OS X<br />
Server. For peak traffic, you may want far more clients than<br />
this. It is necessary to recompile Apache to make this change.<br />
You will have to download the source code from the<br />
href=&#8221;http://httpd.apache.org/download.cgi&#8221;&gt;apache.org website. In the source file src/include/httpd.h,<br />
change the line</p>
<pre>#define HARD_SERVER_LIMIT 2048</pre>
<p>to</p>
<pre>#define HARD_SERVER_LIMIT 4096</pre>
<p>Or whatever number seems appropriate. Note that the number given here is usually a factor of 2.</p>
<p>Then recompile according to the instructions in the INSTALL file included with the source.</p>
<p>Careful deployment of all of these tips should significantly improve the way the Xserve handles Web serving. If, after all of the above, your server simply can’t handle the load it’s getting, that’s when you should consider adding a second machine to share the burden.</p>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/optimizing-an-xserve-for-web-hosting/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>OSX Wiki Server</title>
		<link>http://osxhosting.com/osxhosting/osx-wiki-server#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/osx-wiki-server#comments</comments>
		<pubDate>Wed, 23 Jan 2008 16:43:41 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://macosxhosting.wordpress.com/2008/01/23/osx-wiki-server/</guid>
		<description><![CDATA[Mac OS X Server makes it easy for groups to collaborate and communicate through their own wiki-powered intranet website complete with group calendar, blog, and mailing list. Users can create and edit wiki pages, tag and cross-reference material, upload files and images, add comments, and search content with point-and-click ease. Communication is key. Whether it’s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://images.apple.com/server/macosx/features/images/wikis_hero20071009.png" alt="Mac OS X Server Wikis and Blogs Screenshot" border="0" height="321" width="464" /></p>
<h1><img src="http://images.apple.com/server/macosx/features/images/wikis_title20071009.gif" alt="Wiki Server. Collaboration for teams." border="0" height="27" width="695" /></h1>
<p class="intro">Mac OS X Server makes it easy for groups to collaborate and communicate through their own wiki-powered intranet website complete with group calendar, blog, and mailing list. Users can create and edit wiki pages, tag and cross-reference material, upload files and images, add comments, and search content with point-and-click ease.</p>
<div class="grid2col">
<div class="column first">
<h3>Communication is key.</h3>
<p>Whether it’s a small business or a workgroup inside a large corporation, all members need access to the same materials in order to work effectively. Wikis assist users in the clear exchange of information, eliminating confusion and ensuring that all members of a project have access to the resources they need.</p>
<p><img src="http://images.apple.com/server/macosx/features/images/wiki_buttons20071009.gif" alt="Buttons" class="left" style="margin-bottom:0;" border="0" height="46" width="173" /></p>
<p>The wiki blog is the perfect place for sharing team news and status reports or encouraging brainstorming. For shorter comments, there’s a space at the bottom of the wiki page where users can share their thoughts or provide feedback. You have the ability to control who can add comments — nobody, only authenticated users, or anyone who has access to the wiki. Teams can also use the wiki for file exchange — uploading shared documents, images, or movies for distribution; even tracking revisions on documents. And shared calendars help users stay on track by ensuring that everyone can see meeting schedules and milestones.</p>
<p><img src="http://images.apple.com/server/macosx/features/images/wikis_editicons20071009.jpg" alt="Wikis and Blogs editing icons" class="right" border="0" height="34" width="106" /></p>
<h3>Customized web workspace.</h3>
<p>Wikis allow you to create custom, project-specific websites. Select from 20 built-in themes with different colors, fonts, and layout styles. You can customize these templates with your own banner image and a custom sidebar title that displays pages with a user-defined tag at initial login. Once set up, it’s easy to add, delete, and edit content in whatever way makes sense. No syntax or markup knowledge is required — what you see on the page is exactly what you get.</p></div>
<div class="column last">
<div class="gallerybox">
<h2>Wiki Server showcase</h2>
<ul class="popupnav">
<li><a href="http://images.apple.com/server/macosx/features/images/wiki_gallery_01_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/wiki_gallery_01t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/wiki_gallery_02_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/wiki_gallery_02t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/wiki_gallery_03_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/wiki_gallery_03t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/wiki_gallery_04_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/wiki_gallery_04t_20071009.gif" border="0" height="48" width="65" /></a></li>
</ul>
</div>
<p><!--/gallery--></p>
<div class="gallery_capbottom"></div>
<p>You can insert hyperlinks, link between pages, add images, attach files, and change formatting — all with a few clicks. Because wikis feature RSS support, team members can easily track changes and be notified when new content is added, edited, or tagged.<br />
<img src="http://images.apple.com/server/macosx/features/images/wikis_rssicon20071009.jpg" alt="Wikis RSS icon" class="right shadow inline" border="0" height="60" width="100" /><br />
You can subscribe to RSS feeds for the entire wiki site, any individual page, or any tag or search results. And you’ll never have to worry about making mistakes. Since the wiki maintains a complete history, you can always revert to a previous version of your document.</p>
<p>Once you create a wiki website and give access to members of the workgroup, everyone has the same capability to contribute to the site. And it’s not limited to text and images — users can access a group calendar to track meetings and deadlines or send messages to a mailing list to keep others informed. The blog feature is perfect for brainstorming or commenting on work. And there’s an option for subscribing to a podcast — so anyone who missed that important conference call can catch up on the news.</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/osx-wiki-server/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Leopard Server</title>
		<link>http://osxhosting.com/osxhosting/hello-world-2#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://osxhosting.com/osxhosting/hello-world-2#comments</comments>
		<pubDate>Tue, 22 Jan 2008 18:57:16 +0000</pubDate>
		<dc:creator>montanaflynn</dc:creator>
				<category><![CDATA[Leopard]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Xserve]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://osxhosting.com/osxhosting/?p=4</guid>
		<description><![CDATA[If you think it takes a dedicated IT department to deploy and use a server, think again. Leopard Server is designed so you can easily set up and manage servers. Keeping it simple. Leopard Server builds on Apple’s legendary ease of use with new Server Assistant and Server Preferences features that allow even nontechnical users [...]]]></description>
			<content:encoded><![CDATA[<h1><img src="http://images.apple.com/server/macosx/features/images/admin_title20071009.gif" style="width:384px;height:27px;" alt="Setup and Administration. No IT department required." border="0" /></h1>
<p class="intro">If you think it takes a dedicated IT department to deploy and use a server, think again. Leopard Server is designed so you can easily set up and manage servers.</p>
<div class="grid2col">
<div class="column first">							<img src="http://images.apple.com/server/macosx/features/images/admin_icons20071009.png" alt="Server Preference Icon" class="left" style="margin-top:-5px;" align="left" border="0" height="284" width="100" /></p>
<h3>Keeping it simple.</h3>
<p>Leopard Server builds on Apple’s legendary ease of use with new Server Assistant and Server Preferences features that allow even nontechnical users to set up and manage a server in just a few clicks.</p>
<p>Server Assistant walks you through the setup process and configuration of essential services. It runs a built-in Network Health Check to verify network settings and Internet connectivity.</p>
<p class="clear">Using the new Server Preferences application, you can quickly manage users and groups on the server and set up key services such as file sharing, calendaring, instant messaging, mail, websites with wikis and blogs, virtual private networking for remote access, and backup settings for network clients.</p>
<p class="clear">&nbsp;</p>
<p><img src="http://images.apple.com/server/macosx/features/images/admin_widgets20071009.jpg" alt="Server Status Widgets" class="across center clear" border="0" height="164" width="344" /></p>
<h3>Status reports.</h3>
<p>To help you keep an eye on things, a new Server Status Dashboard widget provides an easy and instantaneous way to monitor your server. You’ll get at-a-glance information on the status of essential services such as mail, file and printer sharing, iChat, and more.</p></div>
<div class="column last">
<div class="gallerybox">
<h2>Setup and Administration showcase</h2>
<ul class="popupnav">
<li><a href="http://images.apple.com/server/macosx/features/images/admin_gallery_01_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/admin_gallery_01t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/admin_gallery_02_20071017.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/admin_gallery_02t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/admin_gallery_03_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/admin_gallery_03t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li><a href="http://images.apple.com/server/macosx/features/images/admin_gallery_04_20071009.jpg" class="overlaythumb"><img src="http://images.apple.com/server/macosx/features/images/admin_gallery_04t_20071009.gif" border="0" height="48" width="65" /></a></li>
<li class="enlarge"></li>
</ul>
<div class="clearer"></div>
</div>
<p><!--/gallery--></p>
<div class="gallery_capbottom"></div>
<h3>The end of manual labor.</h3>
<p>Adding clients to the network is now a quick and easy process.  Just plug the new Mac into the network and launch the Directory Utility application.  It will automatically detect and sign on to the server. After authenticating, the new computer will be configured to use the services offered by your server, and all your applications, such as Mail, iChat, and iCal, will also be configured and ready to use.  Leopard Server will keep these settings updated, so you’ll never need to manually reconfigure a user’s account or computer again.</p>
<h3>Server Admin for advanced IT services.</h3>
<p><img src="http://images.apple.com/server/macosx/features/images/admin_icon20071009.png" alt="Server Admin" class="right icon" style="margin-top:12px;" border="0" height="103" width="100" /></p>
<p>Advanced IT administrators can use Server Admin to set up, manage, and monitor advanced services. Completely redesigned in Leopard Server, Server Admin includes new file-sharing and permission controls, tiered administration, and options for organizing servers into smart groups.</p>
<p><img src="http://images.apple.com/server/macosx/features/images/admin_smartgroups20071009.png" alt="Smart Groups" class="across" border="0" height="177" width="330" /></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://osxhosting.com/osxhosting/hello-world-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
