How Do You Get Apache Web Service to Start Automatically after a Reboot of a CentOS Linux Server?

Problem scenario  
You have to manually start Apache web server every time you do reboot the server.  You want the Apache web service to start automatically.

Solution
1.  Edit /etc/crontab.  Add the lowest line of these two (the line above is for reference):

# *  *  *  *  * user-name  command to be executed
@reboot         root       apachectl start

2.

How Do You Fix a PHP Web Page when the Page Is Completely Blank?

Problem scenario
Using a web browser you go to a PHP web page.  There are no errors, but the page is blank.  It is just all white, but you expect content to be rendered (e.g., text should be visible).  The WSOD (white screen of death) is a common problem to troubleshoot in a web browser.  What do you do to see output you want it to display?  

Solution
1.

How Do You Place a Postgres Database on a Flash Drive on a Windows Host Running Oracle VirtualBox with a Linux Guest VM?

Problem scenario
You have Postgres installed on the Linux guest of Oracle VirtualBox.  You have storage capacity on the Windows host.  You can interactively work with smbclient to share files between the Linux guest and the Windows host.   You want to share files between the two servers without the interactive smb commands.  You want the Postgres database to reside on the Windows host.  This way your Linux guest hard disk does not have to be expanded but can run Postgres commands from your Linux guest.

How Do You Troubleshoot an Apache Web Service Problem when from a Web Browser You Receive the Error “The Address Is Restricted”?

Problem scenario
You are using Oracle VirtualBox on a Windows host.  You are using a Linux guest that is running Apache web server.  The Apache httpd service is running on the guest Linux server.  But when you are on the Windows host, you try to access the website, you get an error in the web browser.  This is the error you receive:

“This address is restricted
This address uses a network port which is normally used for purposes other than Web browsing.

How Do You View the Website That Your Oracle VirtualBox Guest Server Is Presenting with a Web Browser on Your Windows Host?

Problem scenario:  You have a Linux VM guest running on Oracle VirtualBox.  You installed Apache web server on this server.  How do you browse to its website from your Windows host machine?

Solution

#1  Determine the host IP address as configured for the guest.  In Oracle VirtualBox go to Devices -> Network -> Network Settings.  For Adapter1 go to “Advanced” and click the button for “Port Forwarding.” The host IP address may be 127.0.1.1.

Using PowerShell Version 3, How Do You Determine If a Port Is Open for a given IP Address?

Problem scenario
You are using Windows 7 and PowerShell version 3.  You want to test if a port is open to a given IP address.  (If you are using a modern version of PowerShell, use the Test-NetConnection command.)   How do you find out if a port of an IP address is open or not?

Solution
Use the PowerShell function Test-TCPPortConnection written by Jonathan Medd.  

How Do You Get Jenkins Running on Linux to Work With Windows Servers?

Problem scenario
You want your central Jenkins 1.651.1 server running on Linux to push down builds (or run jobs) on Windows servers.  When you try to connect Jenkins master to a slave server, you get an error message like this:

“ERROR: Access is denied. See http://wiki.jenkins-ci.org/display/JENKINS/Windows+slaves+fail+to+start+via+DCOM for more information about how to resolve this. org.jinterop.dcom.common.JIException: Message not found for errorCode: 0x00000005 at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:”

You know the credentials and IP address are correct. 

How Do You Troubleshoot Mounting a cifs File Share when You Get an Error about “wrong fs type, bad option, bad superblock”?

Problem scenario:  You run this command on a Linux CentOS server:

sudo mount -t cifs -o user=jdoe //172.33.44.55/contintshare /mnt/windows-share

But you get this error:  “mount: wrong fs type, bad option, bad superblock on //172.33.44.55/contintshare, missing codepage or helper program, or other error (for several file systems (e.g., nfs, cifs) you might need a /sbin/mount.<type> helper program)”

What do you do?

Solution

The error message is not clear or helpful. 

How Can You Recursively Search Subdirectories in Linux For a File That Has a Specific Text Pattern?

Problem scenario:  How do you use the grep command to recursively search most subdirectories (excluding some directories) for a pattern?  You want to find a file with a string like this:

/var/lib/pgsql/data

You are not interested in the files in directory paths that have one or more parent (or any antecedent) directories named “proc” nor “sys”.  You want to list files that have the above pattern. 

How Do You Share Files Between an Oracle VirtualBox Linux Guest and a Windows Host without Using vboxsf?

Problem scenario:  You have Oracle VirtualBox running on a Windows 7 computer as the host.  You have a Linux CentOS guest supported by Oracle VirtualBox.  You want to have a file share that does not rely on vboxsf.  What do you do?

Solution
1.  On the Windows host desktop, create a folder.  For this example, we’ll use “foobar” for the name.