Banshee
the secure PHP framework

Forum

Installation

Rufus
17 april 2010, 16:21
Is it possible to install banshee if the function "system" is disabled as in most shared hostings?
Hugo Leisink
19 april 2010, 07:10
Yes, but you will have to do the things that database/setup_database does manually.
Rufus
19 april 2010, 17:35
Ok, I just needed to run the mysql.sql.
How can I change the basedir? I have the framework installed in a subfolder. (site: ***.n e t/banshee/public/... The links in banshee are: ***.n e t/.. ). In my productive site the other folders will be outside the webroot of course.
Hugo Leisink
19 april 2010, 23:43
You could use an alias. Both Apache and Hiawatha support aliases.
Hugo Leisink
20 april 2010, 14:01
You can also try using a rewrite rule. For Hiawatha, it will be something like this:
UrlToolkit {
ToolkitID = subdir
Match /(.*) Rewrite /public/$1 Continue
RequestURI exists Return
Match .*\?(.*) Rewrite /public/index.php?$1
Match .* Rewrite /public/index.php
}


But, my guess is that Apache is used for your shared hosting environment. So, you have to convert it to an Apache one (if that's even possible).
Rufus
20 april 2010, 20:40
Unfortunately I have no practise with Apache's htaccess configuration files. I will install hiawatha in localhost and setup banshee without subfolders (or your configuration). That will be much easier and I benefit from hiawatha.

Thanks for the support.
Ahcor Werdna
28 july 2011, 02:45
I had a quick question, which has a simple answer.
I have attempted to install Banshee PHP Framework on my Hiawatha server and I continue to get 404 - Error. I followed the installation guide "To install Banshee, unpack the zipfile to a suitable location. In your webserver configuration." So does that mean that I can install it "anywhere" and if so, are there any other steps besides using "rewrite rule" that you posted above, and what would create the 404 ERROR?

Thank you ahead of time.
Hugo Leisink
28 july 2011, 07:37
Yes, you can install it anywhere you like. Just point the DocumentRoot in your Hiawatha configuration to the right directory. Can you tell me where you installed it and can you show me the Hiawatha configuration you are using?
Ahcor Werdna
28 july 2011, 11:19
# GENERAL SETTINGS
ServerId = www-data
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /var/log/hiawatha/system.log
GarbageLogfile = /var/log/hiawatha/garbage.log
ExploitLogfile = /var/log/hiawatha/exploit.log

LogFormat = extended
ServerString = Apache
CGIwrapper = /usr/sbin/cgi-wrapper

# BINDING SETTINGS
Binding {
Port = 80
# Interface = 127.0.0.1
MaxKeepAlive = 30
TimeForRequest = 3,20
}

# BANNING SETTINGS
BanOnGarbage = 300
BanOnMaxPerIP = 60
BanOnMaxReqSize = 300
KickOnBan = yes
RebanDuringBan = yes

BanOnDeniedBody = 300
BanOnSQLi = 300
BanOnFlooding = 30/1:300
#BanlistMask = deny 192.168.0.0/24, deny 127.0.0.1

ReconnectDelay = 3

# COMMON GATEWAY INTERFACE (CGI) SETTINGS
CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/php-cgi:php
CGIhandler = /usr/bin/python:py
CGIhandler = /usr/bin/ruby:rb
CGIhandler = /usr/bin/ssi-cgi:shtml
CGIextension = cgi

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:6555
Extension = php, php5
SessionTimeout = 30
}

# URL TOOLKIT
UrlToolkit {
ToolkitID = banshee
RequestURI isfile Return
Match ^/(css|files|images|js)/ Return
Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
Match .*\?(.*) Rewrite /index.php?$1
Match .* Rewrite /index.php
}

# DEFAULT WEBSITE
Hostname = 11.111.11.11
WebsiteRoot = /var/www/z1s-us/banshee/public
StartFile = index.php
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi

# VIRTUAL HOSTS

Include /etc/hiawatha/enable-sites/

#VirtualHost {
# Include /etc/hiawatha/enable-sites/
# Hostname = z1s.us
# WebsiteRoot = /var/www/z1s-us
# StartFile = index.php
# AccessLogfile = /var/www/z1s-us/log/access.log
# ErrorLogfile = /var/www/z1s-us/log/error.log
# TimeForCGI = 5
# UseFastCGI = PHP5
# UseToolkit = banshee
#}

# DIRECTORY SETTINGS
# You can specify some settings per directory.
#
#Directory {
# Path = /home/baduser
# ExecuteCGI = no
# UploadSpeed = 10,2
#}


