Koozali.org: home of the SME Server

redirecting 2nd hostname set up for ibay to opt/myhostname2

Offline enchesss

  • **
  • 69
  • +0/-0
What is the best way to resolve a host name for a 2nd website that is set up in an ibay?

EG resolve www.myhostname2.yi.org to use the myhostname2.php file in /opt/myhostname2

have set up dns and copied joomla files to /opt/myhostname2 using ftp

just need to redirect to this folder from the (myhostname2 )ibay index.html that is able to be seen over the internet using a browser.

Preferably using the most secure method possible.
« Last Edit: July 07, 2008, 08:22:34 AM by enchesss »

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: redirecting 2nd hostname set up for ibay to opt/joomla2
« Reply #1 on: July 06, 2008, 08:45:10 PM »
To clarify:

* http://www.myhostname.yi.org/myhostname2 now opens index.html from the ibay named myhostname2

* You have installed joomla in /opt/myhostname2

* You want http://www.myhostname2.yi.org to open the copy of joomla installed in /opt/myhostname2.

Is this all correct?

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #2 on: July 07, 2008, 01:37:15 AM »
nearly.

www.myhostname2.yi.org actually opens the (myhostname2) index.html in the (myhostname2) ibay.

*to clarify: i do not have to use a forwardslash 'www.myhostname1.yi.org/myhostname2' to open the index.html in the myhostname2 ibay.

how do i get it to open the joomla cms that is installed in: /opt/myhostname2 folder?

i know this sounds confusing but it is apparently more secure to install in the opt folder. but with security comes complexity!

have read the redirect tutorial and am slowly digesting it but not sure about a few things.

Have started reading about rpms to get a better understanding but...

If someone has straight forward instructions to complete this last step then - #out with it!
« Last Edit: July 07, 2008, 08:22:59 AM by enchesss »

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/joomla2
« Reply #3 on: July 07, 2008, 02:45:46 AM »
enchesss

Quote
how do i get it to open the joomla cms that is installed in: /opt/myhostname2 folder?

Follow this howto
http://wiki.contribs.org/Web_Application_Redirect_Tutorial


Quote
have read the redirect tutorial and am slowly digesting it but not sure about a few things.

Do you magically expect us to know what things you are not sure about !!!!

Please ask specific questions, eg exactly what things are you not sure about ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #4 on: July 07, 2008, 03:22:19 AM »
have read this tutorial but do not understand where to save the file

Quote
Enter the following code, having replaced foo with joomla, and save the file

It is taken from http://wiki.contribs.org/Web_Application_RPM Webserver Templates - a workaround to enable the application to be located in a domain or subdomain rootwith joomla

Code: [Select]
{
  my $status = $joomla{'status'} || "disabled";
  return "    # joomla-status is disabled.\n"
          unless $status eq 'enabled';

  my $domain = $joomla{'domain'} || "disabled";
  return "    # no hostname or domain for joomla defined\n"
          if $domain eq 'disabled';

  my $DocRoot = "/opt/joomla";

  $OUT  = "";
  $OUT .= "\n";
  $OUT .= "# Redirect an existing hostname or domain to $DocRoot.\n";
  $OUT .= "<VirtualHost 0.0.0.0:80>\n";
  $OUT .= "    ServerName  $domain\n";
  $OUT .= "    DocumentRoot $DocRoot\n";
  $OUT .= "</VirtualHost>\n";
  $OUT .= "<VirtualHost 0.0.0.0:443>\n";
  $OUT .= "    ServerName  $domain\n";
  $OUT .= "    DocumentRoot  $DocRoot\n";
  $OUT .= "    SSLEngine on\n";
  $OUT .= "</VirtualHost>\n";
}

does this file have to be saved in the fragment refered to in the previous step of this tutorial?

Quote
Create another fragment

pico -w /etc/e-smith/templates/etc/httpd/conf/httpd.conf/80OptDomainJoomla

Then use the db command to configure the system to run joomla from the root of a virtual domain ie www.myvirtualdomain.com
« Last Edit: July 07, 2008, 08:23:14 AM by enchesss »

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/joomla2
« Reply #5 on: July 07, 2008, 03:39:01 AM »
enchesss

Quote
does this file have to be saved in the fragment refered to in the previous step of this tutorial?

Yes

