Ok, so what do you do when a site that was based on asp.net is converted to a Linux box and your product shipped with links to sites such as http://our.home.page/index.asp and many other .asp or aspx sites?

Should you migrate your code to php or ruby or another open source language? Sure, maybe

If you choose not to go with mono at this point because it might be easy to re-write your code in php or ruby or any other open source language, especially if you are doing nothing more than echoing html code after performing simple calculations.

I haven’t tested it yet, but you may get a lot of the asp code automatically converted using this tool: asp2php

What about the fact that unchangeable links to my pages end with .asp or .aspx entensions? It doesn’t matter what the file extension is, you can have that file extension handled by any scripting language. For example, to configure Apache to have php handle .asp or aspx file, you can follow the steps below.

If you have an index.asp file that should automatically be served by default, it is probably not in the list of files to serve by default, which is probably just index.htm and index.php. You can either rename index.asp to index.php or modify the httpd.conf to include the index.asp file. These steps assume you are changing the httpd.conf.

Copyright ® Rhyous.com – Linking to this page is allowed without permission and as many as ten lines of this page can be used along with this link. Any other use of this page is allowed only by permission of Rhyous.com.

I have previous documents about installing each of the steps above installing dotProject. Once you have gone though the above documents, you will be ready for this document. This document will only cover dotProject.

Installing dotProject 2.1.2 from Ports

Install dotProject from ports using one of the following commands (I use the first one when doing virtual hosts and the second one when just using sub directories of the web root).

# #

cd /usr/ports/www/dotproject make install

Note: If you Apache directory is /usr/local/www/apache22/data you may want to use this make command:

Create a database in MySQL for dotProject. Name it whatever you want. For this example, I am going to name the database dotProjDB. If you have read the articles about MySQL that I referenced above, you should know how to log into to MySQL, but just in case you forgot, I will show you again.There are lots of ways to create a database in MySQL, and I am going to give you one example using the shell and the MySQL client.

#

mysql -u root -p

Enter your password and you should be taken to a mysql prompt.

mysql>

create database dotprojdb

Yes it is that simple. And at the same time no it is not that simple. There is a lot more to know such as where to put the database files and how fast of drives you need, whether you need faster read speed or faster write speed or both, but this will suffice for now.

Create a mysql user account for this database. We don’t want to user the root account. See this page in the MySQL documentation for more information on this: Adding User Accounts

mysql>

CREATE USER ‘dpuser’@’localhost’ IDENTIFIED BY ‘P@sswd!’;

Query OK, 0 rows affected (0.01 sec)

mysql>

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON dotprojdb.* TO ‘dpuser’@’localhost’;

Query OK, 0 rows affected (0.01 sec)

Now open a web browser to your server’s site: http://yourserver/dotprojectYou will see the following page.

No need to do anything on this page because it should redirect you after 5 second to a dotProject configuration web page.

Now some of the items in red need to be taken care of. Not all of them, just some of them.

The first group of items are “Requirements” and anything not with a pretty green check mark under the “Requirements” section needs to be fixed.

However, under the “Database Connectors” section, there are lots of red Xs. We don’t need to fix these. We just need one database, so as long as the database you want to use (in this example it’s MySQL) has a pretty green check mark, you don’t need to do add more “Database Connectors”.

Fix the first error: Session Save Path writable? X Fatal: session.save_path is not setTo do this, follow these steps:

Change to the directory that contains the php.ini file. On FreeBSD that directory is here: /usr/local/etc

#

cd /usr/local/etc

Now by default the PHP5 port on FreeBSD doesn’t install a php.ini file, but instead provides two example php.ini files: php.ini-recommended and php.ini-dist. So copy one of them to php.ini.

#

cp php.ini-recommended php.ini

Edit the php.ini file and remove the comment from this line:

;session.save_path = “/tmp”

I use ee which is the command to open Easy Editor. But you can use vi or whatever.

Save the file and exit.

