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.
Hugo Leisink
6 August 2011, 08:57
Make logfiles/actions.log writeable for the webserver via chmod.
Ahcor Werdna
7 August 2011, 00:48
Thank you, that fixed my issue.
I have another question.
I am using the Hiawatha-Monitor, and it isn't displaying any info. I'm sure that I configured it wrong, but back onto my question.
When using "Virtual host" once you add "MonitorRequests = yes" is there anything more I need to add to make Hiawatha-Monitor work correctly?
Sorry but I have another question, and I guess it could be "try&see". i was wondering if "I" could combine both Banshee-PHP-Framework & Hiawatha-Monitor into the same dir, without getting errors, I know that's not in question form, but?
Ahcor Werdna
7 August 2011, 00:57
I apologize, this is the error Hiawatha-Monitor is giving me. When clicking Update hostnames via Hostnames.

/var/www/pp-us/monitor/models/admin/hostname.php on line 15.
Hugo Leisink
7 August 2011, 08:27
You also need to specify the MonitorServer (see this HOWTO).

Banshee and the Monitor in one directory? I don't understand your question. Why would you wanna do that? One would overwrite the other (the Monitor was built with Banshee).

What error are you talking about in your last post?
Ahcor Werdna
7 August 2011, 13:40
The requested page could not be found.
If you believe this is due to a bug in this website, please notify the webmaster. Click here to return to the homepage.

^^The link isn't working.

You answered my question, and I figured. It was just a random thought, nothing more.

This is the error.
Invalid argument supplied for foreach() in /var/www/pp-us/monitor/models/admin/hostname.php on line 15.
I am viewing /admin/hostname and it is a blank page. I setup "Webservers" I get that error, when I click the [Update housrnames]
Ahcor Werdna
7 August 2011, 13:44
Also, SlimStat is giving me error, page not found. Something is up with my Weblog also, I follow these steps. 1: create new weblog>2:save weblog, I receive [404 ERROR]. Any ideas?
Hugo Leisink
9 August 2011, 00:18
What UrlToolkit rule are you using? The one from the installation documentation?
Ahcor Werdna
9 August 2011, 03:19
Yes I am using the "URLToolKit" from the (installation documentation)
Ahcor Werdna
9 August 2011, 16:58
I did a full reinstall of Hiawatha + Banshee-PHP I continue to get the same error for SlimStat. Also I receive random 404 error message when I submit/SAVE. I'm not too sure if this info will help or if it even matters. I am running Debian Lenny on PPC. I followed most if not all of your "installation doc/s & HOWTO." I am trying my best to see if it is something on my end "server config" or who knows. Well thanks again.
Hugo Leisink
9 August 2011, 21:24
Weird. What are the URL's that cause the 404. Do those URL's always cause 404 or do they sometimes also work fine? What happens if you press F5 after a 404?
Ahcor Werdna
10 August 2011, 21:22
http://www.projectphaze.us/slimstat/ >> The requested page could not be found.
http://www.projectphaze.us/homepage >> As you can see I have errors, and the front page doesn't show up correctly.

But to answer your question about F5, it refreshes to a blank page.
I get 404 errors when modifying from [ */admin ] it doesn't happen all the time, but "randomly" and it's usually when I use a lot of "characters" ex. [ . < > { } / \ - ]
It seems as if it blocks my "Laptop". I have to run '/etc/init.d/hiawatha restart' on my server, in order to reach the [ */admin ] page, and or my whole site.
Hugo Leisink
11 August 2011, 00:12
Are you sure your server is ok?? Did the compilation of Hiawatha go well?

Remove all the banning options from your configuration file while testing. It could be that Hiawatha is banning you for some reason.
Ahcor Werdna
11 August 2011, 03:18
Yes my server is ok. I took it offline, sorry about that. Yes the compilation finished successful, and thank you for the info.

Okay here is my scenario: ( example )
Fresh Debian Lenny Install
Configure IPTABLES
apt-get install mysql-server mysql-client php5 ( are there specific php5-** packages that I should install ) ex. php5-cli?
(Then I follow your HOWTO/S)

Hugo Leisink
11 August 2011, 09:21
Try disabling as many options in your virtual host configuration as possible and see if it then works. Enable them one by one to see which option is responsible for the problems.

I'm sorry I can't give you a direct answer. I've used Banshee and Hiawatha myself for a lot of servers and websites. I never had much problems and certainly not the ones you described.
Ahcor Werdna
13 August 2011, 12:55
Thank you for all your help. With the help of you and another I managed to work threw my issues. It was in my php.ini file
Suman
7 May 2017, 21:17
Can anyone let me know the complete setup because I am able to access the url on local as below but with error as the module
http://localhost:8080/banshee/public/

But once I am trying to access the below url I am always redirect to XAMPP dashboard page.

Please, help me asap...
Hugo Leisink
8 May 2017, 00:17
Banshee should not be installed in a subdirectory of a website. Make the root of a hostname point to the 'public' directory.
Suman
8 May 2017, 08:46
Hi Hugo,
I am with XAMP Server and the directory path as below:
E:\xampp\htdocs\banshee

I am able to access with below url
http://localhost:8080/banshee/public/

but, the below url redirects to the xamp dashboard
http://localhost:8080/banshee/public/cms

"Make the root of a hostname point to the 'public' directory" can you please help with this statement?
Hugo Leisink
8 May 2017, 23:18
The 'public' directory should be the DocumentRoot.