<?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>Web Development Blog &#187; linux</title>
	<atom:link href="http://www.web-development-blog.com/archives/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-development-blog.com</link>
	<description>Web development tutorials, SEO articles and PHP script resources</description>
	<lastBuildDate>Sun, 25 Jul 2010 14:38:00 +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>Start a hosting business with DirectAdmin</title>
		<link>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/</link>
		<comments>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 07:32:53 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[dedicated server]]></category>
		<category><![CDATA[directadmin]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=1172</guid>
		<description><![CDATA[There are thousands of hosting companies on the Internet and maybe this article will help you to start your own. Many companies offering web services are hosting reseller of other (bigger) companies or have partnerships with hosting companies. Maybe you have ever thought to offer hosting services by yourself, with a dedicated server or a [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><p>There are thousands of hosting companies on the Internet and maybe this article will help you to start your own. Many companies offering web services are hosting reseller of other (bigger) companies or have partnerships with hosting companies. Maybe you have ever thought to offer hosting services by yourself, with a dedicated server or a VPS hosting account, it&#8217;s very easy to offer hosting plans for your existing customers. The following article will show you, using a few examples, how to use a web server installed with the software DirectAdmin to create web hosting accounts using their native API system.</p>
<blockquote><p>Don&#8217;t think it&#8217;s easy to pull a new hosting company from the ground. This market is very saturated and we suggest to start offering hosting services most of all to your existing customers only.</p></blockquote>
<h3>VPS hosting versus dedicated server hosting</h3>
<p>These days it&#8217;s not necessary to have your own dedicated server, a good maintained VPS host is often much more reliable. If the VPS hosting platform is well managed, you don&#8217;t have to worry about the shared memory because the virtualization software is able to manage all the resources. Why do you need a dedicated server if a VPS is so powerful? You need your own server for special hardware configurations or if your provider doesn&#8217;t have a good VPS platform. While many VPS companies using the same machines, the risk of hardware failures is low because hardware replacements should be a peace of cake. A &#8220;special&#8221; dedicated or colocated server might be a serious risk, f.e if the motherboard replacement is not available. <strong>A VPS host is scalable and often much cheaper than a dedicated server.<br />
</strong><span id="more-1172"></span></p>
<h3>Web Server Control Panel</h3>
<p>Using a control panel, makes it easy to create or maintain all the web hosting accounts for your customers. Sure as a Linux expert you don&#8217;t need a CP, but if you core business is web development, a control panel might really help. There are many of them, most of them are commercial products, but there are also a a few open source projects which are available for free. In this blog post we suggest to use <a href="http://www.directadmin.com/" rel="nofollow">DirectAdmin</a>, because this software is easy to use, the license is not very expensive and there is also a very powerful API system.</p>
<h3>Installing DirectAdmin</h3>
<p>After you got your VPS (or dedicated server) you&#8217;re ready to install the server software. Before you start the installation process check these DirectAdmin requirements. Most important is that your Linux server is not pre-installed with software like Apache, MySQL, PHP, FTP&#8230; check this warning from the DA website:</p>
<blockquote><p>***Please do not install services such as Apache, PHP, MySQL, Ftp, Sendmail, etc., as we will do this for you.  All we need is a CLEAN install of your operating system.***<br />
We do not recommend installing DirectAdmin on an existing live production server.<br />
DirectAdmin does not convert existing data upon install. </p></blockquote>
<p>For most DirectAdmin hosts CentOS is the preferred Linux operating system. You need also a DirectAdmin license, ask your VPS hosting provider, he can offer the license for a low fee. </p>
<p><strong>DirectAdmin installation resources:</strong></p>
<ul>
<li><a href="http://www.directadmin.com/install.html" rel="nofollow">Getting Started with DirectAdmin: What kind of server do I need?</a></li>
<li><a href="http://www.directadmin.com/installguide.html" rel="nofollow">DirectAdmin Installation Guide</a></li>
</ul>
<p>The installation process is not part of this article. If you finished the installation part, you should check this <a href="http://www.web-development-blog.com/archives/how-to-setup-the-dns-and-name-server-for-a-directadmin-web-server/">DNS installation guide</a>. </p>
<h3>Creating hosting accounts</h3>
<p>After the final re-boot and your DirectAdmin server is running, you&#8217;re able to setup hosting accounts for your customers. You can create them by yourself using the DA control panel or using the DirectAdmin API within your web application. Think about the following application process:</p>
<ol>
<li>Customer has ordered a hosting accpunt from your website</li>
<li>The payment is cleared and a request is send the API system</li>
<li>Within DirectAdmin a hosting account is created</li>
<li>The customer gets the login and hosting accpunt details via e-mail</li>
</ol>
<p>How far you&#8217;re using this features of DA depends on yourself. The <a href="http://www.directadmin.com/api.html" rel="nofollow">DirectAdmin API</a> is able to manage all functions you need. This way you&#8217;re able to create your own we application, without telling your customers that a control panel is used.</p>
<h3>Access the DirectAdmin API system</h3>
<p>The API documentation is very complete and easy to use even for less experienced developers. There is also a custom PHP class to access the API via a HTTP socket, <a href="http://files.directadmin.com/services/all/httpsocket/httpsocket.php" rel="nofollow">download the code here</a>.</p>
<p>Using this PHP class is very easy, the following code is used to fetch all the user accounts from a reseller/admin account:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'httpsocket.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTPSocket<span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'some.server.com'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/CMD_API_SHOW_USERS'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// shows the result in the browser</span></pre></div></div>

<p>Next we show how-to add a new user to an existing reseller account (the package named &#8220;default&#8221; is a pre-defined hosting package):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">'httpsocket.php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTPSocket<span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'some.server.com'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2222</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_login</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'login'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/CMD_API_ACCOUNT_USER'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'create'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'add'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Submit'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'abcuser'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'email'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mail@domain.com'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'passwd'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123456'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'passwd2'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123456'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'domain'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'googles.com'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'package'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'ip'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'123.123.123.123'</span><span style="color: #339933;">,</span> 
	<span style="color: #0000ff;">'notify'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'yes'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_body</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// shows the result in the browser</span></pre></div></div>

<p>This API call is the same as creating a user from the web interface:</p>
<p><a href="http://www.web-development-blog.com/wp-content/uploads/2010/07/create_user.png" rel="shadowbox[post-1172];player=img;"><img src="http://www.web-development-blog.com/wp-content/uploads/2010/07/create_user-300x146.png" alt="" title="create_user" width="300" height="146" class="alignnone size-medium wp-image-1180" /></a></p>
<p>If you check all the API functions, you will see that it&#8217;s possible to create a 100% white labeled web application. Even if you don&#8217;t have that kind of web application, it&#8217;s very easy to create hosting accounts using the web interface on your DirectAdmin web server.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/how-to-setup-the-dns-and-name-server-for-a-directadmin-web-server/" rel="bookmark" title="September 17, 2007">How-to setup the DNS and name server for a DirectAdmin web server</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-custom-website-backups-using-cron/" rel="bookmark" title="October 17, 2009">Create custom website backups using CRON</a></li>
<li><a href="http://www.web-development-blog.com/archives/setting-up-an-internet-shopping-cart/" rel="bookmark" title="November 11, 2007">Setting up an Internet shopping cart</a></li>
</ul>
<p><!-- Similar Posts took 5.275 ms --></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/start-a-hosting-business-with-directadmin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Image manipulations with Imagemagick</title>
		<link>http://www.web-development-blog.com/archives/image-manipulations-with-imagemagick/</link>
		<comments>http://www.web-development-blog.com/archives/image-manipulations-with-imagemagick/#comments</comments>
		<pubDate>Tue, 05 May 2009 20:05:08 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[image manipulation]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=294</guid>
		<description><![CDATA[A very powerful tool for creating and manipulating images is ImageMagick. With this tools you can create drawings, modify existing images or just process images. The tool is available for Linux, windows and Mac based systems and is free available. Using the command line is Imagemagick the optimal tool to use image functions within your [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><p>A very powerful tool for creating and manipulating images is ImageMagick. With this tools you can create drawings, modify existing images or just process images. The tool is available for Linux, windows and Mac based systems and is free available. Using the command line is Imagemagick the optimal tool to use image functions within your script or application.</p>
<p>Use Imagemagick to watermark your images, to create fancy e-cards or just to convert images into other formats. Basic operations are very easy like</p>
<p><code>convert resize 50% image.jpg new.png</code></p>
<p>This simple command will resize your jpg image and safe a copy as some new image in .png format. Just imagine how much code you need with the GD library. As a webmaster you will find ImageMagick with most of the web hosting accounts.</p>
<p><a rel="nofollow" href="http://www.packtpub.com/imagemagick/book/mid/3009085ym5z4" target="_blank"><img class="alignleft" style="margin-left: 5px; margin-right: 5px;" title="ImageMagick Tricks" src="http://images.packtpub.com/images/100x123/1904811868.png" alt="" width="97" height="123" /></a>Check Google if you need example code and resources. If you can’t find the information you should try the book &#8220;<a rel="nofollow" href="http://www.packtpub.com/imagemagick/book/mid/3009085ym5z4" target="_blank">ImageMagick tips and tricks</a>&#8220;. This book full of information and tutorials is a good start to learn all basic functions of this powerful tool.</p>
<p>Inside the book you find instructions how to install ImageMagick on different platform and there also basic instructions on how-to install additional fonts. If you’re interested in this feature you should read <a rel="nofollow" href="http://russia.shaps.hawaii.edu/software/add-to-im.html" target="_blank">this article</a> too.</p>
<p>You will find real word examples for each command line tool. Each function has a few lessons of each chapter to train each function with a real world example:<span id="more-294"></span></p>
<h3>Convert and mogrify</h3>
<p>Both functions are used for transformations, while the convert creates a new image is the mogrify function used to change existing images. For examples:</p>
<p>crop an existing image and safe a cropped new version<br />
<code>convert sample.png crop 110x70+60+50  cropped.jpg</code></p>
<p>draw a line on white background inside a new image<br />
<code>mogrify size 80x100 xcwhite draw 'line 10,10 70,90' line.bmp</code></p>
<h3>Composite and montage</h3>
<p>These both functions are used to group or assemble multiple image sequences together like:</p>
<p>Mask an existing logo image with some background and safe it into the result image<br />
<code>composite -compose CopyOpacity logo_mask.png background.png result.png</code></p>
<p>Other functions like identify, display, import and conjure are explained too, check the book or the IM website for more information.</p>
<p>The book is written to use ImageMagick with php. Use above tools in your PHP code like:</p>
<p><code>$command = 'convert example.jpg new.png';<br />
exec($command);</code></p>
<p>Instead of the PHP function exec it’s also possible to process the commands with functions like system, passthru or shell_exec.</p>
<p>After you got all the basic lessons you get some more practice:</p>
<ul>
<li>How to call ImageMagick Command-line Utilities within PHP code</li>
<li>How to Save the Result of an Online Image Processing Task</li>
<li>How to Start Sessions for our Visitors</li>
<li>Building a Confirmation-Code Box</li>
<li>Online Image Water Marking</li>
<li><strong>A complete E-card application</strong><br />
Learn how to add different text styles to your e-cards. The tutorial includes the complete code for the following features:</p>
<ul>
<li>Image gallery</li>
<li>Image upload / remote copy</li>
<li>custom text for the e-cards</li>
<li>fomat text on images</li>
<li>send the finished  e-card by e-mail</li>
</ul>
</li>
</ul>
<p>While reading the book you should check <a rel="nofollow" href="http://www.packtpub.com/support/book/imagemagick" target="_blank">this page</a> for example code, screenshots and additional information. If you’re not sure if this book is written for you try this <a rel="nofollow" href="http://www.packtpub.com/files/ImageMagick-Convert-and-Mogrify-Sample-Chapter.pdf" target="_blank">example chapter</a>. The book was released in 2006 but is still &#8220;compatible&#8221; with current version of ImageMagick.</p>
<h3>More ImageMagick resources</h3>
<ul>
<li><a href="http://www.imagemagick.org/script/index.php">The ImageMagick homepage</a></li>
<li><a href="http://www.imagemagick.org/Usage/">Examples of ImageMagick Usage</a></li>
<li><a href="http://valokuva.org/?cat=1"><strong>Imagick</strong> PHP code tutortials</a></li>
</ul>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/best-methods-to-optimize-jpeg-images-for-websites/" rel="bookmark" title="March 22, 2010">Best methods to optimize JPEG images for websites</a></li>
<li><a href="http://www.web-development-blog.com/archives/database-management-with-phpmyadmin/" rel="bookmark" title="May 12, 2008">Database Management with phpMyAdmin</a></li>
<li><a href="http://www.web-development-blog.com/archives/css-navigation-bar-with-stylish-web2-0-elements/" rel="bookmark" title="February 27, 2007">CSS navigation bar with stylish web2.0 elements</a></li>
</ul>
<p><!-- Similar Posts took 3.713 ms --></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/image-manipulations-with-imagemagick/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->