The other issue is this one: Session AutoStart = ON? X Failed Try setting to ON if you are experiencing a WhiteScreenOfDeathOk. So this issue is fixed is in that same php.ini file. So repeat the steps only this time we don’t remove a comment, we change a setting from 0 to 1. Find the following line and change it from 0 to 1, as shown.

session.auto_start = 1

Restart apache. This is required and must be done before these settings will take effect.

#

/usr/local/etc/rc.d/apache22 restart

Now you are ready to click the “Start Installation” button. So go ahead and click it. The following page should appear.

Enter the details as shown in the page. Hopefully you have your own database user and password to use.

Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

Note: Make sure you choose the correct install directory for the BUGZILLADIR parameter. By default Apache 2.2 is only serving up files in /usr/local/www/apache22/data/ so by install bugzilla there, you will be able to access bugzilla with this url: http://www.YourWebSite.com/bugzilla

You will be asked to select your compile options throughout. If you don’t want to be promtped, and you want to accept the defaults, use this command.

ServerName#

make BATCH=yes install

Now that you have Bugzilla 3.4.2 on your FreeBSD 7.2 server, you are not finished. We now need to connect to connect it to a database, which I am assuming is MySQL but could just as easily be Postgresql.

Resetting the file ownership recursively on the bugzilla folder

Make sure that the bugzilla folder and all subfolders are owned by www:www.

ServerName#

chown -R www:www /usr/local/www/apache22/data/bugzilla

Creating a MySQL Database

Log into mysql. I use the command line and type in mysql -p, enter my password when prompted.

Note: If you have installled everything including MySQL using the defaults, you will see this warning:

WARNING: You need to set the max_allowed_packet parameter in your MySQL configuration to at least 3276750. Currently it is set to 1048576. You can set this parameter in the [mysqld] section of your MySQL configuration file.

You should now be able to connect to your server: http://YourServer/bugzilla

Copyright ® Rhyous.com – Linking to this article is allowed without permission and as many as ten lines of this article can be used along with this link. Any other use of this article is allowed only by permission of Rhyous.com.

In order for Apache to use SSL, you must create a certificate. Now you may or may not know how to create one. I have made it easy for you by doing everything in a shell script. I have used SHA-256, because in this day an age, you need higher security than MD5 or SHA1.

This is NOT a fully functional shell script that shows you the command line options and everything. It is really just a list of commands to make this easier for you. Copy this to a shell script and run it. It takes one parameter, the cert name and you should call it like this:

./makesha256key.sh certname

IMPORTANT: The commands in the script will prompt you for a Certificate password, and your Certification information. The only thing you need to make certain of is that when prompted for the “Common Name” you use the URL. For example, if your web site is www.rhyous.com, then www.rhyous.com is your Common Name.

Or you can run the commands from the shell script manually one at a time if you want (replacing $1 with your desired certificate name).

Note: In this script, the certificate will be a self-signed certificate, but you can get a signed certificate free here: http://cert.startcom.org

Now configure Apache to read the httpd-ssl.conf file when it starts.

Open the /usr/local/etc/apache22/httpd.conf using the easy editor or ee.

#

ee /usr/local/etc/apache22/httpd.conf

Near the end of the file, remove the comment symbol, the # sign, from the following line:

Include etc/apache22/extra/httpd-ssl.conf

Note: While you are in this file you may want to remove the comment from the line for enabling Virtual Hosts too if you are going to have multiple URLs hosted at this page.

Configure the httpd-ssl.conf.

#

ee /usr/local/etc/apache22/extra/httpd-ssl.conf

I only change the two lines to point to the correct certificate. Here is an sample httpd-ssl.conf without the comments.

My other blogs

Entries (RSS) and Comments (RSS). Copyright ® Rhyous.com Linking to content on this site is allowed without permission and as many as ten lines of any article can be used along with such link. Any other use of the content is allowed only by permission of Rhyous.com.