Archive

Archive for the ‘Windows Server 2008 R2’ Category

Joomla 1.5 on Windows Server 2008 R2

March 8, 2010 µ Leave a comment

I will be diving into the dark side with this blog since I prefer working with Microsoft based technolgies such as SharePoint and ASP.NET. Each time I work with PHP and MySQL, it seems like it takes a little Voodoo to make them work. This blog is the bare minimum configuration to get Joomla working on a Windows 2008 R2 Server with Apache, PHP, and a remote MySQL server.

First, download the latest version of Apache HTTP Server win32 binary without crypto MSI installer, PHP VC6 thread safe zip file, MySQL Community Server essential 64 bit MSI installer, and Joomla. Currently, Apache does not have an official 64 bit version, but the 32 bit version works fine on 64 bit operating systems. For PHP, make sure you download a VC6 version since the VC9 versions are only for use with IIS.  If for some reason you are going to move an existing Joomla 1.0 installation to a new server without upgrading it to Joomla 1.5, be sure to use PHP 5.2.x since PHP 5.3.x is not supported with Joomla 1.0. The content on your pages will not display correctly if you use Joomla 1.0 and PHP 5.3.x. For this demonstration, I have built two Windows 2008 R2 servers, one will host the frontend or Apache, PHP, and Joomla, and the other will host the backend or MySQL.

On the frontend server install Apache, do a custom install and take all of the defaults except change the drive letter to the data drive. Opening up the operating system drive or partition to the Internet via a web server is bad mojo. Add the httpd.exe program to the allowed programs firewall exception list. At this point you should be able to access the web server and receive a test page that says “It Works!”

Next, unzip the PHP zip file into a subfolder of the Apache folder and name the folder php. Unzip the Joomla zip file into a subfolder of the Apache\htdocs folder and name the folder joomla. Make a copy of the Apache\conf\httpd.conf file and open the original file in your favorite text editor. Add the following in the section with all of the other “LoadModules”:

LoadModule php5_module php/php5apache2_2.dll

Add the following towards the bottom of the file:

AddType application/x-httpd-php .php
PHPIniDir "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/"

This section already exists; you just need to add the additional default documents:

<IfModule dir_module>
DirectoryIndex index.html index.php main.php index.html.var index.cgi
</IfModule>

Change both of these lines to the new document root location:

<Directory "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/joomla">
DocumentRoot "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/joomla"

Make a copy of the Apache\php\php.ini-production and name it php.ini. Open the php.ini in your favorite text editor. Uncomment the following three lines and set the path for the extension directory:

extension=php_mbstring.dll
extension=php_mysql.dll
extension_dir = "D:/Program Files (x86)/Apache Software Foundation/Apache2.2/php/ext"

Restart the Apache service on the frontend server.

Install MySQL on the database server. Choose the custom install option and change the destination drive to the data drive. Select configure MySQL now and take the standard configuration option. Select the “Install as Windows Service” and “Include Bin Directory in Windows PATH” options. Set a root password.

Open the MySQL Command Line Client. Create a database and user for Joomla. Assign the user permissions to the database.

CREATE DATABASE joomladb;
CREATE USER 'joomladbuser'@'%' IDENTIFIED BY 'joomladbpassword';
GRANT ALL PRIVILEGES ON `joomladb` . * TO 'joomladbuser'@'%';

Add the mysqld.exe program to the allowed programs firewall exception list on the backend server and restart the MySQL service.

Open a web browser and direct it to the DNS name of the website. The Joomla install should start. On the pre-installation check, if all of the options are not in green, you did something wrong.

Enter the information you used when creating the database and user on this page:

Enter the appropriate information on this page. If you want to install the sample data, you actually need to click the button, just having the radio button selected and clicking next will not install the sample data:

Once the installation is finished, you will need to remove the installation folder that is located in the Apache\htdocs\joomla folder before you will be able to access the website.

You now have a fully working version of Joomla installed:

Troubleshooting PHP. Create a phptest.php file in the Apache\htdocs\joomla directory that contains the following:

<?php
phpinfo();
?>

