Monday, May 30, 2011

Converting .iso to .vmx

For those of you who do not want to download VMware converter or any of the other .iso to .vmx converters out there, I would like to suggest a hacking alternative to read an iso file from a CD using VMware. Consider the following .vmx file, as viewed by Notepad:

.encoding = "windows-1252"
config.version = "8"
virtualHW.version = "4"
scsi0.present = "TRUE"
memsize = "256"
ide1:0.present = "TRUE"
ide1:0.fileName = "livecd.iso"
ide1:0.deviceType = "cdrom-image"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "LiveCD"
guestOS = "otherlinux"
nvram = "otherlinux.nvram"

workingDir = "."
extendedConfigFile = "livecd.vmxf"
virtualHW.productCompatibility = "hosted"
floppy0.present = "FALSE"

All you need to do is copy the above file and save it as something.vmx. Everywhere you see livecd, simply replace it with the name of your file. It is really as simple as that... The "otherlinux" can be changed to "otherwindows" if you are trying to run a windows.iso file.

Monday, May 16, 2011

Setting up XAMPP for MySQL

So, now you need to set up your computer to do some MySQL work on--but when you try to create a new database by typing http://localhost/phpmyadmin/ you get the dreaded "error 403"... Simple answer--you need to configure your httpd-xampp.conf file, found under xampp/apache/conf/extra

At the bottom of the file, change the new security update to:

# New XAMPP security concept
#

Order deny,allow
Allow from all
# Allow from 127.0.0.0/8
# ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var


And it should work fine. How to work with the database from there, I leave to another time...

Tuesday, May 3, 2011

Viewing XAMPP HTML pages non-locally...

You have set up your computer as a server using XAMPP and can happily view your prize HTML page by typing http://localhost/XAMPP/myfile.html but what you REALLY want is to be able to type http://yourIPaddress/XAMPP/myfile.html to show your friends.

But saddly, XAMPP has decided to include a new security feature to block outside access... The only solution is to HACK the config file!

1. Right click your start menu
2. Locate your xampp file. The path to our hacking target is Apache/config/extra and the name of our target is httpd-xampp.config
3. In the file, comment out the following text like this:

# New XAMPP security concept
#
#Order Deny,Allow
#Deny from all
#Allow from ::1 127.0.0.0/8 \
#fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
#fe80::/10 169.254.0.0/16
#ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
#

Configuring Mercury in XAMPP

So you have finally reached the point in your programming life where you need to set up your computer as a webhost using XAMPP, and would like to configure Mercury 32 to interact with your SMTP server. This is easier said than done for many reasons--and there are many MANY tutorials out there claiming to hold a solution. Most end in the dreaded error 550, 503 or just leave you with messages that your server does not allow relays...

Assuming you have an SMTP server (if you do not, there is still a work-a-round test you can do that we will discuss later*) try the following configuration:

1. Start Mercury (using XAMPP).
2. Go to "Configuration" and then "Protocol modules"
3. Uncheck the "MercuryB HTTP web server" box.
4. Uncheck the "Mercury IMAP4rev1 server"
5. Uncheck the "MercuryE SMTP end-to-end delivery client"
6. Check the "MercuryC SMTP relaying client".
7. Click "OK" then restart Mercury
8. Open Mercury again and go back to "Configuration"
9. Go to"Mercury core module" and click the "General" heading
10. Since we want to send from our computer, we make sure that "localhost" is the value of "internet name for this system."
11. Uncheck all boxes except "Send copies of all errors to postmaster"
12. Look under the heading "Local domains." Make sure that "localhost (local host or server) localhost (internet name)" is added.
13. Click "OK"
14. Go back to "Configuration" and chose "MercuryS SMTP Server." Make sure you uncheck the "Do not Permit SMTP relaying to non-local mail" or you will get the dreaded 553 error that 'we do not relay mail.'
15. Open the "General" tab and name for your SMTP server under "Announce myself as." It does not matter what name you chose.
16. Under "Listen on TCP/IP port" enter "25"
17. Enter "127.0.0.1" to "IP interface to use."
18. Under "Connection Control" select "Add restriction" and enter the range "127.0.0.1" to "127.0.0.1" to restrict access to our server.
19. Check "Allow connections." All other checkboxes should be unchecked.
20. Click "OK"
21. Go back to "Configuration" and chose "MercuryP POP3 Server", select the "General" tab.
22. Under "Listen on TCP port" add "110"
23. The "IP interface to use" should be "127.0.0.1"
24. Open the "Connection control" tab and again select "Add restriction" and enter the range "127.0.0.1" to "127.0.0.1.
25. Click "OK"
26. Next go to"Configuration" then "MercuryC SMTP Client" This is the point where we need an external SMTP server. If you do not have one, never fear--you can still test your PHP email functions by setting up a resident SMPT server inside your machine. We will discuss this feature later on.
27. Enter the address of your SMTP under "Smart host name", for example "mail.comcast.com"
28. The fields below the SMTP depend on the way you access your server. The port is most likely 25. "Login username" and the "Password" are usually given to you by your webhost.
29. Next, go back to "Configuration" and then "Manage local users"
30. Make sure there are at least two users "Admin" and "postmaster", both set as admin.
31. Now we need to hack the php.ini file in XAMPP a bit. It should be at"xampp/php/php.ini" or "xampp/apache/bin/php.ini"
32. Inside the php.ini file search for "[mail function]" It should be about half way down.
33. Add "SMTP = localhost", "smtp_port = 25" and uncomment "sendmail_from = postmaster@localhost"
34. Save php.ini restart Apache

To test and see if Mercury's configuration worked, open up Mercury and from the file option, create a new email message...

And the work-a-round if you do not have an outside SMTP server or cannot get outside the network? Set up one on your machine! PostCast is a good free server that I use. It can be found at http://www.postcastserver.com/ Leave all settings the same in Mercury. PostCast will name your SMTP after your computer. Even if your network has blocked port 25 (which happened to me), PostCast will still capture your emails--and while it cannot send them if port 25 is blocked, it can allow you to see if Mercury is working, give you a testing ground to continue your PHP, HTML mail function development in the meanwhile...