<?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>Dan Grossman &#187; text editor</title>
	<atom:link href="http://www.dangrossman.info/tag/text-editor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dangrossman.info</link>
	<description></description>
	<lastBuildDate>Thu, 19 Aug 2010 20:19:09 +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>Dedicated Server Setup Checklist</title>
		<link>http://www.dangrossman.info/2007/03/18/dedicated-server-setup-checklist/</link>
		<comments>http://www.dangrossman.info/2007/03/18/dedicated-server-setup-checklist/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 07:27:34 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Apache web server]]></category>
		<category><![CDATA[Brute Force]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[installed software]]></category>
		<category><![CDATA[line 
Protocol]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[McAfee Threat Center]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[pico text editor]]></category>
		<category><![CDATA[software updates]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[UDP]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web forms]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://www.dangrossman.info/2007/03/18/dedicated-server-setup-checklist/</guid>
		<description><![CDATA[You&#8217;ve outgrown shared hosting and decided to start renting a server of your own. Since you&#8217;re still on a tight budget, you want an unmanaged server, where full responsibility for configuring and managing the server is yours. These are the steps I go through every time I set up a new server for web and [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve outgrown shared hosting and decided to start renting a server of your own. Since you&#8217;re still on a tight budget, you want an unmanaged server, where full responsibility for configuring and managing the server is yours. These are the steps I go through every time I set up a new server for web and database hosting. It doesn&#8217;t matter if you choose to use a control panel or not, these are the essential items for securing a Linux server and preparing it to host websites or web applications.<span id="more-82"></span></p>
<ol>
<li>
<b>Create a Non-Root User</b></p>
<p>When your server is provisioned, you&#8217;ll generally only be given an IP address and a root password. That&#8217;s all you need to <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">SSH in</A> to the server as the root user for the first time. It&#8217;s bad practice to log in as root for a few reasons &mdash; if you log in as a single user and only &#8220;su&#8221; to root access when needed, you&#8217;re less likely to accidentally damage your own system by deleting an important file or providing the wrong options or path to a command. It&#8217;s also harder for someone to attempt to break into your server by brute force if they can&#8217;t log in directly as root; they&#8217;ll need to find a way in as another user then additionally gain root access.</p>
<p>The first thing you&#8217;ll want to do is create a user for yourself to log in as in the future. In most Linux distributions, that&#8217;s as easy as typing &#8220;useradd [username]&#8221; or &#8220;adduser [username]&#8220;. To set the password for your new user, type &#8220;pass<i></i>wd [username]&#8221; and you&#8217;ll be prompted to supply the new password.
</li>
<li><b>Disable Root Logins Over SSH</b>
<p>Now that you have a second user account, reconnect to your server as that user. Now you can use &#8220;su&#8221; to gain root access again and edit the SSH configuration file. To do so with the pico text editor, type &#8220;pico /etc/ssh/sshd_config&#8221;. You&#8217;re going to make two changes:</p>
<p>Find the line <i>Protocol 2, 1</i>, uncomment it, and change it to <i>Protocol 2</i>. Find the line <i>PermitRootLogin yes</i>, uncomment it, and change it to <i>PermitRootLogin no</i>.</p>
<p>Save the file (CTRL+X, Y) and quit your text editor. Now restart the SSH service (/etc/rc.d/init.d/sshd restart) and it&#8217;s no longer possible to log in as the root user over SSH.
</li>
<li><b>Disable Telnet</b>
<p>Telnet is another way to connect to your server, but unlike SSH, is not encrypted. As it&#8217;s less secure and just another opportunity for someone to attempt to gain access to your server, it&#8217;s best to simply disable the service. To do so, edit the telnet configuration with &#8220;pico /etc/xinetd.d/telnet&#8221;. </p>
<p>Find the line that reads <i>disable = no</i> and change it to <i>disable = yes</i>.</p>
<p>Now, restart the xinetd service with &#8220;/etc/rc.d/init.d/xinetd restart&#8221; and prevent telnet from starting on boot with &#8220;/sbin/chkconfig telnet off&#8221;.
</li>
<li><b>Install APF (Advanced Policy Firewall)</b>
<p>APF is a policy based firewall for Linux. It&#8217;s very simple to install and configure. </p>
<ol>
<li>Download it to your server by issuing &#8220;wget <a href="http://www.rfxnetworks.com/downloads/apf-current.tar.gz">http://www.rfxnetworks.com/downloads/apf-current.tar.gz</a>&#8220;</li>
<li>Extract the file with &#8220;tar -xzf apf-current.tar.gz&#8221;</li>
<li>Enter the directory that was created, for example &#8220;cd apf-0.9.6&#8243;</li>
<li>Install APF with the provided script &#8220;./install.sh&#8221;</li>
<li>Edit the configuration file: &#8220;pico /etc/apf/conf.apf&#8221;
<p>Find the line <i>USE_DS=&#8221;0&#8243;</i> and change it to <i>USE_DS=&#8221;1&#8243;</i> to enable the DShield.org block list. Then you&#8217;ll want to edit the ports APF will allow traffic through on your server by finding and updating the following lines as appropriate:</p>
<p><i># Common ingress (inbound) TCP ports -3000_3500 = passive port range for Pure FTPD<br />
IG_TCP_CPORTS=&#8221;20,21,22,25,26,53,80,110,143,443,8443,2222,123,3306,10000,8767,14534,51234&#8243;</p>
<p># Common ingress (inbound) UDP ports<br />
IG_UDP_CPORTS=&#8221;21,22,53,123,8767,14534,51234&#8243;</p>
<p># Egress filtering [0 = Disabled / 1 = Enabled]<br />
EGF=&#8221;1&#8243;</p>
<p># Common egress (outbound) TCP ports<br />
EG_TCP_CPORTS=&#8221;21,22,25,80,443,8443,43,2222,123,8767,14534,51234&#8243;</p>
<p># Common egress (outbound) UDP ports<br />
EG_UDP_CPORTS=&#8221;20,21,22,53,123,8767,14534,51234&#8243;</i>
</li>
<li>Start up APF to test your settings. &#8220;/usr/local/sbin/apf -s&#8221;</li>
<li>If everything looks right (you&#8217;re still connected, you can still access whatever ports you need to access, etc.) you can edit the configuration file again and change <i>DEVM=&#8221;1&#8243;</i> to <i>DEVM=&#8221;0&#8243;</i> to disable development mode.</li>
<li>Restart APF and set it to start on reboot with &#8220;/sbin/chkconfig &#8211;level 2345 apf on&#8221;</li>
</ol>
</li>
<li><b>Install BFD (Brute Force Protection)</b>
<p>BFD is designed to work alongside APF by scanning your system&#8217;s logs for a large number of failed login attempts, and issuing the command to APF to deny that person&#8217;s IP address from connecting again. This protects you from attempts at &#8220;brute forcing&#8221; access to your system, such as repeatedly trying to log in to common account names using a dictionary of common passwords.</p>
<p>To install BFD, follow the same procedure as above, using the archive at <a href="http://www.rfxnetworks.com/downloads/bfd-current.tar.gz">http://www.rfxnetworks.com/downloads/bfd-current.tar.gz</a>.</p>
<p>The configuration file for BFD is located at /usr/local/bfd/conf.bfd if you want to change any settings, including the ability to have a daily report of failed login attempts e-mailed to you.
</li>
<li><b>Install mod_security</b>
<p>mod_security is a module for the Apache web server that lets you filter out certain requests from being processed. This lets you stop many types of vulnerability exploits on your web server, especially those aimed at sending spam through web forms and issuing commands through known vulnerabilities in some PHP scripts.</p>
<p>The download and installation process is slightly different depending on what version of Apache you&#8217;re running, but it only takes a few minutes to install in most cases. You can download and find documentation at the <a href="http://www.modsecurity.org/">ModSecurity</a> website.</p>
<li><b>Check Services are Up to Date</b>
<p>While you just purchased your server, the software that came with it may already be out of date, and potentially vulnerable to newly discovered exploits. A good place to keep track of high risk vulnerabilities in the wild is the <a href="http://www.mcafee.com/us/threat_center/default.asp">McAfee Threat Center</a>. </p>
<p>Many Linux distributions come with a program such as yum or up2date which you can use to check for updates to installed software on your system automatically. Make use of them on a regular basis and check with the websites of the service creators for updates and patches.
</li>
<li><b>Tune Apache and MySQL</b>
<p>For most people, Apache and MySQL will work relatively well out of the box. If you intend to put considerable load on the server, it&#8217;s worth doing a little tuning before you go live. There&#8217;s documentation for tuning the settings of both <a href="http://httpd.apache.org/docs/2.0/misc/perf-tuning.html">apache</a> and <a href="http://dev.mysql.com/doc/refman/4.1/en/server-parameters.html">mysql</a> on their websites, and an excellent blog at <a href="http://www.mysqlperformanceblog.com/">mysqlperformanceblog.com</a>.</p>
<p>If you&#8217;re going to be running PHP applications, a byte code cache such as <a href="http://us3.php.net/apc">APC</a> can significantly boost performance as well.</li>
</ol>
<p>Follow this checklist to get up and running, ready to host your websites. Remember that managing a server is an ongoing process. You need to keep up with software updates, vulnerabilities, and performance bottlenecks on a regular basis to keep things running smoothly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dangrossman.info/2007/03/18/dedicated-server-setup-checklist/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>PHP Development Environment</title>
		<link>http://www.dangrossman.info/2006/12/20/php-development-environment/</link>
		<comments>http://www.dangrossman.info/2006/12/20/php-development-environment/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 08:24:08 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[Contact Administrator]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[WAMP installation]]></category>
		<category><![CDATA[web statistics service]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://www.dangrossman.info/2006/12/20/php-development-environment/</guid>
		<description><![CDATA[There have been four phases to the evolution of my PHP development environment. First, I used notepad, FTP and a shared hosting account. WS_FTP to be exact, made by IPSwitch which once sent me a free t-shirt for sending in a testimonial for their website. Once I took on a job working on a PHP [...]]]></description>
			<content:encoded><![CDATA[<p>There have been four phases to the evolution of my PHP development environment. First, I used notepad, FTP and a shared hosting account. WS_FTP to be exact, made by IPSwitch which once sent me a free t-shirt for sending in a testimonial for their website.</p>
<p>Once I took on a job working on a PHP application larger than one file in size (<a href="http://www.contactadministrator.com/">Contact Administrator</a>), the single file per window, single undo abilities of notepad didn&#8217;t cut it anymore. I upgraded to <a href="http://www.textpad.com/">TextPad</a>. I gained the convenience of a single window for all open files, syntax highlighting, multiple levels of undo, and the ability to replace patterns in all open files. My routine still consisted of opening all the files in a project in TextPad, writing code, saving, uploading by FTP to the server, and testing the changes live.<span id="more-29"></span></p>
<p>It wasn&#8217;t until 2005 that things changed significantly. I discovered vim, starting the third phase. I had been managing two servers to run my websites for a few years by now but had only known vi as a text editor that was hard to quit out of. Then I met Amir while working at <a href="http://www.mathforum.org/">The Math Forum</a>, a &#8220;vi guru&#8221;. His copy had color, syntax highlighting, edited multiple files at once, transformed huge blocks of text at a time, ran regular expression replacements in a flash. Watching him code got me hooked. For nearly a year I worked directly on my servers over SSH in PuTTY, editing code on the server with vim.</p>
<p>Then W3Counter came along. It was my most ambitious project yet &#8211; a full-blown web statistics service, a competitor for Google Analytics and the likes, to support thousands of simultaneous users, and I wanted to finish it in under a month. It ended up taking around two. This project was bigger and more complex than the PHP scripts I had worked on before, and my knowledge of the language had advanced much past when I developed Contact Administrator.  I had gained experience in Java, MVC, frameworks, ORM. I wasn&#8217;t going to tackle something like W3Counter with huge files of procedural code.</p>
<p style="margin: 5px 0pt; text-align: center"><a title="Eclipse PHP IDE and Symfony Framework" href="http://www.dangrossman.info/photos/screenshots/eclipse-symfony.jpg"><img src="http://www.dangrossman.info/photos/screenshots/eclipse-symfony-small.jpg" /></a></p>
<p>That&#8217;s when I moved on to my current environment. My editor of choice is Eclipse with the PHP extensions, released as the <a href="http://www.eclipse.org/php/">Eclipse PHP IDE</a>. It gives me a view of my directory hierarchy, a browser for my class APIs, code completion and an internal browser.</p>
<p>I combine that with <a href="http://www.wampserver.com/en/">WAMP5</a> for a local copy of Apache, PHP and MySQL. I keep my development environments up-to-date, and deploy to my live servers with <a href="http://subversion.tigris.org/">Subversion</a>. Eclipse has <a href="http://tabaquismo.freehosting.net/ignacio/eclipse/tortoise-svn/subversion.html">TortoiseSVN</a> plugins for easy integration. I set up the Subversion repository after reading <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FPragmatic-Version-Control-Subversion-Starter%2Fdp%2F0977616657&#038;tag=awio-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Pragmatic Version Control Using Subversion</a>.</p>
<p>What I&#8217;m currently working on is a project on top of the <a href="http://www.symfony-project.com/">Symfony framework</a>. I found it easiest to start off with the <a href="http://www.symfony-project.com/content/download.html">sandbox</a> copy rather than linking in Symfony externally from the project. One hitch with this is that the Symfony CLI requires PEAR, which WAMP5 didn&#8217;t come with installed, and the included installer script didn&#8217;t work correctly (on Windows Vista at least). This <a href="http://pear.php.net/go-pear">go-pear</a> copy worked fine when run from the php directory of my WAMP installation.</p>
<p>When I do still need to transfer a file to a server that&#8217;s not under SVN control I&#8217;m back to the same software I used in 1996: WS_FTP LE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dangrossman.info/2006/12/20/php-development-environment/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
