hosting multiple apps / subdomains

peterbayliss81
Posts: 9
Joined: Sun Apr 24, 2011 6:08 am

hosting multiple apps / subdomains

Postby peterbayliss81 » Tue May 03, 2011 8:52 pm

Firstly i want to say i am not sure if this is an issue with Amahi or my Godaddy settings. If anyone that gets a domain from godaddy can offer any advice i will be very happy.

I have been trying to host a couple of web apps and a basic web page on my Amahi server. I followed the wiki page about setting up subdomains and editing the .conf files but i am still having problems.


What i have done so far:
I have a domain name through godaddy. The main host is set to point to my external IP address (displayed on the Amahi control panel on Amahi.org)
My router/untangle server is set up to forward ports 80 and 443 to the local IP address of my HDA.

I plan to use the basic webpage to be the main page for my website with links to the web apps.

When I use "mydomain.com" and "username.yourhda.com" they both take you to straight to the web page.

I created subdomains for my webapps by following the wiki. In my godaddy account, under my domain, added the following:-
CNAME (alias) "app1" POINTS TO "app1.mydomain.com"
CNAME (alias) "app2" POINTS TO "app2.mydomain.com"

In the HDA i added the lines "ServerAlias app1.mydomain.com" and so forth. I saved the changed and then reloaded the httpd service.

So the web page at "mydomain.com" is working perfectally. But the web apps are not. It is like the sub domains are not getting resolved correctly. Like i said, i dont know if this is something i have not configured correctly in Godaddy or if it is something in my HDA?

If anyone has experience with this setup in Gadaddy or if you can help with looking at the HDA side of things. i would love to hear from you.

Thanks
Peter

User avatar
sabat
Posts: 15
Joined: Thu Feb 10, 2011 2:58 pm
Location: Salem, Oregon
Contact:

Re: hosting multiple apps / subdomains

Postby sabat » Tue May 10, 2011 2:41 am

http://wiki.amahi.org/index.php/Hosting_a_website might be useful if you haven't seen it yet.

rednus
Posts: 29
Joined: Wed Jan 12, 2011 4:17 pm

Re: hosting multiple apps / subdomains

Postby rednus » Thu Jun 16, 2011 4:11 am

Hi Peter,

I am also trying to host multiple websites on my hda, but looks like I am a little bit ahead of you, still with some problems left. Here is what I have done

1. Created subdomains app1.mydomain.com and app2.mydomain.com
2. Edited CNAME for both to point to username.yourhda.com
3. Edited my Router config to foward port 80 to the ip of hda
4. Now when try both app1.mydomain.com and app2.mydomain.com, they go to username.yourhda.com
5. On the HDA, I have edited 1***-app1.conf added

Code: Select all

ServerAlias app1.mydomain.com:80
6. On the HDA, I have edited 1***-app2.conf added

Code: Select all

ServerAlias app2.mydomain.com:80
7. Did

Code: Select all

service httpd reload
(just in case if that doesn't work do a

Code: Select all

service httpd restart
)

Sofar so good, so when i goto app1.mydomain.com goes to app1 (in my case wordpress), app2.mydomain.com goes to app2(dokuwiki for me)

The problem starts next.. I dont want anything running on port 80.. so I started to change it to 443.

1. So first step is to update my router to forward port 443 to 443 on hda
2. Now generate an SSL key file as describe in the wiki

Code: Select all

yum -y install mod_ssl cd /etc/httpd/conf/ openssl genrsa -out filename.key 1024 openssl req -new -key filename.key -x509 -days 1000 -out filename.crt
3. Now we will have to edit both app configs to redirect port 80 to 443 and use the ssl certificate
1***-app1.conf

Code: Select all

<VirtualHost *:80> ServerName app1 ServerAlias app1.mydomain.com RedirectPermanent https://app1.mydomain.com/ </VirtualHost> <VirtualHost *:443> ServerName app1 ServerAlias app1.mydomain.com:443 SSLEngine On SSLCertificateFile /etc/httpd/conf/filename.crt SSLCertificateKeyFile /etc/httpd/conf/filename.key DocumentRoot /var/hda/web-apps/app1/html <Directory "/var/hda/web-apps/app1/html"> Options Indexes FollowSymLinks +ExecCGI AddHandler fcgid-script .fcg AllowOverride AuthConfig Order allow,deny Allow from all </Directory> </VirtualHost>
4. Do the above for app2 also
5. Reload or restart the httpd service.

Now the problem I am having is, both app1 and app2 are being redirected to https://app1 when accessed from outside.

:) Still working on it to resolve, not getting enough time to spend.

However, let me know if I can help you resolve your issue.

rednus
Posts: 29
Joined: Wed Jan 12, 2011 4:17 pm

Re: hosting multiple apps / subdomains

Postby rednus » Thu Jun 16, 2011 5:01 am

I created subdomains for my webapps by following the wiki. In my godaddy account, under my domain, added the following:-
CNAME (alias) "app1" POINTS TO "app1.mydomain.com"
CNAME (alias) "app2" POINTS TO "app2.mydomain.com"
Peter I just observed this.. both your sub-domains should point to "username.yourhda.com" not to the ones you have specified... see the note from wiki below

Code: Select all

for each web app you wish to have access to, establish a CNAME or subdomain--for example something.yourdomain.com---and point it to username.yourhda.com (for example see http://help.godaddy.com/article/679 )

Who is online

Users browsing this forum: No registered users and 5 guests