Koozali.org: home of the SME Server

One Ibay from two domainnames /Apache Alias

Offline skovsgaard

  • *
  • 20
  • +0/-0
    • http://www.skovsgaard.net
One Ibay from two domainnames /Apache Alias
« on: February 21, 2006, 10:54:32 AM »
I've been reading a lot of posts regarding redirecting domains etc. Maybe I've missed the one covering this, and if so I'm sorry  :-(

I've installed gallery2 in a ibay, and from the Internet I can browse primarydomain.com/gallery2ibayname - perfect.

What I would like is to browse the same ibay from my virtualdomain, this domain is pointing at an ibay holding all html files etc., and I don't want to change this. Is there a magic trick so I also can browse the pictures with virtualdomain.com/gallery2ibayname ?
Regards Jan

hjnvejlen

One Ibay from two domainnames
« Reply #1 on: February 21, 2006, 11:00:23 AM »
Hi Jan

I am not sure that you can do what you describe, but when you are installing Gallery2 you are asked if it should be installed as a shared photoalbum.

I have NOT tried it myself, as I only use Gallry2 in 1 domain and Gallry 1.5 in my others, but I think you should look at this option.

regards
hjnvejlen

Offline skovsgaard

  • *
  • 20
  • +0/-0
    • http://www.skovsgaard.net
One Ibay from two domainnames /Apache Alias
« Reply #2 on: February 22, 2006, 08:36:27 AM »
Hi hjnvejlen

Good point. Found on http://codex.gallery2.org/index.php/Gallery2:Multisite
Quote
Multisite is an installation option of G2 to save diskspace and administrative work when installing and upgrading multiple independent G2 installs on the same webserver. Independent means that the multisite G2 installs don't share albums, photos, users, or anything else. They all use their own database and their own storage directory.

It isn't the way to go since I don't want two simular databases to maintain :-) It could be done by using this script:
Code: [Select]
<html>
<script>
    location = "http://primarydomain.com/gallery2ibayname/main.php";
</script>
</html>

saved as index.html in a empty subdir in the ibay virtualdomain called gallery2ibayname. I would like a more "clean" Apache alias. Something like in the custom template fragment for Apache, I use for my phpBB2 installation, the one Dan Brown pointed out in his howto years ago.

[root@e-smith httpd.conf]# pico 93phpBB    -->doesn't it matter what I name this fragment, as long as it isn't 93phpBB?
Code: [Select]
#-------------------------------------------
# phpBB 2.0.19
#-------------------------------------------

Alias /phpBB2 /opt/phpBB2
#Alias /gallery2ibayname/ /home/e-smith/files/ibays/gallery2ibayname/

<Directory /opt/phpBB2>
#<Directory /home/e-smith/files/ibays/gallery2ibayname>
AddType application/x-httpd-php .php .php3 .phtml
Options Indexes +Includes FollowSymLinks
order deny,allow
deny from all
allow from all
</Directory>

<Files /opt/phpBB2/config.php>
#<Files /home/e-smith/files/ibays/gallery2ibayname/config.php>
order deny,allow
deny from all
</Files>

#------------------------------------------

Then rebuild httpd.conf and restart apache:

[root@e-smith httpd.conf]# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
[root@e-smith httpd.conf]# /etc/rc.d/rc7.d/S85httpd-e-smith restart

No problem testing it out, but I could use a bit of advice if it would be the way to go. I would hate to chrash my new 70 machine, after spending hours converting and testing.
Regards Jan

Offline skovsgaard

  • *
  • 20
  • +0/-0
    • http://www.skovsgaard.net
One Ibay from two domainnames /Apache Alias
« Reply #3 on: February 22, 2006, 09:22:16 PM »
Well I did the test and everything seems to be working out as planned  :-)

I modified Dans fragment this way:
[root@e-smith /root]# mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
[root@e-smith /root]# cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
[root@e-smith httpd.conf]# pico 94gallery2

copy and paste:

Code: [Select]
#------------------------------------------------------
# Gallery 2.0.2 template fragment for sme70 22 feb 2006
#------------------------------------------------------

Alias /gallery2 /home/e-smith/files/ibays/gallery2/html

<Directory /home/e-smith/files/ibays/gallery2/html>
AddType application/x-httpd-php .php .php3 .phtml
Options Indexes +Includes FollowSymLinks
order deny,allow
deny from all
allow from all
</Directory>

<Files /home/e-smith/files/ibays/gallery2/html/config.php>
order deny,allow
deny from all
</Files>

#------------------------------------------


Then rebuild httpd.conf and restart apache:

[root@e-smith httpd.conf]# /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
[root@e-smith httpd.conf]# /etc/rc.d/rc7.d/S86httpd-e-smith restart
Regards Jan