Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: mflammia on May 16, 2011, 10:40:03 PM

Title: Mod_rewrite not working possibly due to web app redirect?
Post by: mflammia on May 16, 2011, 10:40:03 PM
Hi,

Currently having a little trouble trying to get mod_rewrite to work. Not sure if this is to do with the modicifation I have done with the web application redirect tutorial as in this contrib

http://wiki.contribs.org/Talk:Web_Application_Redirect_Tutorial (http://wiki.contribs.org/Talk:Web_Application_Redirect_Tutorial)

I'm basically trying to test mod_rewrite as described in this link

http://docs.joomla.org/Security_and_Performance_FAQs#How_can_I_check_if_mod_rewrite_is_enabled.3F (http://docs.joomla.org/Security_and_Performance_FAQs#How_can_I_check_if_mod_rewrite_is_enabled.3F)

I have replaced my .htaccess file in the opt/joomla directory with the one detailed in the link above.

Have run these commands in an attempt to see if it helps:

db accounts setprop Primary AllowOverride All
db accounts setprop Primary FollowSymLinks enabled
signal-event ibay-modify Primary

Checked to see that I have the line 'LoadModule rewrite_module modules/mod_rewrite.so' in my httpd.conf file

Whenever I type www.mydomain/joomla.html I get a 404 file not found error.

Any ideas?

Many thanks.
Title: Re: Mod_rewrite not working possibly due to web app redirect?
Post by: janet on May 16, 2011, 11:34:35 PM
mflammia

You should move your /opt install of Joomla to an ibay, or reinstall to an ibay, then these various "issues" will not be occurring. I have had Joomla installed in ibays for years without any problems.
Title: Re: Mod_rewrite not working possibly due to web app redirect?
Post by: mflammia on May 17, 2011, 12:02:14 AM
Hi,

Thanks for replying - have read a lot of posts about where to install Joomla, a little confusing and a lot of heated debate by the seems of it but the outcome suggested that it be opt/ and also where the contrib installs the files.

Although, I like the idea of installing Joomla into an ibay better - just seems to make things a little tidier and easier to configure functionality?

That said do you know the best method to move Joomla from the opt/ directory to an ibay? Also, will have to read up on it again as I believe the answers where out there, but perhaps pick your brains anyway - getting www.yourdomain.co.uk to go to the the ibay, how do you do that? Would I need to also remove my redirect?

Many thanks.
Title: Re: Mod_rewrite not working possibly due to web app redirect?
Post by: janet on May 19, 2011, 01:30:00 AM
mflammia

PLEASE READ THE MANUAL, and please review all menu choices and possibilities that are in server manager, you will learn a lot.

In server manager, you can configure the main domain to point to an ibay, I think it is in the Domains panel, too easy.

As far as moving Joomla from /opt to an ibay ie /home/e-smith/files/ibays/ibayname is concerned, that is also relatively easy but requires command line usage.
I'm sure it has been posted in these forums a few years ago, so search had to find it.

In brief do the following:
Move all the files and folders in /opt/joomla to /home/e-smith/files/ibays/joomla2
It's easy to use the Move function in midnight commander (type mc at command prompt), whatever method you use, make sure the file permissions and ownership do not change, or alternatively use tar to pack and unpack to the new location (also keeps permissions & ownership of files unchanged).

Then change the configuration files to point to the ibay name location ie joomla2, these conf files are in the main directory of your joomla install (or thereabouts), I'd have to look to be exactly sure.
You will also need to ensure that the config files point at the correct mysql database, although if the database name does not change then it should already be OK.

One thing to be careful of is if you reinstall joomla with the contrib to /opt, then a new mysql database will be created which will overwrite your existing database (which is not desirable), so in my opinion it's better to change the mysql joomla database name to something else (eg joomla2) and also change the ibay name to something else other than joomla (eg joomla2), then reflect these changes in the joomla configuration files. As far as I recall these configuration files are not templated, so edit them directly (doing so very carefully). Make a copy before you change any files.
Review the files first, it should be obvious which settings need "correction".

If you do change the database name, then you will also have to reissue the grant command in mysl to give permission to users to access the database, this has also been posted here before, and take al look at the Mysql Howto.
Title: Re: Mod_rewrite not working possibly due to web app redirect?
Post by: mflammia on May 27, 2011, 12:48:11 PM
For anyone that is interested....

I ended up reinstalling Joomla into an ibay by

To test that mod-rewrite was working I followed the instructions to this link http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server (http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server)

And the instructions in this post http://forums.contribs.org/index.php?topic=42071.0 (http://forums.contribs.org/index.php?topic=42071.0)

So I did the following:

Created a .htaccess file and added the following and put it into my www root folder

Code: [Select]
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^joomla\.html http://www.joomla.org/? [R=301,

Before I got to this I did get an error that I was able to figure out looking at the httpd/error_log log within the sme server - maybe useful to know if you have problems?

Via the console on the SME server I typed the following:

db accounts setprop Primary AllowOverride All
db accounts setprop Primary FollowSymLinks enabled
signal-event ibay-modify Primary

Where ‘Primary’ is your ibay name.

Have found that installing Joomla into an ibay has made things a lot simpler for a newbie like myself, as many things that where causing me problems before have now been resolved, like redirections, mod_rewrite, permission errors when using Joomla.

In doing this there is probably some security risks, not sure what they are exactly but I plan to do some Pen testing to find out.

Hope this is of use to anyone else in my position - if anyone can improve on this, outline the security risks it would be much grateful.

Thanks.

Title: Re: Mod_rewrite not working possibly due to web app redirect?
Post by: calisun on May 31, 2011, 09:23:50 PM
From what I have read, the only security issue for using iBay is if you have other people with an access to your server, like file access users on your office server that is also used as web server. They can access and monkey with your files.
But if you are the only person that has access to this server, there should be no issue. Especially if you secure your server with Public-Private keys and don't allow clear passwords, you are fine.