Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: bloodshoteye on October 09, 2008, 09:26:48 AM

Title: Solved!! - Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 09, 2008, 09:26:48 AM
Hi all,
After searching the forums on web-based software in ibays and opt, I'm a bit confused on this point:
I need to allow WebCalendar to write secure data to a directory in /opt (over and above what it generally writes to in MySQL).

WebCalendar (PHP based) is currently a sub-directory in Primary for ease of use.
Thus I need http://myserver.com/webcal to write to /opt/webCalPrivate
I've made www the group for /opt/webCalPrivate and set perms to 777, but it's not seen by WebCalendar.

Any tips/pointer's, please?
Regards and thanks for your help,
Title: Re: Web app in Primary write to /opt
Post by: mmccarn on October 09, 2008, 02:35:24 PM
My first guess is that you need to add a line something like the one below to the template-fragment for http://myserver.com/webcal
Code: [Select]
  php_value open_basedir /opt/webCalPrivate
Title: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 09, 2008, 04:16:34 PM
mmccarn - thanks for reply.

I've just noticed that the web app (installed as a sub-directory in Primary) is exposing setting info to the local LAN and to the world. I moved it to /opt This means my original question is no longer applicable.

What I have to figure out is how to link to /opt/webcal from the website in Primary (the website is static html maintained by the webmaster). The calendar will be accessed via http://myserver.tld/webcal
OR, just thinking, move the whole lot into /opt and put a redirect in Primary.
I wonder what is easier or better practice.
Title: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 10, 2008, 09:44:58 AM
May I rephrase my question?

Apologies - I'm not always able to ask the correct thing from the beginning, so I've also changed the subject line. Hope I'm not blasted for that  :???:
In particular I'd like to thank mmccarn for responding, but I've moved the goal posts - sorry to have wasted your time, mmccarn.

I moved our on-line events calendar, WebCalendar, into /opt because it appears that it's settings.php file allows anyone to see the db settings and it needs a secure location to write private data.
It's not a contrib, is PHP based with a MySQL db and has no template fragments.

Briefly:
We access our egroupware like this: http://myserver.co.za/egroupware
Primary therefor has:  PHPBasedir=/opt/egroupware/
We would like to keep this arrangement, if possible.
We also have a static html website in Primary: http://myserver.co.za

What we need to do is link http://myserver.co.za to the PHP based WebCalender in /opt/webcal
After searching the forums extensively, I more confused today than ever before...
Would someone please be kind enough and explain how I can do this?

Thanks,
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: janet on October 10, 2008, 11:33:09 AM
ardugh

The following links have all the information you should need.
You will have to read them and apply the concepts to what you exactly want to achieve.

http://wiki.contribs.org/Web_Application_Redirect_Tutorial

http://wiki.contribs.org/Web_Application_RPM

http://wiki.contribs.org/SME_Site_Maker

Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 10, 2008, 02:54:39 PM
mary,

Thanks very much for the pointers.
I've read them more than once, but must admit I find it overwhelming, actually.
I have incorrectly assumed I have common, relatively easy task and that someone would kindly walk me through it.
It's not that I didn't bother to do any research or even try the many suggestions in the forums and wiki - I have, all unsuccessfully.
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: janet on October 10, 2008, 10:58:53 PM
ardugh

Quote
I've read them more than once, but must admit I find it overwhelming, actually.

No-one here asked you to use or support sme servers, it was your choice.
If you find it too difficult then perhaps you should pay someone who knows what they are doing.


Quote
I have incorrectly assumed I have common, relatively easy task and that someone would kindly walk me through it.

Yes you have, most of your requirements have been of a non standard type, ie wanting to implement things in an unusual fashion.
Whilst not necessarily impossible to do, they do take some time to work out. In many cases they have been particular to your situation, so you cannot expect other people to do the working out for you, and post the precise & simplified answer to all your questions.

Links to information were provided that should assist you to work out what you want to achieve.
Why are you expecting others to do the work for you ?

The wiki article first referred to clearly tells you how to create a complete domain/website in /opt
There is a good answer, what's wrong with that ?
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: grattman on October 11, 2008, 03:51:32 PM
Wow.....I have read only two posts this morning and in both mary has been on attack mode.

This is unfotunate becuase SME is such a great piece of work and forums are the life-blood that help novice and expert alike expand upon it over time. However, it seems that mary has deemed herself the all-knowing, and if an intermediate user such as myself had a question, I should find another product or hire some pompous ass such as her to help me.

I would really like for the moderators to set the level of obnoxious demeaning comments to people asking legitimate questions at a lower level.

Not all of us live, eat, and breathe SME. While the documentation is very concise, at times it can be difficult to understand if you are missing some small step form another how-to.

So please, mary and other responders, re-read your post as it pertains to the subject before launching a verbal assault on someone for asking a question. Keep in mind, you were not born with all of your SME knowledge, you too asked questions along the way.

