<?xml version="1.0" encoding="utf-8"?> 
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/"
     version="2.0">

    <channel>

        <title>Mark C Allen - Linux Articles</title>
        <link>http://www.markcallen.com/linux/linux-articles</link>
        <description></description>
        <language>en-us</language>
        <generator>Plone 2.0</generator>

        
            
                  <item>
                      <title>Fixing SELinux Content in a HTML directory</title>
                      <link>http://www.markcallen.com/linux/fixing-selinux-content-in-a-html-directory</link>
                      <description>Unable to access web files in a directory under the /var/www/html becuase of a 403 forbidden might be a context problem.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 13 Sep 2008 13:51:10 -0700</pubDate>
                      
   <content:encoded>
       <![CDATA[
<h2>Problem</h2>
<p>Getting a 403 forbidden error message when accessing a new file or directory in /var/www/html.</p>
<p>Check /var/log/messages to see if there are any:</p>
Sep 13 13:11:28 fserver02 kernel: audit(1221336688.892:14): avc:  denied  { getattr } for  pid=25036 comm="httpd" name="phpldapadmin" dev=dm-0 ino=2441537 scontext=root:system_r:httpd_t tcontext=root:object_r:user_home_t tclass=dir<br /><br />
<h2>Solution</h2>
<br />First check the context on the root directory.<br /><br />cd /var/www/html<br />ls -Z index.html<br />-rw-r--r--  root     root     root:object_r:httpd_sys_content_t index.html<br /><br />Look at the context of the new directory or file<br /><br />ls -Z index.php<br />-rw-r--r--  root     root     root:object_r:user_home_t index.php<br /><br />Now change the file or directory to the correct context<br /><br />chcon  root:object_r:httpd_sys_content_t . -Rc<br /><br />Check the context of the file:<br /><br />ls -Z index.php<br />-rw-r--r--  root     root     root:object_r:httpd_sys_content_t index.php<br /><br /><br /><br />
<p><br /></p>
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Setting up VNCServer</title>
                      <link>http://www.markcallen.com/linux/setting-up-vncserver</link>
                      <description>How to setup vncserver on a linux machine to run gnome or kde.</description>
                      <author>mallen</author>
                      <pubDate>Sun, 25 May 2008 11:13:21 -0700</pubDate>
                      
   <content:encoded>
       <![CDATA[
<h2>Initialize</h2>
<p>Startup vncserver for the first time on port 5910 (:10) and set the password.</p>
<pre>[root@localhost ~]# vncserver :10<br /><br />You will require a password to access your desktops.<br /><br />Password:<br />Verify:<br />xauth:  creating new authority file /root/.Xauthority<br /><br />New 'localhost.localdomain:10 (root)' desktop is localhost.localdomain:10<br /><br />Creating default startup script /root/.vnc/xstartup<br />Starting applications specified in /root/.vnc/xstartup<br />Log file is /root/.vnc/localhost.localdomain:10.log<br /><br />[root@localhost ~]# <br /></pre>
<h2>Configure</h2>
<p>Edit ~/.vnc/xstartup and change the session manager to</p>
<ul><li>gnome-session - for Gnome</li><li>startkde - for KDE</li></ul>
<pre>#!/bin/sh<br /><br /># Uncomment the following two lines for normal desktop:<br /># unset SESSION_MANAGER<br /># exec /etc/X11/xinit/xinitrc<br /><br />[ -x /etc/vnc/xstartup ] &amp;&amp; exec /etc/vnc/xstartup<br />[ -r $HOME/.Xresources ] &amp;&amp; xrdb $HOME/.Xresources<br />xsetroot -solid grey<br />vncconfig -iconic &amp;<br />xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &amp;<br />gnome-session &amp;<br /></pre>
Restart vncserver<br /><br />
<pre>[root@localhost .vnc]# vncserver -kill :10<br />Killing Xvnc process ID 2844<br />[root@localhost .vnc]# vncserver :10<br /><br />New 'localhost.localdomain:10 (root)' desktop is localhost.localdomain:10<br /><br />Starting applications specified in /root/.vnc/xstartup<br />Log file is /root/.vnc/localhost.localdomain:10.log<br /><br />[root@localhost .vnc]# <br /></pre>
<br />
<h2>Configure IPTables</h2>
Edit /etc/sysconfig/iptables and add<br />
<pre>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5910 -j ACCEPT</pre>
<p>Restart iptables</p>
<pre>[root@localhost ~]# /etc/init.d/iptables restart<br />Flushing firewall rules:                                   [  OK  ]<br />Setting chains to policy ACCEPT: filter                    [  OK  ]<br />Unloading iptables modules:                                [  OK  ]<br />Applying iptables firewall rules:                          [  OK  ]<br />Loading additional iptables modules: ip_conntrack_netbios_n[  OK  ]<br />[root@localhost ~]# <br /></pre>
<h2>Accessing</h2>
Open a VNC client and go to &lt;machine&gt;:10<br /><br />Enter the password.<br /><br /><br /><br /><br /><br /><br /><br />
<p><br /></p>
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Copying directories between file systems</title>
                      <link>http://www.markcallen.com/linux/copying-directories-between-file-systems</link>
                      <description>Copying files from one directory to another using find and cpio.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:55:12 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<br />cd /old_file_system/<br />
<p>find . -print -depth | cpio -pamVd /new_file_system/</p>
<br />
<p><br /></p>
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Link down on RedHat Linux 3</title>
                      <link>http://www.markcallen.com/linux/link-down-on-redhat-linux-3</link>
                      <description></description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:55:38 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<p>
                On RedHat Enterprise 3 Linux on VMWare each interface link is always down.<br />
<br />
The following needs to be added to all the ifcfg-eth in /etc/sysconfig/networking-scripts/<br />
<br />
check_link_down() {<br />
return 1;<br />
}<br />
<br />
See <a href="http://www.vmware.com/support/guestnotes/doc/guestos_redhat90.html">http://www.vmware.com/support/guestnotes/doc/guestos_redhat90.html</a> for more information.</p>]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Getting https pages with Perl</title>
                      <link>http://www.markcallen.com/linux/getting-https-pages-with-perl</link>
                      <description>Perl's LWP package is a great way to get web pages and display the content of the resulting http header.  Out of the box it does not support https, the following describes how to configure perl to access https pages.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:55:24 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<h3>Configure CPAN</h3><p>The first thing to do is to setup perl to manage modules using CPAN.  As root run:</p><p class="callout">perl -MCPAN -e shell \;</p><p>run through the configuration if you haven't done so.</p><h3>Install LWP</h3>Inside the CPAN shell run:<br /><br /><p class="callout">install LWP</p><br />This will install all then necessary modules for accessing websites.  Make sure you select y for GET, POST and HEAD, these are great scripts for getting at web page information from the command line.<br /><br /><h3>Install OpenSSL</h3>If you don't have openssl-devel installed on your system you will need to install it.  Check using:<br /><br /><p class="callout">rpm -q openssl-devel</p>Install openssl-devel with up2date:<br /><br /><p class="callout">up2date openssl-devel</p><h3>Install Crypt-SSL</h3>Install Crypt-SSL with perl:<br /><br /><p class="callout">perl -MCPAN -e shell \;</p>inside the shell run:<br /><br /><p class="callout">install Crypt::SSLeay</p><br /><h3>Test</h3><br /><p class="callout">GET https://www.markcallen.com</p><br /><br /><br /><br /><br />]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Setting up VMware Server on Linux</title>
                      <link>http://www.markcallen.com/linux/setting-up-vmware-server-on-linux</link>
                      <description>Instructions on how to setup VMware server on linux and access it from a windows machine.</description>
                      <author>mallen</author>
                      <pubDate>Fri, 18 May 2007 11:45:45 -0700</pubDate>
                      
   <content:encoded>
       <![CDATA[
<h2>Pre-Setup</h2>
<br />
<p>Download VMware server rpm for Linux from <a class="generated" href="http://www.vmware.com">http://www.vmware.com</a> and register for a free serial number.  The current version is 1.0.3.<br /></p>
Setup access to the server.  See <a title="Installing Cygwin for Windows XP" class="generated" href="../cygwin/installing-cygwin-for-windows-xp">Installing Cygwin for Windows XP</a> for instructions on how to setup access to the linux server.<br /><br />
<h2>Installation</h2>
<br />
<h3>Log into the linux server</h3>
<br />
<pre>ssh linux01<br />cd /media/usbdisk/source/vmware/server/linux/1.0.3<br />su</pre>
<br />
<h3>Install the RPM</h3>
<br />
<pre>rpm -ivh VMware-server-1.0.3-44356.i386.rpm</pre>
<br />
<h2>Configure VMware</h2>
<br />As root run:<br /><br />
<pre>/usr/bin/vmware-config.pl<br /><br />Accept the End User License.<br />Accept the default directory for mime type icon.<br />Accept the default desktop menu entry files<br />Accept the default for application's icons<br />Networking for Virtual Machines: yes<br />Ethernet network: eth0<br />NAT networking: yes<br />Probe for private subnet: yes<br />Host-only network: yes<br />Probe for private subnet: yes<br />Accept default for remote console connections<br />Accept default direction for virtual machine files<br />Enter the VMware serial number you received when you downloaded vmware server.</pre>
<br />Verify that vmware will startup when the server reboots.  As root run:<br /><br />
<pre>/sbin/chkconfig --list vmware<br />vmware          0:off   1:off   2:on    3:on    4:off   5:on    6:off</pre>
<br />
<h2>Install VMware Console on Windows</h2>
<br />Download VMware console for windows from <a class="generated" href="http://www.vmware.com">http://www.vmware.com</a><br /><br />On the windows workstation install the server:<br />
<pre>Double click on VMware-console-1.0.3-44356.exe<br />Accept the End User Agreement.<br />Accept the default installation location.</pre>
<br /><br />
<h2>Configure the Console</h2>
<br />Double click on the VMware Server Console icon on the windows desktop.<br /><br />In the Connect to Host dialog box enter the hostname, username and password.<br /><br /><br /><br /><br /><br /><br />
<p><br /></p>
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Creating a new linux file system</title>
                      <link>http://www.markcallen.com/linux/creating-a-new-file-system</link>
                      <description>Creating a ext3 file system on a new USB disk.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:54:55 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<h2>Partition Table</h2>
<br /><b># /sbin/fdisk /dev/sdc</b><br /><br />The number of cylinders for this disk is set to 60801.<br />There is nothing wrong with that, but this is larger than 1024,<br />and could in certain setups cause problems with:<br />1) software that runs at boot time (e.g., old versions of LILO)<br />2) booting and partitioning software from other OSs<br />   (e.g., DOS FDISK, OS/2 FDISK)<br /><br /><b>Command (m for help): d</b><br />Selected partition 1<br /><br /><b>Command (m for help): p</b><br /><br />Disk /dev/sdc: 500.1 GB, 500107862016 bytes<br />255 heads, 63 sectors/track, 60801 cylinders<br />Units = cylinders of 16065 * 512 = 8225280 bytes<br /><br />   Device Boot      Start         End      Blocks   Id  System<br /><br /><b>Command (m for help): n</b><br />Command action<br />   e   extended<br />   p   primary partition (1-4)<br /><b>p</b><br /><b>Partition number (1-4): 1<br />First cylinder (1-60801, default 1): 1</b><br /><b>Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): </b><br />Using default value 60801<br /><br /><b>Command (m for help): w</b><br />The partition table has been altered!<br /><br />Calling ioctl() to re-read partition table.<br /><br />WARNING: Re-reading the partition table failed with error 16: Device or resource busy.<br />The kernel still uses the old table.<br />The new table will be used at the next reboot.<br />Syncing disks.<br /># <br /><br /><br />
<h2>Format the new Partition</h2>
<br />Formatted as ext3<br /><br /><b># /sbin/mkfs -t ext3 -j /dev/sdc1</b><br />mke2fs 1.35 (28-Feb-2004)<br />Filesystem label=<br />OS type: Linux<br />Block size=4096 (log=2)<br />Fragment size=4096 (log=2)<br />61063168 inodes, 122096000 blocks<br />6104800 blocks (5.00%) reserved for the super user<br />First data block=0<br />Maximum filesystem blocks=125829120<br />3727 block groups<br />32768 blocks per group, 32768 fragments per group<br />16384 inodes per group<br />Superblock backups stored on blocks: <br />        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, <br />        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, <br />        102400000<br /><br />Writing inode tables: done                            <br />Creating journal (8192 blocks): done<br />Writing superblocks and filesystem accounting information: done<br /><br />This filesystem will be automatically checked every 36 mounts or<br />180 days, whichever comes first.  Use tune2fs -c or -i to override.<br /># <br /><br />]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Setting up PXE</title>
                      <link>http://www.markcallen.com/linux/setting-up-pxe</link>
                      <description>PXE is a great way to install linux on a server without the need of have a CD Rom.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:54:02 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<p>The following is a good starting point:</p>
<br />
<p><a class="generated" href="http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-pxe.html">http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/sysadmin-guide/ch-pxe.html</a><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Disk Performance</title>
                      <link>http://www.markcallen.com/linux/disk-performance</link>
                      <description>Using hdparm to measure a hard disks performance.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:54:16 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<p>
To measure the current performance of your disk run:</p>
<p>hdparm -tT /dev/sda</p>
<p>You will get something like:</p>
/dev/sda:<br /> Timing cached reads:   896 MB in  2.01 seconds = 446.06 MB/sec<br /> Timing buffered disk reads:  168 MB in  3.01 seconds =  55.77 MB/sec<br /><br /><br /><br />
<p></p>
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Updating VMware Server Serial Number</title>
                      <link>http://www.markcallen.com/linux/updating-vmware-server-serial-number</link>
                      <description>How to update a linux VMware servers serial number from a windows VMware console.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:54:31 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<p>Get the serial number from <a class="generated" href="http://www.vmware.com">http://www.vmware.com</a></p>
<p>Open up the VMware Server Console on the windows machine and login to the linux server as <b>root</b>.</p>
<p>Click on Help -&gt; Enter Serial Number</p>
<p>Enter all the information required.<br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>No output from the Console when connecting to a Server running on Linux</title>
                      <link>http://www.markcallen.com/linux/no-output-from-the-console-when-connecting-to-a-server-running-on-linux</link>
                      <description></description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:53:20 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<p>
                The problem is that the vmx file is not executable.  Go to the VM directory and run:<br /><br />chmod 755 *.vmx<br /><br />Then restart the vmware server, output will then be displayed on the console.</p>]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Syslogd Stops working after installing VMWare Server</title>
                      <link>http://www.markcallen.com/linux/syslogd-stops-working-after-installing-vmware-server</link>
                      <description></description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:53:12 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<p>Seems that VMWare server adds a new service to the /etc/service file. 
If you have SELinux running the file's security context changes.<br /><br />To fix run:<br /><br />/sbin/restorecon /etc/services<br /><br />For more information see <br />
<a href="http://www.vmware.com/community/thread.jspa?messageID=435464">http://www.vmware.com/community/thread.jspa?messageID=435464</a></p>]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Mounting ISO in Linux</title>
                      <link>http://www.markcallen.com/linux/mounting-iso-in-linux</link>
                      <description></description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:53:03 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[<p>
                To mount an ISO file in linux so it turns up as a directory structure do the following:<br />
<br />
mount -o loop -t iso9660 filename.iso /mnt/iso<br />
<br />
Simple as that.</p>]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Unable to use Mac OS X FTP</title>
                      <link>http://www.markcallen.com/linux/unable-to-use-mac-os-x-ftp</link>
                      <description>Unable to use the Mac OS X command line ftp client because of Illegal EPRT command.</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:53:41 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<h2>Problem</h2>
<p>When trying to use the Mac OS X ftp client the following error occues when trying to list the files on the ftp server.</p>
<br />
<p>ftp&gt; ls<br />229 Entering Extended Passive Mode (|||37628|)<br />502 Illegal EPRT Command<br />200 PORT command successful.<br /><br />421 Service not available, remote server timed out. Connection closed<br />ftp&gt;</p>
<br />
<h2>Solution</h2>
<p>Issue a epsv4 command to turn EXPV/EPRT on IPv4 off.</p>
ftp&gt; epsv4<br />EPSV/EPRT on IPv4 off.<br />ftp&gt; ls<br />227 Entering Passive Mode (64,40,110,153,254,46)<br />150 Opening ASCII mode data connection for /bin/ls.<br />total 64<br />srwxrwxrwx   1 mysql    other          0 Jun 23 12:27 mysql.sock<br />-rw-rw----   1 mysql    other        849 Jun 23 12:27 sh2600<br />-rw-r--r--   1 root     other         10 Jul 14 11:29 time<br />drwxrwxr-x   2 root     root         176 Jun 23 12:27 .X11-pipe<br />drwxrwxr-x   2 root     root         176 Jun 23 12:27 .X11-unix<br />226 Transfer complete.<br />ftp&gt; <br /><br />
<p><br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        
        
            
                  <item>
                      <title>Setting up ntpd</title>
                      <link>http://www.markcallen.com/linux/setting-up-ntpd</link>
                      <description>A quick way to setup ntpd to set the system and hardware clock</description>
                      <author>mallen</author>
                      <pubDate>Sat, 16 Feb 2008 20:53:31 -0800</pubDate>
                      
   <content:encoded>
       <![CDATA[
<p>On a Redhat system (Redhat, CentOS, Fedora or Oracle Linux) edit the /etc/sysconfig/ntpd file:</p>
<ul><li>Change:<br /></li></ul>
<p>SYNC_HWCLOCK=no</p>
<p>to</p>
<p>SYNC_HWCLOCK=yes</p>
<ul type="none"><li>Add:</li></ul>
-x to OPTIONS so that the clock will be set every time ntpd is started<br /><br />
<p>OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -x"</p>
<p>Now make sure that ntpd is running</p>
<p>/sbin/chkconfig --level 2345 ntpd on</p>
<p>/sbin/service ntpd start<br /></p>
]]>
   </content:encoded>
 
                  </item>

            
	   	
        


    </channel>

</rss>

