Go Back   iPod touch, iPhone, and iPad forum - Multi-Touch Fans > Jailbroken iPod touch / iPhone > Jailbroken iPod touch Games and Apps

What are you waiting for? Join the hundreds of thousands of other iPod touch and iPhone users in our community. Talk about the latest apps and accessories, or post your question on the forums! All visitors must register before they can post and answer questions and participate in our lively community, so register for free today!
Reply
 
Thread Tools Search this Thread
  #1  
Old 10-12-2007
Multi-Touch Amateur
Join Date: Oct 2007
 
Talking Tutorial: Apache Webserver With PHP 5.2.3!

Hey all, this is actually my first post on these boards, have found alot of great help and tips here, so just thought I would pass on my newest achievement. I have managed to successfully get Apache working with PHP. It is pretty painless to do, and is very cool once you have it all setup!

First off, make sure you have jailbroken your Ipod Touch, and have installed the app installer. Make sure you have the Community Sources installed or you will not be able to install Apache or PHP.

Installation of Apache

This is pretty painless.

First, install from the app installer the apache package. Once installed it will look as though nothing was installed (There is no icon added to the app list).

Reboot your Ipod Touch, and open a safari window.

Type: http://127.0.0.1/

You should be greeted with an apache welcome screen! Congratulations, you now have Apache on your Ipod Touch!

Installing and Configuring PHP

Installing PHP is a bit tougher but its not that bad.

1) Download the package through the App Installer, after installation it will give you the path to PHP. It should read: /opt/iphone/bin

2) Using winscp, or another sftp client ftp into your ipod touch (You should be able to do this if you have setup the ssh/sftp for jailbreaking in the first place). Open the following file for editing: /etc/httpd/httpd.conf.

Once you have the conf file open search for: <IfModule mod_alias.c>

Somewhere within this if add the following (I added it to the end right before the endif)

Code:
ScriptAlias /php /opt/iphone/bin
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi"
Save the conf file and reupload it.

3) Now using your sftp client download and edit /etc/profile

Add the PHP Path to the path details, after your done the PATH line should read:

Code:
PATH = "/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/opt/iphone/bin"
4) Create a php file on your pc named index.php and add the following code to it:

Code:
<?php

phpinfo();

?>
5) Upload this file to Library/WebServer/Documents/. This is your apache web directory for your new server.

Restart your Ipod Touch again.

6) Fire up Safari again, and this time navigate to: http://127.0.0.1/index.php

You should now see a php information page with details about your PHP build information! Congrats, you now have a functioning Apache Webserver with PHP scripting Support on your Ipod Touch! How cool is that?

For those who like commands, heres some basic commands to run your server through shell.

Download Term-vt100 through the installer app - The best shell app for the Iphone/Ipod.

Use the following commands to do various things to your server:

apachectl start
->This starts the apache service and loads the httpd.conf file.

apachectl restart -> This reloads the apache service, and will reload the httpd.conf file. Useful if you make changes on the go and wish to restart apache without having to reboot.

apachectl stop -> Stops the apache server.

I hope it all works for you, if not please let me know and I will fix the tutorial, It is however working fine for me! Goodluck!
__________________

Last edited by Tristan; 10-12-2007 at 09:35 PM..
  #2  
Old 10-12-2007
THCue's Avatar
Multi-Touch Admirer
Join Date: Sep 2007
 
None
2.2 jailbroken
Very Nice man!
  #3  
Old 10-12-2007
THCue's Avatar
Multi-Touch Admirer
Join Date: Sep 2007
 
None
2.2 jailbroken
Anyideas for a defualt webpage am still thinking what am gonna make.
Sponsored Links
  #4  
Old 10-12-2007
Multi-Touch Admirer
Join Date: Sep 2007
 
what is this apache thing and what are the advantages of having it on your ipod touch???
  #5  
Old 10-12-2007
Multi-Touch Admirer
Join Date: Sep 2007
 
please explain in noob english and not hacker language
  #6  
Old 10-12-2007
Multi-Touch Amateur
Join Date: Oct 2007
 
The website you are on right now is probably hosted by an apache web server, and is being served to you through PHP which is a scripting language. If you Do not know what either of them are, then you probably dont need to install them .
  #7  
Old 10-12-2007
THCue's Avatar
Multi-Touch Admirer
Join Date: Sep 2007
 
None
2.2 jailbroken
Imagin having a php scipt to host mp3s on your ipod or pics or even a youtube site on your ip so when you goto a hotspot your friends can view your site on your ipod ect its endless really take a lok here just a start.

http://www.scriptsbank.com/PHP_Scripts/index.html
  #8  
Old 10-12-2007
THCue's Avatar
Multi-Touch Admirer
Join Date: Sep 2007
 
None
2.2 jailbroken
15,000 here
http://www.hotscripts.com/PHP/index.html
  #9  
Old 10-12-2007
Multi-Touch Admirer
Join Date: Sep 2007
 
how do u create a php path on ur pc
  #10  
Old 10-12-2007
swedishviking's Avatar
Multi-Touch Fan
Join Date: Sep 2007
 
Nice! I installed PHP pretty much the minute I got access to the Installer.app 2 days ago hehe.. It was very tempting to see it in the list .. Lovely to be able to write your own PHP shell scripts to execute on the touch.. I see TONS of possibilities Already have a few cool scripts that I might share soon.

I didn't want to install Apache just yet but this thread sure got me wanting.. And so of course I went ahead and did it:




Great stuff and I'm really looking forward to tinkering with it all weekend long..
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -7. The time now is 02:31 PM.

Recent blog posts: Recent threads:

Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 2007 - 2010 Vigorous Media LLC - All Rights Reserved.


no new posts
Page generated in 0.05577 seconds with 10 queries