It does say:
"Create another fragment
pico -w /etc/e-smith/templates/etc/httpd/conf/httpd.conf/80OptDomainJoomla
Enter the following code, having replaced foo with joomla, and save the file ......"

Is that not understandable, if not then the wiki needs correction ?


Quote
Then use the db command to configure the system to run joomla from the root of a virtual domain ie www.myvirtualdomain.com

Note you do need the other template fragment that the joomla rpm installs by default in order for the db commands to work in the way outlined

As the Howto says:

Install Joomla using http://wiki.contribs.org/Joomla
This installs the Joomla CMS application in /opt/joomla
It also installs a fragment /etc/e-smith/templates/etc/httpd/conf/httpd.conf/92joomla

So get and manually install that fragment (92joomla) to the location specifiied

The generic version is here (but change text [foo >> joomla] etc to suit your needs):
http://wiki.contribs.org/Web_Application_RPM#Webserver_templates
or you can do a joomla rpm test install to another test server and copy the fragment.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #6 on: July 07, 2008, 09:05:09 AM »
mary


thank you for your help but it is difficult to understand what you mean.

Quote
So get and manually install that fragment (92joomla) to the location specifiied

If this file is saved (or modified somehow) as

Quote
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/80OptDomainJoomla

will it redirect BOTH websites in this way:

www.myhostname.yi.org/joomla to /opt/joomla

AND

www.myhostname2.yi.org to /opt/myhostname2?


There are several complications:

the redirection is needed for a SECOND website.

this tutorial:

http://wiki.contribs.org/Web_Application_Redirect_Tutorial

is for a single joomla site and is to redirect a url www.myhostname.com to the opt/joomla folder so that you do not have to type in www.myhostname/joomla.

it is not for a site that has been set up to use an ibay.


if there is a way to set up a second site without the use of an ibay then please let me know

e.g. do i need an ibay if i install joomla to opt/myhostname2?

are there any instructions about how to install a second joomla cms site to opt/myhostname2?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #7 on: July 07, 2008, 11:10:23 AM »
enchesss

While the example in the howto is not exactly the same as your situation, the information you need is there, you just do not know how to apply it.

As I'm understanding it, you have two Joomla websites in /opt/joomla1 and /opt/joomla2, then you need two copies of the fragments
eg
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92joomla1
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/92joomla2
and
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/80OptDomainJoomla1
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/80OptDomainJoomla2

and the "names" in these frgaments will need to be edited accordingly ie joomla1 and joomla2 instead of joomla

You do not need to use an ibay as you are now using these templates to redirect the domain to /opt/joomla and /opt/joomla2

You will possibly need to find and change any templates that were installed for the original ibay installation (ie if there were any).

Search the forums as there was a thread on exactly this subject (two installs of joomla in /opt) a month of two ago, search on joomla
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #8 on: July 07, 2008, 12:46:12 PM »
thank you for your help.

following the redirect turorial everything seemed to go ok but...

the browser window at www.myhostname1.yi.org now shows an html page giving a 403 forbidden - you do not have permission to access / on this server!

also

www.myhostname2.yi.org now points to the original html of myhostname1 that is a very basic index.html, not a joomla site.



Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #9 on: July 07, 2008, 02:57:41 PM »
enchesss

You should remove the ibay(s) for the domains in question.

Show output of
config show joomla1
and
config show joomla2

Did you change this in each copy of 80OptDomainJoomla1 and 80OptDomainJoomla2
my $DocRoot = "/opt/joomla";
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #10 on: July 07, 2008, 03:32:39 PM »
Mary,

had already deleted ibay and

for 80OptDomainmyhostname1

changed

Quote
my $DocRoot = "/opt/foo
to
Quote
my $DocRoot = "/opt/joomla
  for myhostname1

and for 80OptDomainmyhostname2

Quote
my $DocRoot = "/opt/foo
to
Quote
my $DocRoot = "/opt/myhostname2
  for myhostname2

but there is another problem...

there is some confusion about the installation of joomla in opt/myhostname2:

is it ok to just copy all the files from opt/joomla to opt/myhostname2 using ftp?

also:

have tried to use sitemaker but cannot get a download. The site may be down...

will try again soon.

have read jumba's post here http://forums.contribs.org/index.php?topic=38878.30

seems that i am getting stuck on the same problems and issues.