Grattman
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: Igi2003 on October 11, 2008, 09:11:41 PM
Hello,
this is very easy to make. Copy you WebCalPrivate Files from the primary directory to your /opt/... directory. Go to /etc/e-smith/templates/etc/httpd/conf/httpd.conf Directory and create file "98WebCal". Open the File with vi oder mcedit and
type this in...
Code: [Select]
Alias /webcal /opt/WebCalPrivate
<Directory /opt/WebCalPrivate>
    AddType application/x-httpd-php .php .php3 .phtml
    Options None
    order deny,allow
    deny from all
    allow from all
    php_admin_value open_basedir /opt/WebCalPrivate/:/tmp/
</Directory>

<Directory /opt/WebCalPrivate/cache>
    <Limit GET POST PUT>
         Order Allow,Deny
         Deny from All
    </Limit>
</Directory>

If the Calender needs mysql, please configure your *.php.inc file and set the Username in Database

Don“t forget signal-event post-upgrade and reboot
regards Igi
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: dgs on October 12, 2008, 12:08:46 AM
I'm not sure if I've missed something here but wouldn't the simple solution be to just create a simple index.html or index.PHP page in the primary site which links or auto re-directs to your PHP application?

Use the SME-sitemaker contrib to create the web folder under /opt and all the necessary templates are correctly created for you with your SME intact.   
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: Stefano on October 12, 2008, 12:21:14 AM
Go to /etc/e-smith/templates/etc/httpd/conf/httpd.conf Directory and create file "98WebCal".

I think OP has to go to  /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf Directory and create file "98WebCal"

Ciao
Stefano
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 12, 2008, 12:55:04 AM
grattman, Igi2003, dgs and nenonano thanks for your interest - I will reply in another post (this post must stand alone in this thread).

I'm actually in high spirits, despite mary's rather barbed reply to my question.
It's always better to walk away from such a response and come back much later -
when the heat is gone.
She's entitled to her opinion, whether I or any one else agrees with it or not.

I apologize for the length of this post, but feel the need to (?defend?) my question??
Please don't bother to read it if you are busy.

At the senior school in SA where I'm fortunate to have employment (read the news lately?),
I work on my own, am self taught on PC's, networks and linux. I have no-one to network with
apart from user-friendly forums. I'm not a spring chicken - I used a slide rule and log tables
in my last year at senior school for heavan's sake.
We are a community school relying on dwindling school fees and lack of governmental support.

Why should I have the need to write all this stuff on a user's forum where we all use the same product with enthusiasm, seeking to assist one another in a co-operative way?
I'm encouraged by the responses that followed mary's reply - apart from individuals, who may be having a bad day, there are many others who are willing to assist the likes of me - trying to do my best in an islolated way.
There are no SME admins in our part of the world, and we could not afford to pay them anyway - the average linux support here is R600 to R700/hour, which probably doesn't mean much to those earning dollars or euros. It's just under 10% of a new teacher post at the school, though.
Thus we work out our own issues, and ask (always respectfully - see above) for help from the forum, from time to time.

I have received much good advice in the past and will continue to use the forum.  Grateful thanks to all.
We (by choice) use SME since v7.0, and have been recommending it to others since then.
It's superior in almost every way to other contenders and many thanks are due the dev teams and tireless workers striving to improve our experience.




Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: byte on October 12, 2008, 02:11:04 PM
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
Title: Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: Igi2003 on October 12, 2008, 09:09:37 PM
Quote
I think OP has to go to  /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf Directory and create file "98WebCal"

Ciao
Stefano

Sorry, it schuld mean "templates-costum", but in templates directory, it works too.

regards Igi
Title: Solved!! - Re: Make website in Primary Link to "non-contrib" PHP app in /opt
Post by: bloodshoteye on October 13, 2008, 12:57:31 AM
Solved!

Here's what transpired:
Firstly, thanks to all who responded to my revised question. I used a combination of Igi2003's and nenonano's  advice.
I had to create a new (empty) line after the last line of Igi2003's code like this
Quote
...
</Limit>
</Directory>
                       << new line (hope I make sense)
to stop this error:
Quote
# Starting httpd: Syntax error on line 1322 of /etc/httpd/conf/httpd.conf:
</Directory>#> directive missing closing '>'
What happened was the generated httpd.conf had one concatenated line, something like:
Quote
...
#Webcal stuff here
<Directory>
...
</Directory># Start of Openfire details
...
and it should be like this:
Quote
...
#Webcal stuff here
<Directory>
...
</Directory>
# Start of Openfire details

...

For those interested, I untarred a cvs version of WebCalendar in /opt/webcal, and removed the older (sub-directory) version out of Primary.
I also created /opt/webcalcache, amending Igi2003's code to reflect that.
It works - I was able to run the web-based install script via http://myserver.tld/webcal, login via a web browser, make some calendar edits that survived a logout and re-login.

Thanks to the templating code and advice provided by Igi2003 and nenonano, we have a working events calendar.
Greatly appreciated.