Navigate to the DNS name of the website /phptest.php. You should receive a page that shows all of the PHP settings:

Troubleshooting MySQL Connectivity. Create a mysqltext.php in the Apache\htdocs\joomla directory that contains the following:

<?php
mysql_connect("mysqlservername", "mysqlusername", "mysqluserpassword") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

Navigate to the DNS name of the website /mysqltest.php. You should receive a page that shows:

If you receive nothing at all or an HTTP 500 Internal Server Error, edit the php.ini file and set the following. Restart the Apache service on the frontend server for the changes to take effect.

display_errors = On

This will allow you to see the actual error message which may be something similar to this:

This is most commonly caused by not uncommenting the two modules in the php.ini file listed above or not setting the extension_dir parameter correctly in the php.ini.

Be sure to turn the display_errors option to off and delete both the php and mysql test files before placing the server into production.

µ

Migrate Active Directory from 2003 R2 to 2008 R2 Server Core

February 3, 2010 µ Leave a comment

This blog will step you through the process of migrating your Active Directory domain controllers from Microsoft Windows Server 2003 R2 to Windows Server 2008 R2 Server Core. Server Core is an excellent choice for dedicated domain controllers since it requires less maintenance, has a reduced attack surface, requires less management, and will run on less hardware. Lots of people are scared off by Server Core because there’s no GUI. To be honest with you, it’s a blessing in disguise since you shouldn’t be managing your production Active Directory environment directly on your domain controllers anyway. You can remotely manage AD, DNS, DHCP, etc from your Windows 7 pc with a GUI interface by using the “Remote Server Administration Tools for Windows 7“. I’m sure the tools probably exist for Windows Vista also. See my blog on “How to create an Administrative shortcut” which will make your life a lot easier since the best practice is to log into your pc as a normal user (not as a user with elevated domain privileges).

Prerequisites:
(1) All of your existing active directory domain controllers need to be running Windows 2000 Service Pack 4 or higher.
(2) Your forest must be in at least Windows 2000 native mode.
(3) Verify your Antivirus and Backup agents will run on Windows Server 2008 R2 Server Core.

Copy the contents of the \support\adprep folder from the Windows Server 2008 R2 DVD to a location that is accessible by the schema master for your forest and the Infrastructure Master for each of your domains that you plan to update. The Schema Master is a forest level FSMO role (one per forest). How to identify the schema master article on TechNet. The Infrastructure Master is a domain level FSMO role (one per domain). How to identify the Infrastructure Master article on TechNet.

Log into the schema master as a user who is a member of the Enterprise Admins group and Schema Admins group. Open a command prompt and navigate to the folder where you copied the adprep utility. Run adprep32 /forestprep if the schema master is using a 32 bit version of Windows Server 2003 R2. Run adprep /forestprep if it is a 64 bit version. When the forestprep completes, you will receive the following message:

If all of your domain controllers are running Windows Server 2003 and your forest level is at the Windows 2003 level, then I recommend going ahead and preparing the forest for Read Only Domain Controllers by running adprep32 /rodcprep . When rodcprep completes you will receive the following:

Allow for the changes from the forestprep and rodcprep commands to propagate out to all of the domain controllers in your forest. You can use RepAdmin.exe to verify that the replication is complete. Run:
repadmin /replsum /bysrc /bydest /sort:delta and then repadmin /showrepl

Once the replication of the forest schema updates have completed to all domain controllers in your forest, login to the infrastructure master of each domain in the forest that will be updated to the Windows 2008 R2 level as a member of the domain admins group. Open a command prompt and navigate to the folder where you copied the adprep utility. Run:
adprep32 /domainprep /gpprep

If your domain is not at least in Windows 2000 native mode, you will receive the following error message:

Your forest and domains have now been updated so that you can introduce Windows Server 2008 R2 domain controllers. Since this blog focuses on migrating your active directory environment from Windows Server 2003 R2 to Windows Server 2008 R2 Core, you need to start with a fresh installation of Windows Server 2008 R2 on a new server. One thing to remember is that the R2 version of Windows Server 2008 is 64 bit only so you’ll need hardware capable of running a 64 bit operating system. Any server purchased in the last three years should be fine for the core edition since it has reduced hardware requirements, and in this example, I’m virtualizing the new domain controller using Hyper-V Server 2008 R2.

