pentestgeek / phishing-frenzy

Ruby on Rails Phishing Framework
www.phishingfrenzy.com
GNU General Public License v3.0
769 stars 293 forks source link

Multiple instances (production, development, test) on same server #375

Open mcjon3z opened 6 years ago

mcjon3z commented 6 years ago

Due to the way that the application names apache config files and file hosting directories based upon campaign ID, it is not possible to host both a development and a production environment simultaneously on the same server without one environment mangling the other. Duplicate ID numbers issued in sequence will affect the other instance to the extent that a change made on one environment happens to have the same ID number present in the other environment. Even if you use separate PF instances running out of separate directories, the apache config files still get mangled because of the store location.

One possible solution would be to change the location of the apache config files to reside in the PF directory and to add that directory as an include in the main apache config file as is done with sites-enabled. This would also keep from having to grant access to www-data to the sites-enabled directory.

zeknox commented 6 years ago

This is good call out. We can modify the name of the configuration files by adding in the current Rails environment to the filename.

2.3.0 :001 > Rails.env
 => "development" 

So I would imaging the filename would look something like: 1development.conf based on the Rails environment that is running.

mcjon3z commented 6 years ago

If you are going that route I would also use the same naming convention for the deployed campaign directories too. That would give you the option to have a test and production environment that is different databases but the same repo pull. Thats what I was originally trying to do - give a staff guy something to play with without having to worry about him messing with live campaigns or templates.