because i had no access to my site using www.myhostname.yi.org

i deleted both 800 files and then ran

Code: [Select]
expand-template /etc/httpd/conf/httpd.conf
sv h /service/httpd-e-smith

everything is back to the start again.

i can access myhostname1 by going to www.myhostname1.yi.org/joomla

i have deleted opt/myhostname2 and the ibay myhostname2

what is the best way to install joomla in opt/myhostname2?

will it need to be downloaded again? or can the opt/joomla files be copied across?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #11 on: July 07, 2008, 03:32:56 PM »
enchesss

Read ALL of these threads

http://forums.contribs.org/index.php?topic=38878.msg185722#msg185722

http://forums.contribs.org/index.php?topic=39590.0

and this may also help

http://wiki.contribs.org/SME_Site_Maker

Use this to install Joomla

http://wiki.contribs.org/Joomla

Copy the /opt/joomla folder and the mysql db and the original template fragments to new names and then reinstall from the rpm again for the second iteration of joomla


« Last Edit: July 07, 2008, 03:36:35 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #12 on: July 07, 2008, 04:56:44 PM »
Mary,

have read all these threads before and again.

have tried to install two joomla websites that can resolve to the opt folders without having to end the domain name with /joomla

i can not seem to install sitemaker - keep getting errors using all methods. think the site is down.

it has been spectacularly unsuccessful and although i have learnt heaps - i need to try and get it working some other way - just to see if it works.

i would like to try it another way. I have looked around and not found any instructions for installing a second joomla website into an ibay.

if i create an ibay myhostname2:

how do i install joomla in there?

does the cgi folder need to be used for certain files?

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #13 on: July 07, 2008, 10:45:58 PM »
enchesss

If you want to install Joomla to a second ibay, then do it the same way you already installed Joomla to the first ibay. To my knowledge there is no rpm available for installing to an ibay, so you need to follow installation notes on the Joomla website ie unpack the tar.gz file & manually configure the configuration files and database etc.

Given your level of unsure knowledge, I think you would be better off removing the installations you have and starting again.

Do the first install to /opt/joomla using the Joomla contrib here
http://wiki.contribs.org/Joomla

Then follow the additional steps in this howto to point your virtualdomain at the /opt/joomla location
http://wiki.contribs.org/Web_Application_Redirect_Tutorial

The above should work reasonably smoothly if you follow instructions carefully and completely.


Only, and only when, you have the first site fully functional as you want it to be, then install a second copy of Joomla. If you install again using the contrib rpm, then you will probably overwrite the first installation (which you do not want to do), so in the second case you need to follow some manual steps outlined in this Howto.
You could copy the files from /opt/joomla to /opt/joomla2, but make sure that permissions stay the same.
The best way to achieve this is to pack the /opt/joomla folder as a tar.gz file and then unpack it to /opt/jooml2 or similar procedure that does not change permissions and ownership of files etc.
Then to configure other aspects eg templates and mysql database etc, follow the steps in
http://wiki.contribs.org/SME_Site_Maker

If you want to point another virtual domain at the second Joomla install in /opt/joomla2, then you will need to follow the additional steps in this howto to point your virtualdomain at the /opt/joomla2 location
http://wiki.contribs.org/Web_Application_Redirect_Tutorial



If you cannot undertstand how to do the above then you should not really be trying to do these things on a sme server and you should be paying someone else to do it for you.
You have access to all the information needed to achieve this task, and it's not really that difficult an issue.

« Last Edit: July 07, 2008, 11:28:27 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline enchesss

  • **
  • 69
  • +0/-0
Re: redirecting 2nd hostname set up for ibay to opt/myhostname2
« Reply #14 on: July 08, 2008, 03:12:49 AM »
Mary thanks you for your help,

I have reinstalled the first site again and the redirect tutorial has worked smoothly.

Took a while but am now fairly confident in following the procedure outlined.

Am going to try to to pack the opt/joomla file now and tehn unpack it to opt/joomla2

*these sites a purely for educational purposes.
i was going to use xubuntu but a fellow ubuntu friend recommended sme.
I hope that your patience and my mistakes have helped others who may want to achieve several small websites for a classroom.
I dont want to get political but the governemnt does not fund public education as well as they should.
Anything that promotes the use of linux and GNU should be worth the effort and now I hope to be able to assist.