During the installation of the operating system, select one of the Server Core versions:

Once the installation of the operating system is complete, you are asked to change the password since the initial one is blank. Once this is complete and you log into the server, you notice the huge difference between the normal installation and core which only has a command prompt:

Run sconfig.cmd (which is only available on R2) from this command prompt to start the Server Configuration:

Set the computer name, configure the network settings, install windows updates, and add it to the domain. This process is much easier in the R2 version with sconfig instead of having to manually do everything from the command prompt.

To make this server a domain controller, Run:
dcpromo /unattend /InstallDNS:Yes /ReplicaOrNewDomain:Replica /ReplicaDomainDNSName:mikefrobbins.com /ConfirmGc:Yes  /UserName:mikefrobbins\administrator /Password:* /SafeModeAdminPassword:password /RebootOnCompletion:No

There are many more options for dcpromo /unattend. A list of these options can be found on TechNet. The following command will remove active directory services and revert the server back to a member server if needed.
dcpromo /unattend /AdministratorPassword:password

If you revert the domain controller back to a member server as referenced above, you’ll probably also want to remove the DNS Server role. To remove the DNSServer role, run:
Start /w ocsetup DNS-Server-Core-Role /uninstall

The oclist command will show you a list of roles that are currently installed.

Warning: You cannot manage a Windows Server 2008 R2 DNS Server from Windows Server 2003 R2. You will receive this error even though the DNS Server is operating properly:

To install the DHCP Server role on your core domain controller, execute the following command:
Start /w ocsetup DHCPServerCore

If you don’t use the start /w part of the command, it will still work, but it immediately returns you to a command prompt and you won’t know when the installation of the role has completed.

Set the DHCPServer service to start automatically:  sc config dhcpserver start= auto
Start the DHCPServer Service:  net start dhcpserver
Authorize the DHCPServer:  netsh dhcp add server dc102 10.0.0.2

Configure the remainder of the dhcp server options from another machine that has the GUI tools installed. Managing DHCP from a Windows Server 2003 R2 machine seems to work fine. Transfer the FSMO roles from your Windows Server 2003 R2 domain controllers before decommisioning them.

µ

System State Backup Failures with Symantec Backup Exec

December 17, 2009 µ Leave a comment

Problem:
You receive the message: “The job failed with the following error: A failure occurred accessing the object list.” in your backup job notification email when attempting to backup the system state of a Windows 2008 Server with Symantec Backup Exec. The actual error from the backup server job is: “e000fedd – A failure occurred accessing the object list.” and the error code is: “V-79-57344-65245”.

Solution:
This error is fairly generic and can be caused by several different problems; the issue I encountered was specifically due to using the combination of Trend Micro Worry-Free Business Security Advanced (Antivirus), Symantec Backup Exec 12.5, and Microsoft Windows Server 2008. To resolve this problem, stop the “Trend Micro Unauthorized Change Prevention Service” if it is running and modify the following registry settings on the server you’re attempting to backup:

Go to the following location in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TMBMServer

Change the value of “HomeDir” from:
“C:\Program Files (x86)\Trend Micro\Client Server Security Agent\..\BM”
To:
“C:\Program Files (x86)\ Trend Micro\BM”

Change the value of “ImagePath” from:
“C:\Program Files (x86)\Trend Micro\Client Server Security Agent\..\BM\TMBMSRV.exe” /service
To:
“C:\Program Files (x86)\Trend Micro\BM\TMBMSRV.exe” /service

The above example is from a machine running a 64 bit operating system and a 32 bit version of Trend. The beginning of the path should be the same as the original and may differ on 32 bit and 64 bit operating systems. Once these registry settings are updated, the system state backups should complete successfully.

For more information and for different problems that can cause this error see: http://www.symantec.com/business/support/knowledge_base_sli.jsp?umi=EvtID=V-79-57344-65245

µ