<?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/"
	>

<channel>
	<title>@ramgad.com! &#187; php5</title>
	<atom:link href="http://www.ramgad.com/tag/php5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ramgad.com</link>
	<description>Patience is bitter, but its fruit is sweet. (Aristotle)</description>
	<pubDate>Sat, 03 Jan 2009 06:38:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing Debian Etch on rootserver</title>
		<link>http://www.ramgad.com/2008/05/25/installing-debian-etch-on-rootserver/</link>
		<comments>http://www.ramgad.com/2008/05/25/installing-debian-etch-on-rootserver/#comments</comments>
		<pubDate>Sun, 25 May 2008 21:32:18 +0000</pubDate>
		<dc:creator>Jeannot Muller</dc:creator>
		
		<category><![CDATA[linux]]></category>

		<category><![CDATA[operating systems]]></category>

		<category><![CDATA[apache2]]></category>

		<category><![CDATA[aptitude]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.ramgad.com/?p=103</guid>
		<description><![CDATA[The following document describes how to install debian etch server on a dedicated 1&#38;1 AMD 64-bit server.
Install minimal Debian Etch installation via 1&#38;1 fronted.
As no SSH control is yet installed, you have to connect via your terminal (e.g. putty, or Mac OS terminal). The string should look somehow like:
ssh u12345678@sercon.onlinehome-server.info.
Your password is the one you [...]]]></description>
			<content:encoded><![CDATA[<!-- sphereit start --><p>The following document describes how to install debian etch server on a dedicated 1&amp;1 AMD 64-bit server.</p>
<p>Install minimal Debian Etch installation via 1&amp;1 fronted.</p>
<p>As no SSH control is yet installed, you have to connect via your terminal (e.g. putty, or Mac OS terminal). The string should look somehow like:</p>
<pre class="syntax-highlight:bash">ssh u12345678@sercon.onlinehome-server.info.</pre>
<p>Your password is the one you provided on your 1&amp;1 Web-Frontend.<br />
Alternatively you can try if &#8217;ssh root@yourdomain.com&#8217; is already working, type in the password you set up in your web frontend during re-installation.</p>
<p>Update sources for aptitude</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude update
Get:1 http://update.onlinehome-server.info etch Release.gpg [378B]
Get:2 http://update.onlinehome-server.info etch/updates Release.gpg [189B]
Get:3 http://update.onlinehome-server.info etch Release [58.2kB]
Get:4 http://update.onlinehome-server.info etch/updates Release [37.6kB]
Get:5 http://update.onlinehome-server.info etch/main Packages [4210kB]
Get:6 http://update.onlinehome-server.info etch/contrib Packages [50.4kB]
Get:7 http://update.onlinehome-server.info etch/non-free Packages [63.7kB]
Get:8 http://update.onlinehome-server.info etch/main Sources [1214kB]
Get:9 http://update.onlinehome-server.info etch/contrib Sources [18.3kB]
Get:10 http://update.onlinehome-server.info etch/non-free Sources [28.2kB]
Get:11 http://update.onlinehome-server.info etch/updates/main Packages [255kB]
Get:12 http://update.onlinehome-server.info etch/updates/contrib Packages [3926B]
Get:13 http://update.onlinehome-server.info etch/updates/non-free Packages [1420B]
Get:14 http://update.onlinehome-server.info etch/updates/main Sources [41.0kB]
Get:15 http://update.onlinehome-server.info etch/updates/contrib Sources [1168B]
Get:16 http://update.onlinehome-server.info etch/updates/non-free Sources [1176B]
Fetched 5986kB in 5s (1155kB/s)
Reading package lists... Done</pre>
<p>Now let&#8217;s update for security reasons all packages (the files from 1&amp;1 are sometimes outdated)<br />
Output can look similar to the below dump:</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude upgrade
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done
Building tag database... Done
The following packages will be upgraded:
  libgnutls13 openssh-client openssh-server ssh
4 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1273kB of archives. After unpacking 28.7kB will be freed.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Get:1 http://update.onlinehome-server.info etch/updates/main libgnutls13 1.4.4-3+etch1 [315kB]
Get:2 http://update.onlinehome-server.info etch/updates/main openssh-server 1:4.3p2-9etch2 [246kB]
Get:3 http://update.onlinehome-server.info etch/updates/main openssh-client 1:4.3p2-9etch2 [712kB]
Get:4 http://update.onlinehome-server.info etch/updates/main ssh 1:4.3p2-9etch2 [1052B]
Fetched 1273kB in 0s (6401kB/s)
Preconfiguring packages ...
(Reading database ... 16424 files and directories currently installed.)
Preparing to replace libgnutls13 1.4.4-3 (using .../libgnutls13_1.4.4-3+etch1_amd64.deb) ...
Unpacking replacement libgnutls13 ...
Preparing to replace openssh-server 1:4.3p2-9etch1 (using .../openssh-server_1%3a4.3p2-9etch2_amd64.deb) ...
Unpacking replacement openssh-server ...
Preparing to replace openssh-client 1:4.3p2-9etch1 (using .../openssh-client_1%3a4.3p2-9etch2_amd64.deb) ...
Unpacking replacement openssh-client ...
Preparing to replace ssh 1:4.3p2-9etch1 (using .../ssh_1%3a4.3p2-9etch2_all.deb) ...
Unpacking replacement ssh ...
Setting up libgnutls13 (1.4.4-3+etch1) ...
Setting up openssh-client (4.3p2-9etch2) ...
Setting up openssh-server (4.3p2-9etch2) ...
Restarting OpenBSD Secure Shell server: sshd.
Setting up ssh (4.3p2-9etch2) ...
Debian:~#</pre>
<p>Let&#8217;s now install some basic programs, you&#8217;ll most likely use in your daily live with your Debian Etch Server and which are not installed by default:</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install mc zip unzip bzip2 screen vim rsync traceroute ftp lynx</pre>
<p>Automatic time updating is pure convenience these days and I suggest to install this packages as well (you&#8217;ll most probably get a hint that a similar package has to be de-installed - just confirm please)</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install ntp ntpdate</pre>
<p>Now is good moment to check your time settings: (in current versions it seems that basis configuration from 1&amp;1 is correct)</p>
<pre class="syntax-highlight:bash">Debian:~# tzconfig
Your current time zone is set to Europe/Berlin
Do you want to change that? [n]: n
Your time zone will not be changed</pre>
<p>Install SSH (for Secure Shell Access, if not yet installed</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install ssh</pre>
<p>Security is a must, let&#8217;s now finally change root password</p>
<pre class="syntax-highlight:bash">Debian:~# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully</pre>
<p>Let&#8217;s now add a new user:</p>
<pre class="syntax-highlight:bash">Debian:~# adduser jsmith
Adding user `jsmith&#039; ...
Adding new group `jsmith&#039; (1000) ...
Adding new user `jsmith&#039; (1000) with group `jsmith&#039; ...
Creating home directory `/home/jsmith&#039; ...
Copying files from `/etc/skel&#039; ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for jsmith
Enter the new value, or press ENTER for the default
	Full Name []: John Smith
	Room Number []: home
	Work Phone []: -
	Home Phone []: -
	Other []: -
Is the information correct? [y/N] y</pre>
<p>For security purposes I suggest you really perform following steps to avoid root access through SSH connection.<br />
It might be reasonable as well to change standard port number for even more security.<br />
Therefore we need to edit the configuration file:</p>
<pre class="syntax-highlight:bash">Debian:~# vi /etc/ssh/sshd_config</pre>
<p>Please make the following changes:</p>
<pre class="syntax-highlight:bash">Change Port 22 to something else i.e. 2444
Change PermitRootLogin from YES to NO</pre>
<p>Add the following 2 lines (please, don&#8217;t forget to replace it by your user)</p>
<pre class="syntax-highlight:bash">AllowUsers jsmith
AllowGroups jsmith</pre>
<p>Major issue is that most people stop right here. You have to restart ssh services for the changes to work.<br />
Restarting OpenBSD Secure Shell server:</p>
<pre class="syntax-highlight:bash">Debian:~# /etc/init.d/ssh restart</pre>
<p>Now let&#8217;s exit</p>
<pre class="syntax-highlight:bash">Debian:~# exit</pre>
<p>the console and restart via ssh root@yourdomain.com.</p>
<p>You will get something like:</p>
<pre class="syntax-highlight:bash">ssh: connect to host yourdomain.com port 22: Connection refused</pre>
<p>as we did change the port number.</p>
<p>Please call you domain via:</p>
<pre class="syntax-highlight:bash">ssh root@yourdomain.com -p yourportnumber</pre>
<p>Still getting an error like: Permission denied, please try again.<br />
? Well yes, we have limited access to our user jsmith. So all our security initiatives seem to work, now let&#8217;s hope that the following command will work:</p>
<pre class="syntax-highlight:bash">ssh jmsith@yourdomain.com -p yourportnumber</pre>
<p>Gotcha! Well, you&#8217;re not perfectly secure yet but more secure than most people with a dedicated server.</p>
<p>Don&#8217;t forget that you have to type from now on:</p>
<pre class="syntax-highlight:bash">Debian:~# su (and typing in root password to get root rights)</pre>
<p>Well done, now let&#8217;s continue to install some software, where I&#8217;m sure you want to use it (apache2, mysql, php5, etc.):</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install apache2 libapache2-mod-php5 php5-cli php5-common php5-cgi</pre>
<p>After this you should be able to see &#8220;It works!&#8221; by typing www.yourdomain.com into your webbrowser.</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install mysql-common mysql-server mysql-server-5.0</pre>
<p>Now I suggest to immediately set a new password to your mysql-root user:</p>
<pre class="syntax-highlight:bash">Debian:~# mysqladmin -u root -p password &#039;MyNewPassword&#039;</pre>
<p>You&#8217;ll be prompted for a password. Just hit ENTER, as the initial password from the installation is empty!! Please be aware that you don&#8217;t have to retype the password, there is no further check, so please be careful to remind your settings!</p>
<p>Most probably you have more room on your home drive than on /var/</p>
<p>Let&#8217;s move your www directory to your home directory and make a soft link to it (so the system will not see any difference):</p>
<pre class="syntax-highlight:bash">Debian:~# mv www /home/jsmith/
Debian:~# ln -s /home/jsmith/www/ www</pre>
<p>Let&#8217;s install webmin (especially in the case that you&#8217;re not yet a linux guru). Watch www.webmin.com for the latest release and the correct link.</p>
<pre class="syntax-highlight:bash">Debian:~# cd /tmp
Debian:~# wget http://switch.dl.sourceforge.net/sourceforge/webadmin/webmin_1.410_all.deb
Debian:~# dpkg -i webmin_1.410_all.deb</pre>
<p>The system found a lot of dependencies which you will now solve and finally install webmin with:</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install webmin</pre>
<p>The systems will tell you after installation how to log in.</p>
<p>First thing you should do is creating a user (i.e. jsmith) with all rights - log off (as you can not delete yourself) - and login with this new user, then please delete root user immediately.</p>
<p>We need to change /etc/apache2/sites-available/default</p>
<pre class="syntax-highlight:bash">Debian:~# vi /etc/apache2/sites-available/default</pre>
<p>add the &#8216;#&#8217; sign before RedirectMatch &#8230;<br />
and change &#8216;AllowOverride None&#8217; to &#8216;AllowOverride All&#8217;<br />
After having restart your server, apache will read the files in your /home/jsmith/www directory.<br />
Before you should enable apache2 module re_write.</p>
<pre class="syntax-highlight:bash">Debian:~# a2enmod rewrite</pre>
<pre class="syntax-highlight:bash">Debian:~# /etc/init.d/apache2 restart</pre>
<p>Most probably you want to have php5 support on your mysql database (i.e. for Wordpress)</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install php5-mysql</pre>
<p>Now we need some changes on the php.ini</p>
<pre class="syntax-highlight:bash">Debian:~# vi /etc/php5/apache2/php.ini</pre>
<p>change &#8216;upload_max_filesize = 2M&#8217; to &#8216;upload_max_filesize = 20M&#8217;<br />
change &#8216;post_max_size = 8M&#8217;       to &#8216;post_max_size = 20M&#8217;<br />
change &#8216;memory_limit = 16M &#8216;      to &#8216;memory_limit = 64M&#8217;<br />
change &#8216;expose_php = On&#8217;          to &#8216;expose_php = Off&#8217;</p>
<p>Now you should restart your apache2 and forcing to reload all new values:</p>
<pre class="syntax-highlight:bash">Debian:~# /etc/init.d/apache2 force-reload</pre>
<p>You should now be able to install whatever web application you want. Often you need mod_rewrite on apache2 enabled.</p>
<p>What we are still missing is the FTP Server:</p>
<pre class="syntax-highlight:bash">Debian:~# aptitude install
Debian:~# cp /bin/false /bin/ftp
Debian:~# echo &quot;/bin/ftp&quot; &gt;&gt; /etc
Debian:~# addgroup ftpuser
Debian:~# usermod -G ftpuser jsmith</pre>
<p>Configure settings</p>
<pre class="syntax-highlight:bash">Debian:~# vi /etc/proftpd/proftpd.conf</pre>
<p>add the following at the end of this file</p>
<pre class="syntax-highlight:bash">DenyGroup !ftpuser !jsmith
RootLogin off
RequireValidShell on

UseReverseDNS off
IdentLookups off

change UseIPv6 from &#039;On&#039; to &#039;Off&#039;</pre>
<p>Restart Server</p>
<pre class="syntax-highlight:bash">Debian:~# /etc/init.d/proftpd restart</pre>
<!-- sphereit end --><span style="margin-bottom:40px; border-bottom:none;"><a class="iconsphere" title="Sphere: Related Content" onclick="return Sphere.Widget.search('http://www.ramgad.com/2008/05/25/installing-debian-etch-on-rootserver/')" href="http://www.sphere.com/search?q=sphereit:http://www.ramgad.com/2008/05/25/installing-debian-etch-on-rootserver/">Sphere: Related Content</a></span><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.ramgad.com/2008/05/25/installing-debian-etch-on-rootserver/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
