<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Sciencefox Q&amp;A - Where Science man fail - Recent questions and answers</title>
<link>http://www.sciencefox.com/qa</link>
<description>Powered by Question2Answer</description>
<item>
<title>Answered: How can I flush DNS on Windows 7?</title>
<link>http://www.sciencefox.com/52/how-can-i-flush-dns-on-windows-7#a53</link>
<description>

&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;div&gt;
	&lt;span style=&quot;font-family:verdana,geneva,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;C:\&amp;gt;ipconfig /flushdns&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;font-family:verdana,geneva,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;Windows IP Configuration&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;


&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;


&lt;div&gt;
	&lt;span style=&quot;font-family:verdana,geneva,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:14px;&quot;&gt;Successfully flushed the DNS Resolver Cache.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description>
<category>Windows 7</category>
<guid isPermaLink="true">http://www.sciencefox.com/52/how-can-i-flush-dns-on-windows-7#a53</guid>
<pubDate>Mon, 17 Oct 2011 20:00:02 +0000</pubDate>
</item>
<item>
<title>Answered: How can I see my disk space or drive information in Linux?</title>
<link>http://www.sciencefox.com/44/how-can-i-see-my-disk-space-or-drive-information-in-linux#a51</link>
<description>

&lt;p&gt;
	For more readability you can use:&lt;/p&gt;


&lt;ul&gt;
	

&lt;li&gt;
		&lt;span style=&quot;font-size:14px;&quot;&gt;&lt;span style=&quot;font-family:verdana,geneva,sans-serif;&quot;&gt;df -h&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/44/how-can-i-see-my-disk-space-or-drive-information-in-linux#a51</guid>
<pubDate>Sun, 16 Oct 2011 05:40:21 +0000</pubDate>
</item>
<item>
<title>Answered: How can I view the running processes on a Linux system?</title>
<link>http://www.sciencefox.com/48/how-can-i-view-the-running-processes-on-a-linux-system#a50</link>
<description>Issue comand &amp;quot;ps aux&amp;quot;.</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/48/how-can-i-view-the-running-processes-on-a-linux-system#a50</guid>
<pubDate>Sat, 15 Oct 2011 17:30:04 +0000</pubDate>
</item>
<item>
<title>Answered: How do I delete a large directory in Windows?</title>
<link>http://www.sciencefox.com/45/how-do-i-delete-a-large-directory-in-windows#a46</link>
<description>

&lt;p&gt;
	You can do it using the Command Prompt:&lt;/p&gt;


&lt;ul&gt;
	

&lt;li&gt;
		&lt;span style=&quot;font-size:14px;&quot;&gt;&lt;span style=&quot;font-family:verdana,geneva,sans-serif;&quot;&gt;rd /s /q folder_name&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
<category>Windows XP</category>
<guid isPermaLink="true">http://www.sciencefox.com/45/how-do-i-delete-a-large-directory-in-windows#a46</guid>
<pubDate>Sat, 15 Oct 2011 07:13:46 +0000</pubDate>
</item>
<item>
<title>Answered: How can i see running services and runlevels in Centos ?</title>
<link>http://www.sciencefox.com/42/how-can-i-see-running-services-and-runlevels-in-centos#a43</link>
<description>

&lt;p&gt;
	The easiest way is by issuing the command &lt;strong&gt;&lt;code&gt;chkconfig --list&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/42/how-can-i-see-running-services-and-runlevels-in-centos#a43</guid>
<pubDate>Thu, 13 Oct 2011 14:14:18 +0000</pubDate>
</item>
<item>
<title>Answered: How can i make a 301 redirect?</title>
<link>http://www.sciencefox.com/40/how-can-i-make-a-301-redirect#a41</link>
<description>The most simple way is by adding the following line into the .htaccess file :&lt;br /&gt;
&lt;br /&gt;
Redirect 301 / &lt;A HREF=&quot;http://your-new-site.com/&quot; rel=&quot;nofollow&quot;&gt;http://your-new-site.com/&lt;/A&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/40/how-can-i-make-a-301-redirect#a41</guid>
<pubDate>Tue, 11 Oct 2011 17:35:50 +0000</pubDate>
</item>
<item>
<title>Answered: How can i install OpenVPN on Linux</title>
<link>http://www.sciencefox.com/38/how-can-i-install-openvpn-on-linux#a39</link>
<description>

&lt;p&gt;
	&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;strong&gt;OpenVPN with TAP0 interface &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;&lt;strong&gt;SERVER CONFIG&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	1. First we install the package using : &lt;strong&gt;#yum install openvpn&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Then we give : &lt;strong&gt;#cd /usr/share/openvpn/easy-rsa/2.0&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	In this directory we execute the commands :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#sh vars&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;#sh clean-all source vars&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;#sh build-ca&lt;/strong&gt; - generates certificate authority
&lt;br&gt;
	&lt;strong&gt;#sh build-key-server server&lt;/strong&gt; -it generates the server key
&lt;br&gt;
	&lt;strong&gt;#sh build-key client1&lt;/strong&gt; - generates the certificate and keys for one client, client1
&lt;br&gt;
	&lt;strong&gt;#sh build-dh&lt;/strong&gt; - generates Diffie Helman parameters&lt;/p&gt;


&lt;p&gt;
	After those commands, in /usr/share/openvpn/easy-rsa/2.0/keys/ directory we will have the following files :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;01,02.pem&lt;/em&gt;
&lt;br&gt;
	&lt;em&gt;ca.crt&lt;/em&gt; - Root CA certificate
&lt;br&gt;
	&lt;em&gt;ca.key&lt;/em&gt; - Root CA key
&lt;br&gt;
	&lt;em&gt;client1.crt&lt;/em&gt; - Client1 Certificate
&lt;br&gt;
	&lt;em&gt;client1.csr&lt;/em&gt; - Client1 Certificate Signing Request
&lt;br&gt;
	&lt;em&gt;client1.key&lt;/em&gt;- Client1 Key
&lt;br&gt;
	&lt;em&gt;dh1024.pem&lt;/em&gt; - Diffie Hellman parameters
&lt;br&gt;
	&lt;em&gt;server.crt&lt;/em&gt; - Server Certificate
&lt;br&gt;
	&lt;em&gt;server.csr&lt;/em&gt; - Server Certificate Signing Request
&lt;br&gt;
	&lt;em&gt;server.key&lt;/em&gt; - Server Key&lt;/p&gt;


&lt;p&gt;
	From this files, on the client machine we must copy : &lt;em&gt;ca.crt ; client1.crt ; client1.key&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	Let us consider that : a.b.c.0 = VPN private class (ex 172.16.0.0)
&lt;br&gt;
	e.f.g.0 = company LAN private class (ex 192.168.0.0)&lt;/p&gt;


&lt;p&gt;
	3. Now we must edit the configuration file - &lt;em&gt;server.conf&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	If in /etc/openvpn we do not find server.conf, we will copy it from din usr/share/doc/openvpn-2.1.1/sample-config-files&lt;/p&gt;


&lt;p&gt;
	Then in this file we must check the followings :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;dev tap
&lt;br&gt;
	server a.b.c.0 255.255.255.0 - VPN private class - MUST be different than LAN class
&lt;br&gt;
	push &quot;route e.f.g.0 255.255.255.0&quot; - the server lan
&lt;br&gt;
	client-to-client&lt;/em&gt;
&lt;br&gt;
	&lt;em&gt;;certificate paths
&lt;br&gt;
	ca ca.crt
&lt;br&gt;
	cert server.crt
&lt;br&gt;
	key server.key
&lt;br&gt;
	dh dh1024.pem&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	*the easiest way is to copy those files from /usr/share/openvpn/easy-rsa/2.0 to /etc/openvpn/&lt;/p&gt;


&lt;p&gt;
	4. Then on the gateway machine we must add an route to route the VPN subnet (172.16.0.0) to the LAN&amp;nbsp; ip of the OpenVPN server. This is necessary only if the VPN server and the gateway are on different machines.&lt;/p&gt;


