Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: luvit on April 07, 2008, 11:16:45 PM

Title: one server: tests for multi sites succeed before i config Apache Virtual Hosts??
Post by: luvit on April 07, 2008, 11:16:45 PM
i host my server: DynDNS Custom DNS (mydomain.com)

then i bought 2 domain names from GoDaddy.com (site1 & site2)
these domains seem to work just fine without Apache Virtual Hosts
godaddy site1 forwarding w/ masking to mydomain.com/site1
godaddy site1 CNAME www.site1.com points to @ (site1.com)
godaddy site2 forwarding w/ masking to mydomain.com/site2
godaddy site2 CNAME www.site1.com points to @ (site2.com)

results
site1 shows it's own index.html from mydomain.com/site1/index.html
www.site1 shows it's own index.html from mydomain.com/site1/index.html
set2 shows it's own index.html from mydomain.com/site2/index.html
www.site2 shows it's own index.html from mydomain.com/site2/index.html

I have not installed SMF, yet until I know I have the foundation right.
Title: Re: one server: tests for multi sites succeed before i config Apache Virtual Hosts??
Post by: SleePy on April 13, 2008, 01:22:46 AM
Multiple sites on a apache virtual hosts should work fine.
Most cpanel websites use this as well. I use this locally even :)
Title: Re: one server: tests for multi sites succeed before i config Apache Virtual Hos
Post by: luvit on April 13, 2008, 08:07:28 AM
my question is:
how do i test it.  everything appears to work for multiple site before i setup Apache Virtual Hosts

before i setup Apache Virtual Hosts:
site1.com accesses it's own index.html
site2.com accesses it's own index.html
Title: Re: one server: tests for multi sites succeed before i config Apache Virtual Hos
Post by: rsw686 on April 18, 2008, 10:43:24 AM
Quote from: luvit on April 07, 2008, 11:16:45 PM
then i bought 2 domain names from GoDaddy.com (site1 & site2)
these domains seem to work just fine without Apache Virtual Hosts
godaddy site1 forwarding w/ masking to mydomain.com/site1
godaddy site1 CNAME www.site1.com points to @ (site1.com)
godaddy site2 forwarding w/ masking to mydomain.com/site2
godaddy site2 CNAME www.site1.com points to @ (site2.com)

They work fine because GoDaddy is doing the translation. All your site traffic is being passed through them. This is not recommended. You need to set the GoDaddy DNS for each domain to your static IP address. Then you create a virtual host for each site setting the ServerName variable to the domain name.

Since you don't have a static IP you will need to use the DynDNS custom DNS for each domain name your purchased. This is probably more expensive in the long run then just paying your ISP for a static IP.

I spent about $30 a month for a static IP and have close to 10 domains running on one server. The domains were all bought through GoDaddy and I use their DNS service. Technically I could run my own DNS, but GoDaddy's has been reliable so far.

I do run my own DNS internally (split DNS) so when working on the websites or going to them internally I'm not looping traffic through my router.

So what happens with this setup is the web browser hits GoDaddy's DNS server to determine the IP address for the domain name. Then the browser directly goes to that IP. Apache looks at the requesting domain name and serves the correct virtual host files.

Internally the browser hits my DNS server and looks up the server's private IP. Then it proceeds just like the above.

After you get that working you need to determine how you want to run PHP. Do you want to run it as a module, CGI, or Fast CGI. I prefer Fast CGI as I can use suexec to lock down the scripts to running under that web sites account. CGI is easier to configure but it slower as it must spawn the php parser for each request. Running it as a module is okay, but I don't like how it all executes under apaches account. It just makes more of a pain to deal with write permissions on files, etc.

When you setup mysql make sure to set the root password. Otherwise any script running on the localhost as access to all the database tables.

Lastly you need to figure out what you are doing for a mail server. This can get complicated quickly if you plan to run it yourself. The best way to configure this is with virtual email address. Otherwise you can't have webmaster@domain and webmaster@domain2. I use Postfix and Dovecot, although Postfix had to be custom compiled to get quota limits working with the VDA patch since it is not included.

You might be better off using GoDaddy's email or even GMail. You would just need to configure your DNS MX records to point to their email server.

If you feel like all this is overwhelming then you might be better off paying for a web host. Hopefully this box you are running on is a dedicated web server only. I highly recommend not using it as a file server or for anything else that contains your personal data. Should the machine become compromised all your data is at risk.
Title: Re: one server: tests for multi sites succeed before i config Apache Virtual Hosts??
Post by: metallica48423 on April 27, 2008, 11:58:51 PM
did the above answer your question adequately?
Title: Re: one server: tests for multi sites succeed before i config Apache Virtual Hosts??
Post by: luvit on May 01, 2008, 03:06:46 PM
Quote from: metallica48423 on April 27, 2008, 11:58:51 PM
did the above answer your question adequately?
yeah... my DynDNS setup is like less than $50/yr, much less than $30/mo.
i'll try it with dyndns on my small board.