Jul
24
2008
I recently been playing around with Windows 2003 because we are still running Windows 2000 Server at work and may be upgrading soon. Our ASP pages are using includes to our database connection page…
<!–#include file=”some_folder/db_connection_file.asp” –>
If you were to run a page with that code on a Windows 2003 server, you may get an error similar to…
Active Server Pages error ‘ASP 0131′
Disallowed Parent Path
To fix this error, I had to do the following:
- Create a new virtual directory of the folder that contains the files. We’ll call the virtual directory “example”.
- Update the include syntax to use virtual instead. So you’ll have something like
<!– #include virtual=”example/some_folder/db_connection_file.asp” –>
You may get this error with javascripts as well if you have something like…
<script language=”javascript” src=”../some_folder/my_script.js”></script>
You should update that syntax to something like…
<script language=”javascript” src=”/example/some_folder/my_script.js”></script>
I’m not a big Windows user anymore so I don’t know why it has to be done this way or know of a setting so that the old method still works. But those are the 2 changes I had to make on some of our websites to make them compatible with Windows 2003.
Jun
16
2008
I recently found out how to install PEAR on a Godaddy shared hosting account.
- Visit http://pear.php.net/go-pear. Save the text displayed onto your desktop and name it go-pear.php. Upload this to your server. If you’re hosting multiple domains on the account, it’s best that you should upload this file in your root folder. Run this file on your browser and follow the on-screen instructions.
- After completing the installation, it is time to edit your php.ini file. If you are running PHP4, there should be a file in the root directory called php.ini. If you are running PHP5, there should be a file in the root directory called php5.ini. If not, create one and add the following: include_path = “.:/usr/local/php5/lib/php:/home/content/s/a/m/sample/html/PEAR”. Keep in mind that /s/a/m/sample is just an example. Doing this will ensure that every page, you create, will look in the PEAR directory so that you it will use the installed packages.
- This installation will include Pear_Frontend_Web which is the web-based admin interface. It may have created an index.php file in the directory where PEAR is installed (root). If not you can get a copy from PEAR/docs/PEAR_Frontend_Web/docs/index.php.txt. I would suggest creating a folder called pear_admin in the root directory and storing this file there. If you didn’t install PEAR in the root directory, you may need to edit this file accordingly.
- You will need to create a .htaccess and .htpasswd file in the same directory as the index.php file. An example of how the .htaccess file should look as follows:
AuthUserFile /home/content/s/a/m/sample/html/pear_admin/.htpasswd
AuthType Basic
AuthName “Web-based PEAR Frontend”
Require valid-user
An example of how the .htpasswd file should look as follows:
admin:cGyUX9QugYMgE
This will create “admin” as the user name and “password” as the password. You can generate your own by going to this link - http://www.htaccesstools.com/htpasswd-generator/
Be aware that files beginning with a dot are invisible. You may have to edit your settings on the FTP app you’re using so that you can see them.
Once the files are created and saved, you can now go to http://your-domain.com/pear_admin/index.php. It will ask for the user name and password. Once you are logged in, you can now manage Pear via web browser. That’s it! Now you can run PEAR on a shared account from Godaddy. One less complaint 
May
14
2008
For the past couple of days I’ve been trying to set up one of our XServe running Leopard Server at work for web hosting. I was able to configure the Web, AFP, and SMB properly. The problem I was having was configuring MySQL. It was easy to enable but trying to connect to it from other computers in the same domain was the problem. There’s a checkbox with “Allow network connections” in the Server Admin section of MySQL. So I checked it, save, and restarted it. I still wasn’t able to connect. I checked for firewall settings. I pinged the host and got a response. I couldn’t figure out what was wrong. So I googled it.
The common answer I found was to edit the /etc/mysql/my.cnf file. Well it’s not there but I did find a /etc/my.cnf file. So I tried editing that file and restarting. It didn’t work.
Then I remembered that the php.ini file that Leopard Server is using isn’t in the default location /etc/php.ini, but it ran the /private/etc/php.ini. So I looked in there and found another my.cnf file. I edited the file by adding # in front of skip-networking entry. I restarted it and it finally worked.
So here’s what you need to do:
- Go into Server Admin and check the Allow network connections and save
- Comment out the skip-networking entry from /private/etc/my.cnf
- Add the IP address of the computer you will be accessing MySQL remotely
- Give it the privileges it needs
- Restart MySQL
That should allow you to connect to MySQL running on Leopard Server remotely.
Feb
04
2008
We recently installed OS X Leopard Server at work. I had to take MySQL databases from our old Tiger Server and restore them onto the new XServes. Both servers are running MySQL Server version 5.0.45 but our Tiger server is running MySQL Client version 5.0.22 while our Leopard servers are running MySQL Client version 5.1.18. According to MySQL’s documentation (http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html):
Prior to release 5.0.48, this option did not create valid SQL if the database dump contained views. The recreation of views requires the creation and removal of temporary tables and this option suppressed the removal of those temporary tables. As a workaround, use --compress with the --add-drop-table option and then manually adjust the dump file.
I tried the –compress option but it didn’t work. I still had to manually adjust the SQL file. The I tried the GUI tool from MySQL, http://dev.mysql.com/downloads/gui-tools/5.0.html (MySQL Administrator).

Once you create the backup, you can restore it using the same application on the newer server. It will even include the views. Once you start using the newer client, you shouldn’t have a problem restoring databases with views from backups made with the mysqldump command.
Nov
17
2007
I’ve tried in the past to get .Net installed on one of my PCs. I always got errors after the install and just gave up. It’s only to get familiar with it. I usually have a Linux box as a web server anyway and we’re still using classic ASP at work. But as more projects come my way at work, I found using PHP to create different things that classic ASP can’t do. It’s not recommended but it’s a quick fix since many of the projects need to be finished ASAP. All of the sites we develop at work is written using ASP 3.0. But things like handling emails, exporting records to Excel, and uploading files can be created with more features using PHP. The transition between an ASP to PHP page isn’t something that you should do but was necessary for us to complete the project in time.
Why don’t we just develop in PHP or .Net? Well there’s a couple of reasons for that.
- Majority of our servers are Windows. In the beginning, the IT department wouldn’t support anything but Windows servers. But since they don’t support us anyway, and we do our own support, we can use pretty much any server OS we want. We do have 3 OS X servers that can run Apache.
- It would take a longer time to re-code already working web sites running ASP and MSSQL Server 2000 to PHP5 and MySQL or .Net. Not only do we have to re-code them, the testing would take just as long. We have to ensure that the sites work on both Windows and OS X platform and their supported browsers. It pisses me off so much going to a site that doesn’t work on the browser I use. So I make sure it doesn’t happen to any of the visitors going to the sites I develop.
- No money to purchase new Windows hardware/software. Although, our current Windows servers are running fine, if we were to start using .Net, it would be best to run it using the Windows Server 2003 and more hard drive space. We currently are running Windows 2000 Server and MSSQL Server 2000.
So I started to play with .Net again. Luckily we got our hands on Parallels for our iMacs. We can now test on different OS and server environments. I finally got to install .Net 2.0. I know there’s 3.0 and 3.5 releasing in the near future. But I want to do baby steps. So far I have been impressed. I have been having trouble converting a site from ASP to .Net. Particularly with the user authentication. I still have to figure out how the login page will query the database.
For now, I may just try to convert features I wrote on PHP to .Net and add them to the existing ASP sites so that the transition between the pages will be smoother, less of a security risk, and easier to manage.