&lt;p&gt;
	For doing this we have two options:&lt;/p&gt;


&lt;p&gt;
	a) on the gateway we add a route :#&lt;strong&gt;route add 172.16.0.0 mask 255.255.255.0 192.168.0.X&lt;/strong&gt; - 192.168.0.X lan ip of the server ; or
&lt;br&gt;
	b)&lt;strong&gt; &lt;/strong&gt;on the OpenVPN server machine we issue &lt;strong&gt;#iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -o eth0 -j MASQUERADE&lt;/strong&gt; - with this one we will not have ping reply from vpn clients, so the first line must be added too :)&lt;/p&gt;


&lt;p&gt;
	If we have a firewall in place we must give the following commands :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#iptables -A FORWARD -i tap0 -j ACCEPT
&lt;br&gt;
	#iptables -A INPUT -i tap+ -j ACCEPT
&lt;br&gt;
	#iptables -A FORWARD -i tap+ -j ACCEPT&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	If we want that VPN clients to access the internet through the VPN tunnel :&lt;/p&gt;


&lt;p&gt;
	-&amp;nbsp; in /etc/openvpn/server.conf we must uncheck :&lt;em&gt; push &quot;redirect-gateway def1 bypass-dhcp&quot;&lt;/em&gt;
&lt;br&gt;
	-&amp;nbsp; issue the following:# &lt;strong&gt;iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to xx.xx.xx.xx&lt;/strong&gt; - xx.xx.xx.xx =internal adress of gateway server (ex:19.168.0.1)
&lt;br&gt;
	(if the VPN was on GW machine , xx.xx.xx.xx = server routable/external IP)&lt;/p&gt;


&lt;p&gt;
	5. For OpenVPN to run at startup we issue : &lt;strong&gt;#chkconfig openvpn on&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. To start OpenVPN server : &lt;strong&gt;#service openvpn start&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&lt;em&gt;CLIENT CONFIG&lt;/em&gt; &lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	(we suppose that we run the client on Windows)&lt;/p&gt;


&lt;p&gt;
	In client.ovpn file we must have :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;client
&lt;br&gt;
	dev tap
&lt;br&gt;
	proto tcp
&lt;br&gt;
	remote ip_extern_server_vpn port
&lt;br&gt;
	ca \path\to\ca.crt
&lt;br&gt;
	ca \path\to\client1.crt
&lt;br&gt;
	ca \path\to\client1.key&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;OpenVPN with TAP0 bridge&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	For install we follow same steps as above.For configuring, we edit server.conf file, and make sure that we have&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;dev tap0
&lt;br&gt;
	;server 172.16.0.0 255.255.255.0 - this line must be commented
&lt;br&gt;
	server-bridge 192.168.0.X 255 255 255 0 192.168.0.Y 192.168.0.Z ; where: x- vpn server lan ip ; y-z ip range for vpn clients
&lt;br&gt;
	;push &quot;route 192.168.0.0 255.255.255.0&quot; - this line must be commented
&lt;br&gt;
	client-to-client
&lt;br&gt;
	;certificate path
&lt;br&gt;
	ca ca.crt
&lt;br&gt;
	cert server.crt
&lt;br&gt;
	key server.key&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	Then we check if we have bridge-utils by &lt;strong&gt;# yum install bridge-utils&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Then in /etc/openvpn we modify bridge-start file with the parameters of the server lan card, from &quot;&lt;strong&gt;# ifconfig eth0&lt;/strong&gt;&quot;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;eth=&quot;eth0&quot;
&lt;br&gt;
	eth_ip=&quot;&quot;
&lt;br&gt;
	eth_netmask=&quot;..&quot;
&lt;br&gt;
	eth_broadcast&quot;...&quot;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	After that we must make sure that we have a default route on the new bridge br0. &lt;em&gt;If not, there will be no response packets to the client connect request packets,so the client will not be able to connect.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;route add default gw 192.168.0.1 br0&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	If we have a firewall in place we must issue&amp;nbsp; :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#iptables -A INPUT -i tap0 -j ACCEPT
&lt;br&gt;
	#iptables -A INPUT -i br0 -j ACCEPT
&lt;br&gt;
	#iptables -A FORWARD -i br0 -j ACCEPT&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	The run/stop sequence :&lt;/p&gt;


&lt;p&gt;
	- run bridge-start script
&lt;br&gt;
	- run openvpn
&lt;br&gt;
	- stop openvpn
&lt;br&gt;
	- run bridge-stop script&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/38/how-can-i-install-openvpn-on-linux#a39</guid>
<pubDate>Tue, 11 Oct 2011 16:56:12 +0000</pubDate>
</item>
<item>
<title>Answered: How can i disable PIN code request on a modem ?</title>
<link>http://www.sciencefox.com/36/how-can-i-disable-pin-code-request-on-a-modem#a37</link>
<description>

&lt;p&gt;
	1. Connect your modem to PC and run HyperTerminal&lt;/p&gt;


&lt;p&gt;
	2. Issue command : &lt;strong&gt;AT&lt;/strong&gt; - response should be &lt;em&gt;&quot;OK&quot;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	3. Check if SIM card has pin with&amp;nbsp; : &lt;strong&gt;AT+CPIN?&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4. If the SIM has no pin, the reply should be : &lt;strong&gt;+CPIN: READY&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	5. If you have a PIN, you must enter :&lt;strong&gt; AT+CPIN=&quot;1111&quot;&lt;/strong&gt; , where 1111 is your current PIN&lt;/p&gt;


&lt;p&gt;
	6. To disable the PIN use :&lt;strong&gt; AT+CLCK=&quot;SC&quot;,0,&quot;1111&lt;/strong&gt;&quot; , where 1111 = your current PIN code&lt;/p&gt;


&lt;p&gt;
	7. The SIM will now have the PIN code disabled.&lt;/p&gt;</description>
<category>Networking</category>
<guid isPermaLink="true">http://www.sciencefox.com/36/how-can-i-disable-pin-code-request-on-a-modem#a37</guid>
<pubDate>Tue, 11 Oct 2011 16:48:37 +0000</pubDate>
</item>
<item>
<title>Answered: How can i make Intel PRO 1000 work on Untangle?</title>
<link>http://www.sciencefox.com/34/how-can-i-make-intel-pro-1000-work-on-untangle#a35</link>
<description>

&lt;p&gt;
	If you use &lt;a rel=&quot;nofollow&quot; href=&quot;http://www.untangle.com/&quot;&gt;Untangle&lt;/a&gt; in your network, and you have issues with Intel PRO 1000 cards, here is how to solve it :&lt;/p&gt;


&lt;p&gt;
	1. Login to your box as root&lt;/p&gt;


&lt;p&gt;
	2. To check if the system has detected your card, run &lt;strong&gt;&quot;lspci | grep Ethernet&quot;&lt;/strong&gt; and look for a line like this : &lt;em&gt;Ethernet controller: Intel Corporation 82574L Gigabit Network Connection&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	3.&lt;strong&gt; &lt;/strong&gt;Download latest drivers from Intel ,directly from &lt;a rel=&quot;nofollow&quot; href=&quot;http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&amp;amp;DwnldID=15817&quot;&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;
	4.&lt;strong&gt; &lt;/strong&gt;Add &quot;&lt;em&gt;deb http://ftp.us.debian.org/debian lenny main contrib non-free&quot;&lt;/em&gt; to your /etc/apt/sources.list.d file&lt;/p&gt;


&lt;p&gt;
	5. Run &lt;strong&gt;&quot;apt-get update&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. Run &lt;strong&gt;&quot;apt-get install untangle-development-build&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	7. Run&lt;strong&gt; &quot;apt-get install linux-headers-2.6.26-1-untangle-686&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	8. &lt;strong&gt;&quot;tar zxvf&quot;&lt;/strong&gt; the drivers from Intel into /usr/src/linux-headers-2.6.26-1-common-untangle/drivers/net/e1000e&lt;/p&gt;


