Setting up a development site


Contents



1Set up a development site
1.1 A local development site
1.1.1 On Windows
1.1.2 On Linux
1.2 A public development site
1.2.1 .Htaccess protect the dev site
1.3 Further references


Set up a development site


Not an easy topic, but if you're here you want to make things right from the start.
Some of the benefits of having a development site is that you get to test first hand if any change you plan on making will break anything, will look how you want it, etc.

There are two types of development sites depending on your needs and possibilities


A local development site


If you are just one developer or site owner (not a team) then a local set up is usually a good start. You dont need to share your code changes with anyone else or report anything to anyone but you.


On Windows


The first step is to have a local web server. While you can download Apache, Php and MySql separately there is really no need for this and our recommended approach is to just download and install XAMPP.
Assuming the installation went fine your public documents' folder will sit on C:/xampp/htdocs This is where you want to put your local files and the phpfox script.

Since you used XAMPP you should now already have a working web server, you can proceed with the normal Phpfox Installation instructions


On Linux


You will need several packages installed, Apache + Php5 + MySql 5.
If you are on debian you can try the following command:



~$ sudo apt-get install apache2 php5 php5-curl php5-gd php5-mcrypt php5-imagick php5-mysql php5-ffmpeg mysql-server phpmyadmin ffmpeg

I may have left some packages out but this should prompt to install any dependencies, let me know if theres any missing so I can add it. (mcrypt is needed for phpmyadmin and curl and gd for phpfox).

You will be required to enter a password for the root user in MySql, do NOT lose this password, it is very important and powerful.

More complete guides on how to set up a LAMP can be found on howtoforge.

If everything went fine you should now have a working server, if you point your browser to http://localhost you will get an Apache page saying everything is ok.

Now we want to have Apache set up so if you browse to http://development.mysite.com it will show your site in your local computer. This does not mean we are going to install the script right now, only tell Apache that when you look for development.mysite.com it should look for the local computer and not a site from the internet.

So open the file /etc/hosts and add an entry like this:



127.0.1.1 development.mysite.com

(The distance between both items is exactly one tab.)

Now you need to tell Apache that when someone looks for development.mysite.com they're looking at a specific folder, you do this by editing the /etc/apache2/httpd.conf file, by default it may look like this:


 ServerName localhost 

you want to change that for this:



# ServerName localhost
<VirtualHost *>
DocumentRoot /var/www/mysite.com
ServerName development.mysite.com
</VirtualHost>

Keep in mind that with this redirection you can even "replace" your internet site, you can have it so if you go to mysite.com it would look for a file in your local computer so be careful not to mix them here, we are using a prefix (development.) to keep everything in its place.

After this you need to restart apache:
try this:


/etc/rc.d/rc.httpd restart

If it doesnt work you dont have a debian machine, so this should do:


service httpd restart

You should now be able to access your local site by going to http://development.mysite.com

You can now continue with the Phpfox Installation instructions. Keep in mind though, that your license needs to be set up to point to your real domain, the "development" part is allowed by the Benc Enterprises license agreement.


A public development site


This is good if you work with a team or just want to have your dev site publicly.
Using an FTP client (like FileZilla) connect to your site and go to the public folder, this is usually "public_html" or "httpdocs". In there, create a new directory called:
development

You can now follow the Phpfox Installation instructions applied to this subfolder. The script will not be shown on your main site.


.Htaccess protect the dev site


Since it is a development site you may want to hide it from everyone, this is fairly easy to do and you can use this site to generate the 1 file that you need, the htpasswd
http://www.yellowpipe.com/yis/tools/htaccess_gener...

Yes, the site will tell you to download and upload two files, but you only need the htpasswd. Upload that one and rename it to:
.htpasswd
Now open your existing .htaccess and add the following to the beginning of it:


AuthUserFile /.htpasswd

AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>

That should do it, if you ever lose your password (we hope you dont) you can generate a new one from that site and replace your .htpasswd, the .htaccess does not need to change.


Further references


  1. http://www.heritage-tech.net/336/setting-up-multip...
  2. http://www.yellowpipe.com/yis/tools/htaccess_gener...




Comments
Only verified clients can post comments on our community. If you have any questions feel free to contact us here.
Victor Lau wrote at April 12, 2012, 7:04 pm
0 Votes

Hi there, adding:

AuthUserFile /.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic
<limit GET POST>
require valid-user
</limit>

in the .htaccess file does not work. Perhaps this article needs to be updated for 3.1?

Victor Lau
Raven Rosario wrote at November 1, 2011, 4:36 pm
0 Votes

Phpfox Installation instructions under the "A public development site" title doesn't work - http://www.phpfox.com/guide/V2/Install

Raven Rosario
jd1 wrote at June 22, 2011, 5:30 am
0 Votes

Just set up development site using MAMP Pro for Macintosh (MacbookPro quad core i7)... it doesn't get any easier! I do second VBT's comment regarding addendum to the install instruction of the need to create a database prior installation. Also, Filezilla 3.5 is an excellent FTP client for the new Macs.

jd1
Linus wrote at June 16, 2011, 4:23 am
1 Vote

On Windows

.......... just download and install XAMPP.

If donloading the default software, you might need to enable curl. This is done by opening \xampp\php\php.ini in an text editor.

Find the line:

;extension=php_curl.dll

And remove the ;
Save the document and restart the Apache service.

Linus
SociBite wrote at June 14, 2011, 2:06 pm
0 Votes

Hello,
If we want to setup a development site online for our testing do we need to purchase another license?
Thanks

SociBite
amusic wrote at June 7, 2011, 9:04 pm
0 Votes

The link still doesn't work, and i have tried everything i could to get going with my dev site, i have followed the instructions under the license guide for development testing ask per the instruction it indicated that the subfolder should be phpfoxdev or development folder name, that doesn't work

amusic
ich-bin-daheim wrote at February 1, 2012, 8:08 am
0 Votes

They don´t care about this .. incredible how they do ignore everybody ...this link does not work since months!!!!!!!!!!!!!!!

ich-bin-daheim
GB wrote at April 17, 2011, 5:24 am
0 Votes

What about doing a development site on Apple OSX Snow Leopard?

GB
Purefan wrote at May 6, 2011, 6:42 am
0 Votes

I dont have an Apple computer so haven't ever done it there, this might help though:
http://www.mamp.info/en/index.html
http://danilo.ariadoss.com/how-to-setup-apache-php...

Most of the linux part may work on OSX (both based on unix) but like I said, I haven't tried it

Purefan
i wrote at March 21, 2011, 7:24 pm
0 Votes

Phpfox Installation instructions link is dead? Where can I find the instructions to set up an development site?

i
Purefan wrote at May 6, 2011, 6:41 am
0 Votes

Updated the link

Purefan
moxsevero wrote at December 21, 2010, 6:52 am
0 Votes

Under A local development site, "Phpfox Installation instructions" link is dead.

moxsevero
aleingan wrote at November 29, 2010, 1:51 pm
0 Votes

In the "public development site" section of this article - the "You can now follow the Phpfox Installation instructions applied to this subfolder" link is dead.

Last Update on December 7, 2010, 1:42 am by aleingan
aleingan