/etc/hiawatha/enable-sites/z1s.us.
VirtualHost {
Hostname = www.z1s.us z1s.us
WebsiteRoot = /var/www/z1s-us/banshee/public
StartFile = index.php
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
TimeForCGI = 15
UseFastCGI = PHP5
UseToolkit = banshee
DenyBody = ^.*%3Cscript.*%3C%2Fscript%3E.*$
ExecuteCGI = yes
PreventCSRF = yes
PreventSQLi = yes
PreventXSS = yes
DenyBot = Googlebot:/
DenyBot = twiceler:/
DenyBot = MSNBot:/
DenyBot = yahoo:/
DenyBot = BaiDuSpider:/
DenyBot = Ask:/
DenyBot = Yahoo! Slurp:/
DenyBot = Sogou web spider:/
DenyBot = Sogou-Test-Spider:/
DenyBot = Baiduspider+:/
DenyBot = Yandex:/
DenyBot = UniversalFeedParser:/
DenyBot = Mediapartners-Google:/
DenyBot = Sosospider+:/
DenyBot = YoudaoBot:/
DenyBot = ParchBot:/
DenyBot = Curl:/
DenyBot = msnbot:/
DenyBot = NaverBot:/
DenyBot = taptubot:/
WrapCGI = jail_mysite
}


I installed banshee inside /var/www/z1s-us/
Ahcor Werdna
28 july 2011, 19:24
I have managed to figure out my issue. I has a few typo errors, also I have ran into another issue.

#database/setup_database
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ps.ini on line 1 in Unknown on line 0
This script will create a MySQL user 'banshee' and the database 'banshee'.

Make sure the database settings in settings/website.conf are correct!

Enter MySQL root password:
PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50149 Library:50300 in /var/www/p-d0s/libraries/database/mysqli_connection.php on line 23
SQL query: create user 'banshee'@'localhost' identified by 'banshee'
Error message: Operation CREATE USER failed for 'banshee'@'localhost'
Error creating user

When ran again
--------------
# database/setup_database
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ps.ini on line 1 in Unknown on line 0
This script will create a MySQL user 'banshee' and the database 'banshee'.

Make sure the database settings in settings/website.conf are correct!

Enter MySQL root password:
PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50149 Library:50300 in /var/www/p-d0s/libraries/database/mysqli_connection.php on line 23
SQL query: create database `banshee`
Error message: Can't create database 'banshee'; database exists
Error creating database
----------------------

then i flush and delete db/user

--------------------------
MariaDB [(none)]> FLUSH PRIVILEGES; DROP DATABASE banshee;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES; DROP USER banshee;
Query OK, 0 rows affected (0.00 sec)

ERROR 1396 (HY000): Operation DROP USER failed for 'banshee'@'%'
MariaDB [(none)]>
-----------------------------

I continue to get the same error. Do you have any ideas that I can try out, or a problem solver?

Thank you.
Hugo Leisink
29 july 2011, 15:17
It looks like that MariaDB is not fully compatible with the PHP version you are using.
Ahcor Werdna
30 july 2011, 01:02
I found the fix, and i hope you don't mind me providing a link. http://kb.askmonty.org/en/installation-issues-with-php5.
I have managed to modify and get passed all the errors. Now I am having a "MYSQLi : Cannot connect to database" error.
Since you stated, MariaDB looks like it is not fully compatible with the PHP version that I am using. I will see if they "MariaDB" have any in site on my issue.

Thank you Hugo.

Just a quick question in general. Would you have any info on why I would receive "MYSQLi : Cannot connect to database"?
Hugo Leisink
30 july 2011, 12:04
Can you connect to the database using the same credentials while using the mysql command line tool?
Ahcor Werdna
4 august 2011, 22:37
Yes I can connect to mysql thew terminal. So I know that the problem is in a configuration file, maybe a syntax error. I'm getting another server online with the same setup, and if it is successful then I can compare files. Off of my rant. I have tired to create user/password/db and with no luck, I still have the same error.
Ahcor Werdna
6 august 2011, 03:12
I fixed my issue, it was due to MariaDB and a syntax error.
I can't post my error message it tells me "Message seen as spam."
failed to open stream: Permission denied in /var/www/pp-us/banshee/libraries/user.php on line 314.<br />

Any ideas? Thank you.
Message preview

The following BB-codes are available in a message:

  • [b]Bold text[/b]
  • [center]Center text or imagen[/center]
  • [color=color name or #RGB code]Colored text[/color]
  • [i]Italic text[/i]
  • [img]Link to image[/img]
  • [right]Align text or image right[/right]
  • [s]Strike-through text[/s]
  • [size=pixelsize]Big or small text[/size]
  • [u]Underlined text[/u]
  • [url]Link to website[/url]
  • [url=link to website]Link text[/url]