&lt;p&gt;
	9. From there&amp;nbsp; run&lt;strong&gt; &quot;make install&quot;&lt;/strong&gt; . It will start the install, and then suddenly stop complaining about some error. But, ignore it, because just a few lines ahead, it compiled the &quot;e1000e.ko&quot; file that you need.&lt;/p&gt;


&lt;p&gt;
	10. Issue the following commands :
&lt;br&gt;
	&lt;strong&gt;rmmod e1000e&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;depmod -a&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;insmod /usr/src/linux-headers-2.6.26-1-common-untangle/drivers/net/e1000e/e1000e.ko&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	11. Log into Untangle web interface, then Config/Networking, and you should see your the new card.&lt;/p&gt;


&lt;p&gt;
	12. To maintain consistency after restart issue the following command :
&lt;br&gt;
	&lt;strong&gt;mkinitramfs -o /boot/initrd.img-2.6.26-1-untangle-686&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/34/how-can-i-make-intel-pro-1000-work-on-untangle#a35</guid>
<pubDate>Tue, 11 Oct 2011 16:47:32 +0000</pubDate>
</item>
<item>
<title>Answered: How can i change the root password in Debian Linux</title>
<link>http://www.sciencefox.com/32/how-can-i-change-the-root-password-in-debian-linux#a33</link>
<description>

&lt;h2&gt;
	&lt;a href=&quot;http://www.tutorialbit.com/debian-how-to-change-root-password/&quot; rel=&quot;bookmark nofollow&quot; title=&quot;Debian how to change root password&quot;&gt;how to change root password&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;
	In case that you forgot your root password, and you are using Debian Linux, here's what you can do (might work also on some other Linux flavors):&lt;/p&gt;


&lt;p&gt;
	1. On the grub boot prompt, press &lt;strong&gt;“e”&lt;/strong&gt; to enter edit mode&lt;/p&gt;


&lt;p&gt;
	2. Then go to the line that starts with &lt;em&gt;“kernel”&lt;/em&gt; and press &lt;strong&gt;“e”&lt;/strong&gt; again&lt;/p&gt;


&lt;p&gt;
	3. At the end of this line write&lt;strong&gt; “init=/bin/sh”&lt;/strong&gt; or &lt;strong&gt;“/bin/bash”&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4. After that press Enter to make that changes effective, and then and press &lt;strong&gt;“b”&lt;/strong&gt; to boot&lt;/p&gt;


&lt;p&gt;
	5. After the booting, at the # prompt issue the command :&lt;strong&gt; “mount -o remount rw /”&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. Finally type &lt;strong&gt;“passwd”&lt;/strong&gt; and change the root password&lt;/p&gt;


&lt;p&gt;
	7. To reboot, use &lt;strong&gt;“init 6”&lt;/strong&gt; or&lt;strong&gt; “reboot”&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/32/how-can-i-change-the-root-password-in-debian-linux#a33</guid>
<pubDate>Tue, 11 Oct 2011 16:44:30 +0000</pubDate>
</item>
<item>
<title>Answered: How can i rename home button in Wordpress ?</title>
<link>http://www.sciencefox.com/30/how-can-i-rename-home-button-in-wordpress#a31</link>
<description>

&lt;p&gt;
	If you want to change your WordPress blog &quot;Home&quot; button to a something more meaningful (for example, tutorials :) ) you can do it like this :&lt;/p&gt;


&lt;p&gt;
	1. On your server, go to&lt;em&gt; /location/of/your/wordpress/wp-content/themes/your-theme/header.php&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	2. Enter command :&lt;strong&gt; chmod 646 header.php&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. In WordPress Admin go to&amp;nbsp; &lt;em&gt;Appearance / Editor&lt;/em&gt; , from the left menu&lt;/p&gt;


&lt;p&gt;
	4. At upper right corner, be sure to have your theme selected&lt;/p&gt;


&lt;p&gt;
	5. Then, from categories on the right&amp;nbsp; click on&lt;em&gt; &quot; Header (header.php) &quot;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	6. Search for the term&lt;em&gt; &quot;home&quot;&lt;/em&gt; and you will find something like this :
&lt;br&gt;
	&lt;em&gt;&amp;lt;?php echo lw_homebtn(__('Home','lightword')); ?&amp;gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	7. Replace Home with another term that you want , and click Update&lt;/p&gt;


&lt;p&gt;
	8. Go to&lt;em&gt; /location/of/your/wordpress/wp-content/themes/your-theme/header.php&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	9. Return to header.php defaults : &lt;strong&gt;chmod 644 header.php&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/30/how-can-i-rename-home-button-in-wordpress#a31</guid>
<pubDate>Tue, 11 Oct 2011 16:41:43 +0000</pubDate>
</item>
<item>
<title>Answered: How can i change page order in Wordpress?</title>
<link>http://www.sciencefox.com/28/how-can-i-change-page-order-in-wordpress#a29</link>
<description>1. Log into WordPress Admin&lt;br /&gt;
&lt;br /&gt;
2. From the menu on the left go to Pages, put the mouse over a page name, then click Edit&lt;br /&gt;
&lt;br /&gt;
3. On the right, on the Page attributes tab assign a number to the &amp;quot;Order&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
4. Do the same for all pages.&lt;br /&gt;
&lt;br /&gt;
5. Pages will be sorted by the order number.</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/28/how-can-i-change-page-order-in-wordpress#a29</guid>
<pubDate>Tue, 11 Oct 2011 16:40:29 +0000</pubDate>
</item>
<item>
<title>Answered: PHP script for translation of multilingual website ?</title>
<link>http://www.sciencefox.com/26/php-script-for-translation-of-multilingual-website#a27</link>
<description>

&lt;p&gt;
	Let's say you have a bilingual site, in my case English and Romanian language.&lt;/p&gt;


&lt;p&gt;
	If your visitors want to jump to the translated version of the page that they are currently viewing, you can use a little php script that creates a link to a translated page.&lt;/p&gt;


&lt;p&gt;
	In my case the website was built like this :&lt;/p&gt;


&lt;p&gt;
	Romanian version page names : index.php, contact.php, services.php&lt;/p&gt;


&lt;p&gt;
	English version page names : index-en.php, contact-en.php, services-en.php&lt;/p&gt;


&lt;p&gt;
	So, all the script has to do, for changing the link from Romanian to English is to :&lt;/p&gt;


&lt;p&gt;
	1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get the name of the current page&lt;/p&gt;


&lt;p&gt;
	2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace .php ending name of the page&amp;nbsp; with -en.php&lt;/p&gt;


&lt;p&gt;
	3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Display the href link.&lt;/p&gt;


&lt;p&gt;
	The script – placed somewhere in the beginning of the page :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;function curPageName() {&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;return substr($_SERVER[&quot;SCRIPT_NAME&quot;],strrpos($_SERVER[&quot;SCRIPT_NAME&quot;],&quot;/&quot;)+1);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;}&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$string = curPageName();&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$patterns = '/.php/';&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$replacements = '-en.php';&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$eng_text = preg_replace($patterns, $replacements, $string);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	And now to show the link to the translated version of the page :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;a href=&quot;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;&lt;/em&gt;?php echo $eng_text; ?&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&amp;gt;&lt;/em&gt;&quot; title=&quot;English language&quot;&amp;gt;English version&amp;lt;/a&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Notice :&lt;/p&gt;


&lt;p&gt;
	-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; both pieces of the code must be in the same page.
&lt;br&gt;
	-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the page is a php page&lt;/p&gt;


&lt;p&gt;
	My website was buit like this for the Romanian part : &lt;strong&gt;index.php&lt;/strong&gt; contains the following code :
&lt;br&gt;
	&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;top.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;index_code.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;footer.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	In my case the php code is in the beginning of the index-code.php page, and the html code is near the end.&lt;/p&gt;


