<?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>Winnipeg Linux Support and Consulting &#124; ONE ROOT</title>
	<atom:link href="http://www.oneroot.ca/feed" rel="self" type="application/rss+xml" />
	<link>http://www.oneroot.ca</link>
	<description>Linux Support and Consulting in Winnipeg</description>
	<lastBuildDate>Fri, 25 Sep 2009 03:26:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install Apache with PHP and MySQL on Fedora</title>
		<link>http://www.oneroot.ca/web-servers/apache/install-apache-with-php-and-mysql-on-fedora</link>
		<comments>http://www.oneroot.ca/web-servers/apache/install-apache-with-php-and-mysql-on-fedora#comments</comments>
		<pubDate>Fri, 25 Sep 2009 02:53:52 +0000</pubDate>
		<dc:creator>avatar</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.oneroot.ca/?p=225</guid>
		<description><![CDATA[Fedora use yum as it&#8217;s repository to handle dependencies and binary install all of the required packages.

&#160;
1. First we will install Apache  (HTTP daemon), with PHP and MySQL, plus the PHP component which allows it to access MySQL.
Open your terminal located in the applications menu on the Fedora desktop and execute:

    [...]]]></description>
			<content:encoded><![CDATA[<p>Fedora use <strong>yum</strong> as it&#8217;s repository to handle dependencies and binary install all of the required packages.<br />
<span id="more-225"></span><br />
&nbsp;<br />
1. First we will install <strong>Apache </strong> (HTTP daemon), with PHP and <a href="http://en.wikipedia.org/wiki/Mysql">MySQL</a>, plus the PHP component which allows it to access MySQL.<br />
Open your terminal located in the applications menu on the <a href="http://en.wikipedia.org/wiki/Fedora_%28operating_system%29">Fedora</a> desktop and execute:</p>
<pre>
     yum -y install httpd php mysql mysql-server php-mysql
</pre>
<p>&nbsp;<br />
2. Configure the daemons to start automatically after server restart</p>
<pre>
     chkconfig httpd on
     chkconfig mysqld on
</pre>
<p>start them now</p>
<pre>
     service httpd start
     service mysqld start
</pre>
<p>&nbsp;<br />
3. Very important to set up the <strong>MySQL root account</strong> password. Without it, anyone on the server can login to MySQL as database root. The MySQL root account is not the same system root account that we know.<br />
From the security perspective it is better to give it a different password from one we have for our system root account.</p>
<pre>

     mysqladmin -u root password 'new-password'
     // quotes are required
</pre>
<p>&nbsp;<br />
4. Here is an additional security related changes for MySQL.</p>
<pre>
     mysql -u root -p
     // login

     mysql> DROP DATABASE test;
     // delete the test database, we don't need it at all
     mysql> DELETE FROM mysql.user WHERE user = '';
     // removes anonymous user access
     mysql> FLUSH PRIVILEGES;
     // reset privilegies
</pre>
<p>&nbsp;<br />
5. the HTTP root folder after the default Fedora Apache installation is /var/www/html/<br />
Let&#8217;s create a script to make shore that PHP is working.<br />
write the folowing line to the file with any text editor,<br />
save it as index.php and place it in the document root /var/www/html/</p>
<pre>
     <?=  phpinfo(); ?>
</pre>
<p>now open your browser on the server and go to http://localhost to check it out.</p>
<p>6. To create MySQL database and MySQL user for it, that you can use for PHP scripts.<br />
execute the following in the MySQL terminal</p>
<pre>

     mysql> CREATE DATABASE my_db;
     mysql> GRANT ALL PRIVILEGES ON my_db.* TO 'myuser'@'localhost' IDENTIFIED BY 'password';
     // the GRANT statement will create a new MySQL user account.
</pre>
<p>Feel free to contact us in case of any support required.<br />
Good Luck</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneroot.ca/web-servers/apache/install-apache-with-php-and-mysql-on-fedora/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struggle with DDOS and DOS at nginx level</title>
		<link>http://www.oneroot.ca/web-servers/nginx/struggle-with-ddos-and-dos-at-nginx-level</link>
		<comments>http://www.oneroot.ca/web-servers/nginx/struggle-with-ddos-and-dos-at-nginx-level#comments</comments>
		<pubDate>Fri, 21 Aug 2009 18:49:34 +0000</pubDate>
		<dc:creator>avatar</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[DOS and DDOS]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://www.oneroot.ca/?p=212</guid>
		<description><![CDATA[FreeBSD, network card: Intel fxp, port: 100Мбит, polling, http accept-filter.
&#160;

   in sysctl:
           sysctl kern.maxfiles=90000
           sysctl kern.maxfilesperproc=80000
           sysctl net.inet.tcp.blackhole=2
      [...]]]></description>
			<content:encoded><![CDATA[<p>FreeBSD, network card: Intel fxp, port: 100Мбит, polling, http accept-filter.<span id="more-212"></span></p>
<p>&nbsp;</p>
<pre>
   in sysctl:
           sysctl kern.maxfiles=90000
           sysctl kern.maxfilesperproc=80000
           sysctl net.inet.tcp.blackhole=2
           sysctl net.inet.udp.blackhole=1
           sysctl kern.polling.burst_max=1000
           sysctl kern.polling.each_burst=50
           sysctl kern.ipc.somaxconn=32768
           sysctl net.inet.tcp.msl=3000
           sysctl net.inet.tcp.maxtcptw=40960
           sysctl net.inet.tcp.nolocaltimewait=1
           sysctl net.inet.ip.portrange.first=1024
           sysctl net.inet.ip.portrange.last=65535
           sysctl net.inet.ip.portrange.randomized=0
</pre>
<p>&nbsp;</p>
<p>in <strong>nginx</strong> configuration:<br />
&nbsp;</p>
<pre>
           worker_processes 1;
           worker_rlimit_nofile 80000;
           events {
               worker_connections 50000;
           }

           server_tokens off;
           log_format IP `$remote_addr';
           reset_timedout_connection on;

           listen  xx.xx.xx.xx:80  default rcvbuf=8192 sndbuf=16384 backlog=32000 accept_filter=httpready;
</pre>
<p>&nbsp;</p>
<p>In the following way it is possible to realize filtration of url, in example for POST<br />
index.php?action=login which is with empty referral.</p>
<p>&nbsp;</p>
<pre>
           set $add 1;
           location /index.php {
                   limit_except GET POST {
                        deny all;
               }
               set $ban "";
               if ($http_referer = "" ) {set $ban $ban$add;}
               if ($request_method = POST ) {set $ban $ban$add;}
               if ($query_string = "action=login" ){set $ban $ban$add;}
               if ($ban = 111 ) {
                   access_log /var/log/[133]nginx/ban IP;
                   return 404;
               }
               proxy_pass http://127.0.0.1:8000; #here is a patch
           }
</pre>
<p>&nbsp;</p>
<p>Further we cut it at pf level &#8211; loaded into IP table, hosts from which came too many hits.<br />
PF with tables works very quickly. Sources for parsing of logs (ddetect) you can find on  http://www.comsys.com.ua/files<br />
Then Cron used once in a minute, to add into ip tables new IPs from a log.<br />
25 Mbyte DDoS, which cuts IPs, the rests fall on nginx which by it is criterion pass IPs and the rests passed on the apache &#8211; LA 0, site works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oneroot.ca/web-servers/nginx/struggle-with-ddos-and-dos-at-nginx-level/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