&lt;p&gt;
	For the English part of the site I have the following setup : &lt;strong&gt;index-en.php&lt;/strong&gt; contains :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;top-en.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;index_code-en.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;include (&quot;footer-en.php&quot;);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	To change the link from English pages to Romanian the code is like this :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;function curPageName() {&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;return substr($_SERVER[&quot;SCRIPT_NAME&quot;],strrpos($_SERVER[&quot;SCRIPT_NAME&quot;],&quot;/&quot;)+1);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;}&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$string = curPageName();&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$patterns = '/-en.php/';&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$replacements = '.php';&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;$ro_text = preg_replace($patterns, $replacements, $string);&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;?&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	And the line to add the link :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;&amp;lt;a href=&quot;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&amp;lt;&lt;/em&gt;?php echo $ro_text; ?&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&amp;gt;&lt;/em&gt;&quot; title=&quot;English language&quot;&amp;gt;English version&amp;lt;/a&amp;gt;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;Notice the name of the replaced string is changed : it's now called ro_text instead of eng_text.&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/26/php-script-for-translation-of-multilingual-website#a27</guid>
<pubDate>Tue, 11 Oct 2011 16:39:45 +0000</pubDate>
</item>
<item>
<title>Answered: Can somebody explain me how to use crontab in Linux</title>
<link>http://www.sciencefox.com/23/can-somebody-explain-me-how-to-use-crontab-in-linux#a24</link>
<description>

&lt;p&gt;
	Of course. Here is some tutorial about it.&lt;/p&gt;


&lt;p&gt;
	Each Linux user can have his own crontab, located in&amp;nbsp; &lt;em&gt;/var/spool/cron/crontabs&lt;/em&gt;. Those files must not be edited directly but through &lt;strong&gt;crontab -e&lt;/strong&gt; command&lt;/p&gt;


&lt;p&gt;
	A user cronjob looks like this&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;1 2 3 4 5 /path/to/command arg1 arg2&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	Where :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;1&lt;/em&gt; means&amp;nbsp; &lt;em&gt;minute&lt;/em&gt; (0-59)
&lt;br&gt;
	&lt;em&gt;2&lt;/em&gt; means &lt;em&gt;hours&lt;/em&gt; (0-23)
&lt;br&gt;
	&lt;em&gt;3&lt;/em&gt; means&amp;nbsp; &lt;em&gt;day&lt;/em&gt; (0-31)
&lt;br&gt;
	&lt;em&gt;4&lt;/em&gt; means&amp;nbsp; &lt;em&gt;month&lt;/em&gt; (0-12); 12=December
&lt;br&gt;
	&lt;em&gt;5&lt;/em&gt; means&amp;nbsp;&lt;em&gt; Day of the week&lt;/em&gt;(0-7); 7 or 0=Sunday
&lt;br&gt;
	&lt;em&gt;/path/to/command&lt;/em&gt; means&amp;nbsp; command to execute
&lt;br&gt;
	&lt;em&gt;arg1,arg2 &lt;/em&gt;= command arguments&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Example&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	If you wish to run script.sh every day at 10:00 am, your crontab should look like this&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;0 10 * * * /location/of/script.sh&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	An &lt;em&gt;operator&lt;/em&gt; allows you to specifying multiple values in a field. There are three operators:&lt;/p&gt;


&lt;p&gt;
	- &lt;em&gt;asterisk&lt;/em&gt; &lt;strong&gt;*&lt;/strong&gt; : specifies all possible values for a field. As&amp;nbsp; example, an asterisk in the hour field would mean &quot;every hour&quot;
&lt;br&gt;
	- &lt;em&gt;comma&lt;/em&gt; &lt;strong&gt;,&lt;/strong&gt; : operator specifies a list of values, like 2,3,10,20,40
&lt;br&gt;
	- &lt;em&gt;dash&lt;/em&gt; &lt;strong&gt;-&lt;/strong&gt; : specifies a range of values, for example: 6-9&amp;nbsp; days , which is equivalent to typing 6,7,8,9 using the comma operator.&lt;/p&gt;


&lt;p&gt;
	Usually when a cronjob is executed a mail is send to the MAILTO variable in the crontab file.&lt;/p&gt;


&lt;p&gt;
	If you want to disable mail sending you replace the default &lt;em&gt;MAILTO=root &lt;/em&gt;with&lt;em&gt; MAILTO=&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	If you want to disable mail sending for a particular job, you can add&lt;strong&gt; &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;/strong&gt; to the end of a job.&lt;/p&gt;


&lt;p&gt;
	Instead of using the five parameters for minute,hour,day, etc&amp;nbsp; you can use the special strings below&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;@reboot&lt;/strong&gt; = Run once, at startup.
&lt;br&gt;
	&lt;strong&gt;@yearly&lt;/strong&gt; = Run once a year, “0 0 1 1 *”.
&lt;br&gt;
	&lt;strong&gt;@annually&lt;/strong&gt; = (same as @yearly)
&lt;br&gt;
	&lt;strong&gt;@monthly&lt;/strong&gt; = Run once a month, “0 0 1 * *”.
&lt;br&gt;
	&lt;strong&gt;@weekly&lt;/strong&gt; = Run once a week, “0 0 * * 0″.
&lt;br&gt;
	&lt;strong&gt;@daily&lt;/strong&gt; = Run once a day, “0 0 * * *”.
&lt;br&gt;
	&lt;strong&gt;@midnight&lt;/strong&gt; = (same as @daily)
&lt;br&gt;
	&lt;strong&gt;@hourly&lt;/strong&gt; = Run once an hour, “0 * * * *”.&lt;/p&gt;


&lt;p&gt;
	To get crontab to run a task every 30 minutes you can type :
&lt;br&gt;
	&lt;strong&gt;*/30 * * * * /path/to/command&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Besides user crontab, edited with crontab -e you have also&lt;em&gt; /etc/crontab/&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	/etc/crontab is system crontabs file. It is used by root or daemons to configure system wide jobs. All other users must use crontab -e command as described above.&lt;/p&gt;


&lt;p&gt;
	Exemple /etc/crontab file :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;SHELL=/bin/bash
&lt;br&gt;
	PATH=/sbin:/bin:/usr/sbin:/usr/bin
&lt;br&gt;
	MAILTO=root
&lt;br&gt;
	HOME=/&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;# run-parts
&lt;br&gt;
	01 * * * * root run-parts /etc/cron.hourly
&lt;br&gt;
	02 4 * * * root run-parts /etc/cron.daily
&lt;br&gt;
	22 4 * * 0 root run-parts /etc/cron.weekly
&lt;br&gt;
	42 4 1 * * root run-parts /etc/cron.monthly&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	If you want to add here a script to run as root every 45 minutes you can add :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;*/30 * * * * root sh /path/to/script.sh&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Remeber&amp;nbsp; to press Enter after the last line, to put the cursor to a new line at the end of&amp;nbsp; the file .Otherwise, the last cronjob will not run.&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/23/can-somebody-explain-me-how-to-use-crontab-in-linux#a24</guid>
<pubDate>Tue, 11 Oct 2011 16:36:13 +0000</pubDate>
</item>
<item>
<title>Answered: How to install GeoIP for AWStats?</title>
<link>http://www.sciencefox.com/21/how-to-install-geoip-for-awstats#a22</link>
<description>

&lt;p&gt;
	1. Download GEOIP
&lt;br&gt;
	&lt;strong&gt;#wget http://search.cpan.org/pub/CPAN/authors/id/B/BO/BORISZ/Geo-IP-PurePerl-1.25.tar.gz&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Unzip it
&lt;br&gt;
	&lt;strong&gt;#tar -zxvf Geo-IP-PurePerl-1.25&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Install it
&lt;br&gt;
	&lt;strong&gt;#cd Geo-IP-PurePerl-1.25
&lt;br&gt;
	#perl Makefile.PL
&lt;br&gt;
	#make
&lt;br&gt;
	#make test&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	After&lt;em&gt; make test&lt;/em&gt; command, it will complain about the lack of GeoIP databases. So, let us install those :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#mkdir /usr/local/share/GeoIP
&lt;br&gt;
	#cd /usr/local/share/GeoIP
&lt;br&gt;
	#wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
&lt;br&gt;
	#wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
&lt;br&gt;
	#gunzip *&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Then, we must continue the installation of GeoIP&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#cd /to/the/directory/of/Geo-IP-PurePerl-1.25
&lt;br&gt;
	#make install&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4. Now we must tell AWStats about GeoIP databases location. Go to your&lt;em&gt; awstats.example.com.conf&lt;/em&gt; and &lt;em&gt;awstats.www.example.com.conf&lt;/em&gt; and modify/add :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#LoadPlugin=&quot;geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat&quot;
&lt;br&gt;
	#LoadPlugin=&quot;geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Besides that you can also enable a nice built-in awstats plugin, to get more information about the ip's that visit you..&lt;/p&gt;


&lt;p&gt;
	First you must issue the following commands:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#yum perl-Net-Whois-IP
&lt;br&gt;
	#yum perl-Net-XWhois&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Then, in awstats config files from above, you must uncomment the line
&lt;br&gt;
	&lt;strong&gt;LoadPlugin=&quot;hostinfo&quot;&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/21/how-to-install-geoip-for-awstats#a22</guid>
<pubDate>Tue, 11 Oct 2011 16:34:08 +0000</pubDate>
</item>
<item>
<title>Answered: Can somebody tell me how to install AWStats ?</title>
<link>http://www.sciencefox.com/19/can-somebody-tell-me-how-to-install-awstats#a20</link>
<description>

&lt;p&gt;
	Assuming that you have Centos 5.5, and Apache installed from source in /usr/local/apache&amp;nbsp; you can install awstats like this&lt;/p&gt;


&lt;p&gt;
	1.&amp;nbsp; Add the RPM Forge repository with
&lt;br&gt;
	&lt;strong&gt;rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Install AWStats
&lt;br&gt;
	&lt;strong&gt;yum install awstats&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Locate awstats.conf
&lt;br&gt;
	&lt;strong&gt;updatedb
&lt;br&gt;
	locate awstats.conf&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	It is possible for the yum installer to put the config&amp;nbsp; in /etc/httpd/conf.d/awstats.conf&lt;/p&gt;


&lt;p&gt;
	4. Move the config file&amp;nbsp; into /usr/local/apache/conf/extra/awstats.conf&lt;/p&gt;


&lt;p&gt;
	5. Be sure that all&amp;nbsp; awstats file are into your Apache root directory - in our example : /usr/local/apache/htdocs&lt;/p&gt;


&lt;p&gt;
	6. Edit the file awstats.conf according to your configuration&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Alias /awstats/icon/ /usr/local/apache/htdocs/awstats/icon/&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;ScriptAlias /awstats/ /usr/local/apache/htdocs/awstats/
&lt;br&gt;
	&amp;lt;Directory /usr/local/apache/htdocs/awstats/&amp;gt;
&lt;br&gt;
	DirectoryIndex awstats.pl
&lt;br&gt;
	Options ExecCGI
&lt;br&gt;
	order deny,allow
&lt;br&gt;
	allow from all
&lt;br&gt;
	&amp;lt;/Directory&amp;gt;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	7. Go to&amp;nbsp;&lt;em&gt; /etc/awstats/awstats.localhost.localdomain.conf&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	Supposing your website is &lt;em&gt;www.example.com,&lt;/em&gt; you must issue the following commands&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;cp awstats.localhost.localdomain.conf awstats.example.com.conf
&lt;br&gt;
	cp awstats.localhost.localdomain.conf awstats.www.example.com.conf&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	In both those file modify like this :&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;SiteDomain=&quot;www.example.com
&lt;br&gt;
	HostAliaseses=&quot;www.example.com localhost 127.0.01&quot;
&lt;br&gt;
	LogFile=/path/to/apache/access_log
&lt;br&gt;
	LogType=W
&lt;br&gt;
	LogFormat=4
&lt;br&gt;
	LogSeparator=&quot; &quot;&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	8. Update the stats using&amp;nbsp; this command
&lt;br&gt;
	&lt;strong&gt;#/usr/bin/awstats_updateall.pl now -confdir=&quot;/etc&quot; -awstatsprog=&quot;/usr/local/apache/htdocs/awstats/awstats.pl&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	9. To check if it works, type in your browser :
&lt;br&gt;
	&lt;em&gt;http://www.example.com/awstats/awstats.pl&lt;/em&gt; or&amp;nbsp; http://example.com/awstats/awstats.pl&lt;/p&gt;


&lt;p&gt;
	10 To auto update the statistics every 30 mintues , add to /etc/crontab&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;*/30 * * * * user perl /usr/bin/awstats_updateall.pl now -confdir=&quot;/etc&quot; -awstatsprog=&quot;/usr/local/apache/htdocs/awstats/awstats.pl&quot;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	where user is the user under which you want the awstats update to run&lt;/p&gt;


&lt;p&gt;
	Remeber to press Enter after the last line, to put the cursor to a new line at the end of the file .Otherwise, the last cronjob will not run.&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/19/can-somebody-tell-me-how-to-install-awstats#a20</guid>
<pubDate>Tue, 11 Oct 2011 16:32:25 +0000</pubDate>
</item>
<item>
<title>Answered: How can i migrate RAID in  Ubuntu Linux?</title>
<link>http://www.sciencefox.com/17/how-can-i-migrate-raid-in-ubuntu-linux#a18</link>
<description>

&lt;p&gt;
	This tutorial will explain how to go from 2x320 RAID1 HDD's to to 2x500 RAID1 HDD's&lt;/p&gt;


&lt;p&gt;
	1. Make sure that your system can boot from either of 320 hdd’s.&lt;/p&gt;


&lt;p&gt;
	2. Shutdown the system and&amp;nbsp; replace one of the 320 hdd’s with one 500 hdd&lt;/p&gt;


&lt;p&gt;
	3. Start the&amp;nbsp; system, it should boot into degraded mode. If it doesn’t either check in bios to boot from the 320 hdd, or reattach old 320 hdd drive , swap it with the other 320 hdd.&lt;/p&gt;


&lt;p&gt;
	In my case the 500 GB Hdd is now /dev/sda and the 320 gb hdd is /dev/sdb&lt;/p&gt;


&lt;p&gt;
	4. Copy partition structure from sdb to sda&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;sfdisk -d /dev/sdb | sfdisk /dev/sda&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	In my case I had to add –force to the command because “partition 1 does not end at a cylinder boundary”.&lt;/p&gt;


&lt;p&gt;
	5. Enter&lt;strong&gt; cfdisk /dev/sda&lt;/strong&gt;. Delete /dev/sda3 , to add the free space to it. Recreate /dev/sda3 and set type to fd – linux raid. Make sure that /dev/sda1 is marked bootable&lt;/p&gt;


&lt;p&gt;
	6. Add /dev/sda1 to md0, /dev/sda2 to md1, /dev/sda3 to md2&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;mdadm -–add /dev/md0 /dev/sda1
&lt;br&gt;
	mdadm -–add /dev/md1 /dev/sda2
&lt;br&gt;
	mdadm -–add /dev/md2 /dev/sda3&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Linux will start syncing the partitions.&lt;/p&gt;


&lt;p&gt;
	7. Next install grub on dev/sda&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;grub-install /dev/sda&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	8. Shutdown.Change the 320 hdd with the second 500 GB hdd. Restart.&lt;/p&gt;


&lt;p&gt;
	9. Copy partition structure from sda to sdb (from 500gb hdd to 500gb hdd)&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;sfdisk -d /dev/sda | sfdisk /dev/sdb –force&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	10. Re-add sdb to md&amp;nbsp; raid :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;mdadm -–add /dev/md0 /dev/sdb1
&lt;br&gt;
	mdadm -–add /dev/md1 /dev/sdb2&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;mdadm -–add /dev/md2 /dev/sdb3&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	11. Then we install grub on sdb too :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;grub-install /dev/sdb&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	12. First we restart the system, and then we grow the partition :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;mdadm --grow /dev/md2 --size=max&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	13. Unmount /dev/md2 :&lt;strong&gt; umount /dev/md2&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	If it’s not working on reboot then try to unmount it.&lt;/p&gt;


&lt;p&gt;
	14. Run filesystem check :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;e2fsck -f /dev/md2&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	15. Resize the filesystem&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;resize2fs /dev/md2&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	16. Run filesystem check again :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;e2fsck -f /dev/md2&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/17/how-can-i-migrate-raid-in-ubuntu-linux#a18</guid>
<pubDate>Tue, 11 Oct 2011 16:25:57 +0000</pubDate>
</item>
<item>
<title>Answered: How can i limit SSH file transfer to a single directory ?</title>
<link>http://www.sciencefox.com/15/how-can-i-limit-ssh-file-transfer-to-a-single-directory#a16</link>
<description>

&lt;p&gt;
	Let us suppose that you have a server, and you want to limit the access of an user only to a specific directory (for example home directory).&lt;/p&gt;


&lt;p&gt;
	For that&amp;nbsp; task you must have OpenSSH installed - a version&amp;nbsp; greater than 4.8 , because lower versions will not recognize some commands (Match User directive). If you have a lower version please read the second part of this tutorial.&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Assuming you have version greater then 4.8 here is what to do :&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	1. Add the user : &lt;strong&gt;#useradd -s /bin/false user1&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. In &lt;em&gt;/etc/ssh/sshd_config&lt;/em&gt; we must : (supposing that the user's home dir is /home/user1)
&lt;br&gt;
	- comment:
&lt;br&gt;
	&lt;strong&gt;#Subsystem sftp /usr/libexec/openssh/sftp-server&lt;/strong&gt;
&lt;br&gt;
	- add:
&lt;br&gt;
	&lt;strong&gt;Subsystem sftp internal-sftp&lt;/strong&gt;
&lt;br&gt;
	-after this, at the end of the file add those lines:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;Match User user1
&lt;br&gt;
	ChrootDirectory /home/user1
&lt;br&gt;
	AllowTCPForwarding no
&lt;br&gt;
	X11Forwarding no&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Restart the SSH service : #&lt;strong&gt;/etc/init.d/sshd restart&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4.Assign the necessary permissions&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#chown root:root /home/user1
&lt;br&gt;
	#chmod 0755/home/user1&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Attention&lt;/em&gt; : Those are &lt;em&gt;mandatory&lt;/em&gt; properties. Without those, the user can not login via sftp.&lt;/p&gt;


&lt;p&gt;
	In this moment&amp;nbsp; the user is only able to download the files already existing in that folder.
&lt;br&gt;
	If we want to give him &lt;em&gt;write access&lt;/em&gt;, we create a directory inside /home/user1 which user1 owns , an in which he can create files and directories.&lt;/p&gt;


&lt;p&gt;
	--- &lt;em&gt;Part Two&lt;/em&gt; ---&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;But what if you have OpenSSH version less than 4.8 (for example 4.3p2, which comes with CentOs 5.5) ?&lt;/em&gt; Here is what to do:&lt;/p&gt;


&lt;p&gt;
	Basically, you create another ssh server, listening on another port, on which the user will make sftp chrooted.&lt;/p&gt;


&lt;p&gt;
	1. Create another ssh init&amp;nbsp; script, named let's say&lt;em&gt; sftpinit&lt;/em&gt; and save it in &lt;em&gt;/etc/init.d/sftpinit&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#!/bin/bash
&lt;br&gt;
	#
&lt;br&gt;
	pidfile='/var/run/sftpinit.pid'&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;case &quot;${1}&quot; in&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;start&amp;nbsp; ) exec -a /usr/sbin/sftpinit /usr/sbin/sshd -f /etc/ssh/sftpinit_config
&lt;br&gt;
	;;
&lt;br&gt;
	stop&amp;nbsp;&amp;nbsp; ) kill -9 $(cat ${pidfile})
&lt;br&gt;
	;;
&lt;br&gt;
	restart) stop
&lt;br&gt;
	sleep 3
&lt;br&gt;
	start
&lt;br&gt;
	;;
&lt;br&gt;
	*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) echo &quot;Usage: ${0} (start|stop|restart)&quot;
&lt;br&gt;
	;;&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;esac&lt;/strong&gt;
&lt;br&gt;
	&lt;strong&gt;exit 0&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. &lt;strong&gt;#chmod 0755 /etc/init.d/sftpinit&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. If you want that server to run at startup : &lt;strong&gt;chkconfig --add sftpinit&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4. Then, make a symbolic link : &lt;strong&gt;# ln -s /usr/sbin/sshd /usr/sbin/sftpinit&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	5. Create &lt;em&gt;/etc/ssh/sftpinit_config&lt;/em&gt; with the following content :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;Port 2000
&lt;br&gt;
	Protocol 2
&lt;br&gt;
	AddressFamily inet&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;SyslogFacility AUTHPRIV
&lt;br&gt;
	LogLevel INFO&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;PermitRootLogin no&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;RSAAuthentication no
&lt;br&gt;
	PubkeyAuthentication no
&lt;br&gt;
	RhostsRSAAuthentication no
&lt;br&gt;
	HostbasedAuthentication no
&lt;br&gt;
	PasswordAuthentication yes
&lt;br&gt;
	PermitEmptyPasswords no
&lt;br&gt;
	ChallengeResponseAuthentication no
&lt;br&gt;
	KerberosAuthentication no
&lt;br&gt;
	GSSAPIAuthentication no&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;UsePAM no&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;PidFile /var/run/sftpinit.pid&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;ChrootDirectory /home/user1/
&lt;br&gt;
	Subsystem sftp internal-sftp&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. Create the user user 1 (suppose it's home directory will be /home/user1) and assign a password:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;# useradd -s /bin/false user1
&lt;br&gt;
	# passwd user1 passworduser1&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	7. Assign proper rights:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#chown root:root /home/user1
&lt;br&gt;
	#chmod 0755 /home/user1&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	8. Start the new ssh server with &lt;strong&gt;#service sftpinit start&lt;/strong&gt; or &lt;strong&gt;#/etc/init.d/sftpinit start&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Now on port 2000 you can make sftp with only user 1( because root login is disallowed). On your normal ssh port, you can not login with user1 (because his shell is /bin/false) and you can not make sftp.&lt;/p&gt;


&lt;p&gt;
	In this moment&amp;nbsp; the user is only able to download the files already existing in that folder&lt;/p&gt;


&lt;p&gt;
	To give the user&lt;em&gt; write access&lt;/em&gt;, we create a directory inside /home/user1 , (/home/user1/icanwritehere) which user1 owns , an in which he can create files and directories.&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/15/how-can-i-limit-ssh-file-transfer-to-a-single-directory#a16</guid>
<pubDate>Tue, 11 Oct 2011 16:21:35 +0000</pubDate>
</item>
<item>
<title>Answered: How can i make ip forwarding in Linux ?</title>
<link>http://www.sciencefox.com/13/how-can-i-make-ip-forwarding-in-linux#a14</link>
<description>

&lt;p&gt;
	Let us suppose that for your particular need (gateway, VPN, routing,etc...) you need to enable ip forwarding.&amp;nbsp; This is a very easy task. Here is how to do it , assuming that your Linux distribution is Centos :&lt;/p&gt;


&lt;p&gt;
	1) First you must check the status of ip forwarding and you can do this in two ways&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#sysctl net.ipv4.ip_forward&lt;/strong&gt;
&lt;br&gt;
	or
&lt;br&gt;
	&lt;strong&gt;#cat /proc/sys/net/ipv4/ip_forward&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2) Now you can enable IP forwarding&lt;/p&gt;


&lt;p&gt;
	a) with no persistence after reboot&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#systcl -w net.ipv4.ip_forward=1&lt;/strong&gt;
&lt;br&gt;
	or
&lt;br&gt;
	&lt;strong&gt;#echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	b) permanent setting&lt;/p&gt;


&lt;p&gt;
	edit &lt;em&gt;/etc/sysctl.conf&lt;/em&gt; and add/modify&amp;nbsp; a line like this :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;net.ipv4.ip_forward=1&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Also you can check &lt;em&gt;/etc/sysconfig/network&lt;/em&gt; file to contain a line like this :&lt;/p&gt;


&lt;p&gt;
	FORWARD_IPV4=true&lt;/p&gt;


&lt;p&gt;
	3) If you choose to make it a permanent setting, you must now enable the changes from &lt;em&gt;sysctl.conf&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#sysctl -p /etc/sysctl.conf&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4) Restart the network service&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#service network restart&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	The ip forwarding is now enabled.&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/13/how-can-i-make-ip-forwarding-in-linux#a14</guid>
<pubDate>Tue, 11 Oct 2011 16:18:01 +0000</pubDate>
</item>
<item>
<title>Answered: How to install a program in Safe Mode in Windows XP</title>
<link>http://www.sciencefox.com/11/how-to-install-a-program-in-safe-mode-in-windows-xp#a12</link>
<description>

&lt;div&gt;
	

&lt;p&gt;
		By default, Windows Installer will not work in Safe Mode, so you can not install or uninstall programs in that mode.&lt;/p&gt;
	

&lt;p&gt;
		To make it work, you need to create a registry entry for each mode of Safe Mode you log in with.&lt;/p&gt;
	

&lt;p&gt;
		1. &lt;em&gt;Safe Mode.&lt;/em&gt;&lt;/p&gt;
	

&lt;p&gt;
		In a command prompt, give the&amp;nbsp; command :&lt;/p&gt;
	

&lt;p&gt;
		&lt;strong&gt;REG ADD “HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer” /VE /T REG_SZ /F /D “Service”&lt;/strong&gt;&lt;/p&gt;
	

&lt;p&gt;
		followed by :&lt;/p&gt;
	

&lt;p&gt;
		&lt;strong&gt;net start msiserver&lt;/strong&gt;&lt;/p&gt;
	

&lt;p&gt;
		This will start Windows Installer Service.&lt;/p&gt;
	

&lt;p&gt;
		2. &lt;em&gt;Safe Mode with Network&lt;/em&gt;&lt;/p&gt;
	

&lt;p&gt;
		In a command prompt, give the command :&lt;/p&gt;
	

&lt;p&gt;
		&lt;strong&gt;REG ADD “HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer” /VE /T REG_SZ /F /D “Service”&lt;/strong&gt;&lt;/p&gt;
	

&lt;p&gt;
		and then :&lt;/p&gt;
	

&lt;p&gt;
		&lt;strong&gt;net start msiserver&lt;/strong&gt;&lt;/p&gt;
	

&lt;p&gt;
		This will start Windows Installer Service.&lt;/p&gt;
&lt;/div&gt;


&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</description>
<category>Windows XP</category>
<guid isPermaLink="true">http://www.sciencefox.com/11/how-to-install-a-program-in-safe-mode-in-windows-xp#a12</guid>
<pubDate>Tue, 11 Oct 2011 16:15:46 +0000</pubDate>
</item>
<item>
<title>Answered: How to remember Linux path variables?</title>
<link>http://www.sciencefox.com/9/how-to-remember-linux-path-variables#a10</link>
<description>

&lt;p&gt;
	Edit your &lt;em&gt;/home/user/.bash_profile&lt;/em&gt; and at the end of this file add:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;PATH=$PATH:/your/new/path/dir
&lt;br&gt;
	export PATH&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Now, your path settings will be remembered.&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/9/how-to-remember-linux-path-variables#a10</guid>
<pubDate>Tue, 11 Oct 2011 12:08:42 +0000</pubDate>
</item>
<item>
<title>Answered: Install MySQL from source anybody ?</title>
<link>http://www.sciencefox.com/7/install-mysql-from-source-anybody#a8</link>
<description>

&lt;p&gt;
	1. First create a group named mysql :
&lt;br&gt;
	&lt;strong&gt;#groupadd mysql&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Then add user mysql that belongs to this group :
&lt;br&gt;
	&lt;strong&gt;#useradd -g mysql mysql&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Dowload it, with wget&lt;/p&gt;


&lt;p&gt;
	4. Un-tar it and switch to MySQL directory :
&lt;br&gt;
	&lt;strong&gt;#tar zxvf mysql-*
&lt;br&gt;
	#cd mysql-*&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	5. Configure the install path to be : &lt;em&gt;/usr/local/mysql&lt;/em&gt;
&lt;br&gt;
	&lt;strong&gt;# ./configure --prefix=/usr/local/mysql&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. Compile and install :
&lt;br&gt;
	&lt;strong&gt;#make
&lt;br&gt;
	#make install&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	7. Copy the configuration file :
&lt;br&gt;
	&lt;strong&gt;#cp support-files/my.medium.cnf /etc/my.cnf&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	8. Give proper rights
&lt;br&gt;
	&lt;strong&gt;#cd /usr/local/mysql
&lt;br&gt;
	#chown -R mysql .
&lt;br&gt;
	#chgrp -R mysql .&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	9. Set up MySQL internal database :
&lt;br&gt;
	&lt;strong&gt;#bin/mysql_install_db --user=mysql&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	10. Initialize/start MySQL. If it does not work from first attempt, reboot your server :
&lt;br&gt;
	&lt;strong&gt;#/usr/local/mysql/bin/mysqld_safe --user=mysql &amp;amp;&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	11. Some more rights :
&lt;br&gt;
	&lt;strong&gt;#chown -R root .
&lt;br&gt;
	#chown -R mysql var&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	12. Install mysql using secure installation :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#cd /usr/local/mysql
&lt;br&gt;
	#/usr/local/mysql/bin/mysql_secure_installation&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	13 To automatically start after reboot, from sources dir :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#cp support-files/mysql.server /etc/init.d/mysql
&lt;br&gt;
	chmod 755 /etc/init.d/mysql
&lt;br&gt;
	#chkconfig mysql on
&lt;br&gt;
	#service mysql start&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	If you encounter some path errors , fix those with (paths are relative to this tutorial) :&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#PATH=$PATH:/usr/local/mysql/bin
&lt;br&gt;
	#export PATH
&lt;br&gt;
	#PATH=$PATH:/usr/local/mysql
&lt;br&gt;
	#export PATH&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Security tip :&lt;/em&gt; if your database need to be accessed only by local applications, you can tell MySQL to listen only&amp;nbsp; to local connections ( not even on port 3306), by editing /etc/my.cnf and adding :&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/7/install-mysql-from-source-anybody#a8</guid>
<pubDate>Tue, 11 Oct 2011 12:06:36 +0000</pubDate>
</item>
<item>
<title>Answered: How to install Apache from source on Linux</title>
<link>http://www.sciencefox.com/5/how-to-install-apache-from-source-on-linux#a6</link>
<description>

&lt;p&gt;
	Get the latest Apache , then :&lt;/p&gt;


&lt;p&gt;
	1. Un-tar it :
&lt;br&gt;
	&lt;strong&gt;#tar zxvf httpd-*&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Configure it, with install dir &lt;em&gt;/usr/local/apache&lt;/em&gt;,&lt;em&gt; enable-rewrite&lt;/em&gt; mod built in and with support for &lt;em&gt;Apache modules&lt;/em&gt; ( &lt;em&gt;enable-s0&lt;/em&gt; command) :
&lt;br&gt;
	&lt;strong&gt;#cd httpd-*
&lt;br&gt;
	#./configure --prefix=/usr/local/apache --enable-rewrite --enable-so&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Compile and install it :
&lt;br&gt;
	&lt;strong&gt;#make
&lt;br&gt;
	#make install&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4.&amp;nbsp; After this, apache can be started with :
&lt;br&gt;
	&lt;strong&gt;#cd /usr/local/apache2/bin
&lt;br&gt;
	#./apachectl start&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	5. Check if you have remnants of an older installation of Apache, for example&amp;nbsp; another httpd.conf , and if in /etc/init.d there is an httpd file. If yes, rename or delete it.&lt;/p&gt;


&lt;p&gt;
	6. If you want Apache to run an startup, download the following &lt;a rel=&quot;nofollow&quot; href=&quot;http://www.tutorialbit.com/wp-content/uploads/2010/11/httpd.doc&quot;&gt;file&lt;/a&gt; , then :
&lt;br&gt;
	&lt;strong&gt;#mv httpd.doc httpd
&lt;br&gt;
	#chmod a+x httpd
&lt;br&gt;
	#cp httpd /etc/init.d/httpd
&lt;br&gt;
	# chkconfig httpd on&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	7. Another way to start Apache when installing from source is to set up a symbolic link for the &lt;em&gt;apachectl&lt;/em&gt; utility (installed automatically as part of Apache):&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	Then set up auto-start for runlevel 3 (where the server will go by default):&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#ln -s /etc/rc.d/init.d/apache /etc/rc.d/rc3.d/S90apache&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	After that&amp;nbsp; start the daemon:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#/etc/rc.d/init.d/apache start&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	---&lt;/p&gt;


&lt;p&gt;
	Some notes about Apache installation:&lt;/p&gt;


&lt;p&gt;
	1. There are two modes of compiling Apache modules :
&lt;br&gt;
	a) built in , with &lt;strong&gt;--enable-modulename&lt;/strong&gt;
&lt;br&gt;
	b) shared , with &lt;strong&gt;--enable-modulename=shared&lt;/strong&gt; . With this option,&amp;nbsp; in &lt;em&gt;/modules&lt;/em&gt; directory, modulename.so will be created, and we can&amp;nbsp; load it in httpd .conf with a loadmodule directive.&lt;/p&gt;


&lt;p&gt;
	&lt;em&gt;Example&lt;/em&gt; : &lt;strong&gt;LoadModule rewrite_module /locatie/modul/mod_rewrite.so&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. If you want to include most of the modules in apache, configure it with&amp;nbsp; &lt;strong&gt;--enable-modules=most&lt;/strong&gt; or &lt;strong&gt;--enable-mods-shared=most&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/5/how-to-install-apache-from-source-on-linux#a6</guid>
<pubDate>Tue, 11 Oct 2011 12:05:10 +0000</pubDate>
</item>
<item>
<title>Answered: How can i install PHP from source on Linux?</title>
<link>http://www.sciencefox.com/3/how-can-i-install-php-from-source-on-linux#a4</link>
<description>

&lt;p&gt;
	1. Stop your webserver :
&lt;br&gt;
	&lt;strong&gt;#/etc/init.d/httpd stop&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	2. Un-tar php :
&lt;br&gt;
	&lt;strong&gt;#tar zxvf php-*&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	3. Configure it with the following options :
&lt;br&gt;
	&lt;em&gt;- install dir = /usr/local/apache/php
&lt;br&gt;
	- apxs dir = /usr/local/apache/bin/apxs
&lt;br&gt;
	- config file path = /usr/local/apache/php
&lt;br&gt;
	- mysql directory = /usr/local/mysql
&lt;br&gt;
	- cgi disabled
&lt;br&gt;
	- zlib, mbstring, gd enabled&lt;/em&gt;
&lt;br&gt;
	&lt;em&gt;- with-imap, kerberos, imap-ssl, openssl, mcrypt&lt;/em&gt; are optional. For mcrypt you need : &lt;em&gt;yum install libmcrypt libmcrypt-devel&lt;/em&gt; , for imap : &lt;em&gt;yum install libc-client-devel&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;#cd php-*
&lt;br&gt;
	#./configure --prefix=/usr/local/apache/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/php \
&lt;br&gt;
	--with-mysql=/usr/local/mysql --disable-cgi --with-zlib --enable-mbstring --with-gd --with-png-dir=/usr/lib/
&lt;br&gt;
	--with-imap --with-kerberos --with-imap-ssl --with-openssl --with-mcrypt &lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	4. Compile and install it
&lt;br&gt;
	&lt;strong&gt;#make
&lt;br&gt;
	#make install&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	5. Copy config file to the directory defined when configuring:
&lt;br&gt;
	&lt;strong&gt;#cp /alex/php-5.3.3/php.ini-production /usr/local/apache/php/php.ini&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	6. In &lt;em&gt;/usr/local/apache/conf/httpd.conf&lt;/em&gt; we check/add the followings:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;LoadModule php5_module modules/libphp5.so
&lt;br&gt;
	DirectoryIndex index.html index.php&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;AddHandler php5-script .php
&lt;br&gt;
	AddType text/html .php&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;AddType application/x-tar .tgz
&lt;br&gt;
	AddType application/x-httpd-php .php
&lt;br&gt;
	AddType image/x-icon .ico&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	7. Start your webserver
&lt;br&gt;
	&lt;strong&gt;#/etc/init.d/httpd start&lt;/strong&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/3/how-can-i-install-php-from-source-on-linux#a4</guid>
<pubDate>Tue, 11 Oct 2011 12:02:08 +0000</pubDate>
</item>
<item>
<title>Answered: How can I backup a machine based on Linux?</title>
<link>http://www.sciencefox.com/1/how-can-i-backup-a-machine-based-on-linux#a2</link>
<description>

&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;Here is a quick backup idea for your Linux box.
&lt;br&gt;
	Usually on your Linux system you have files (sites,documents..etc) and databases.&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;1) Backup all databases from MySQL :
&lt;br&gt;
	&lt;strong style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;#mysqldump -u root -p -A &amp;gt; all.sql&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;where:
&lt;br&gt;
	&lt;em style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;-p = will prompt you for SQL root password
&lt;br&gt;
	-A = all databases
&lt;br&gt;
	-all.sql = the file where the databases will be backed to&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;2) Make an archive of all your files in the system
&lt;br&gt;
	&lt;strong style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;#tar -cvpzf backupfile.tar.gz --exclude=/backupfile.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude =/media --exclude=/dev/ /&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;where:
&lt;br&gt;
	&lt;em style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;-c = new backup archive
&lt;br&gt;
	-v = verbose mode
&lt;br&gt;
	-p = keep file permissions
&lt;br&gt;
	-z = compress backup with gzip
&lt;br&gt;
	- exclude the backup file itself from the backup, and some system generated directories.
&lt;br&gt;
	- / = at the end of the command, / is the directory that we want to backup. Because we want to backup all the filesystem we use the root directory, /&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;3) Restore the backup&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;Boot with a LiveCD and issue the following command (make sure the backup archive is not stored in the directories to be restored, or it will be overwritten) :&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;&lt;strong style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;#tar -xvpzf /location/of/backup.tar.gz -C /&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;where :
&lt;br&gt;
	&lt;em style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;-x = extract
&lt;br&gt;
	-f = archive file
&lt;br&gt;
	- C / = directory to extract, in our case, the root directory, /&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 1px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; font-size: 1.2em; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
	&lt;span style=&quot;font-size:14px;&quot;&gt;4) Create the directories not included in backup
&lt;br&gt;
	&lt;strong style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial;&quot;&gt;#mkdir /proc /lost+found /sys /mnt /media&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;</description>
<category>Linux</category>
<guid isPermaLink="true">http://www.sciencefox.com/1/how-can-i-backup-a-machine-based-on-linux#a2</guid>
<pubDate>Mon, 10 Oct 2011 05:47:02 +0000</pubDate>
</item>
</channel>
</rss>
