Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hosting multiple websites on a webserver...

Posted on 2013-02-05
8
Medium Priority
?
341 Views
Last Modified: 2013-02-20
I have Linux server with LAMP installed. Since I have a dynamic connection I am using DynDNS to track my IP. So, my domain comp-stuff.com is configured to point to my DynDNS address (using URL Frame-CNAME-masking)...

rubantin.gotdns.com:8080/compstuff is the address I point too with it...

My site resides in the "compstuff" folder on my server's web root...

I am going to host 7 other sites on this server. I plan on simply creating 7 other folders and pointing the domain to:

rubantin.gotdns.com:8080/(folder)

Is this the best practice for what I am doing? Or is there a better way?

I was reading something about masking vs mapping... is there something to that?

Russ
0
Comment
Question by:ambantin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:oheil
ID: 38858796
I would configure apache with VirtualHosts:
http://httpd.apache.org/docs/2.2/vhosts/

Your DnyDNS entry points to your local Server on port 8080 for all domains. Apache serves the web site which is requested automatically.
Example apache conf:
...
<VirtualHost *:8080>
        ServerName www.domain1.de
        DocumentRoot /var/www/domain1/
        ...
</VirtualHost>
<VirtualHost *:8080>
        ServerName www.domain2.de
        DocumentRoot /var/www/domain2/
        ...
</VirtualHost>
...

Note:
If you going to use some CMS (content management system) you need some multi-domain capable system like Typo3.

Thats what comes into mind when I read your question. But I am unsure. Maybe I miss the point.

Oli
0
 

Author Comment

by:ambantin
ID: 38861508
Will this make a difference?

I have to use 8080 because I have a phone VOIP router that uses 80 to display its web content.... So it goes modem>VOIP (Port 8080 forwarded)>router (Port 8080 forwarded to port 80 on the webserver)....

So would it be <VirtualHost *:8080> or <VirtualHost *:80>  ?
0
 
LVL 9

Expert Comment

by:oheil
ID: 38861569
If your apache listens on 80 it must be <VirtualHost *:80>

Oli
0
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 

Author Comment

by:ambantin
ID: 38861801
just to double check... is it in

/etc/apache2/apache2.conf or

/etc/apache2/httpd.conf or

/etc/apache2/sites-enabled/000-default.conf
0
 
LVL 9

Accepted Solution

by:
oheil earned 2000 total points
ID: 38863001
In my configuration I have for each domain a configuration file in /etc/apache2/sites-available. Each file contains its own <VirtualHost *:80> configuration. In /etc/apache2/sites-enabled/ there is a symbolic link to the file in sites-available which switches this domain on.
Example:
/etc/apache2/sites-available/www.domain1.com
/etc/apache2/sites-available/www.domain2.com
...
Symbolic links are not straight forward in windows, so I believe, you should do the same (create files per domain) in
/etc/apache2/sites-enabled/www.domain1.com
/etc/apache2/sites-enabled/www.domain2.com
...


But the truth behind my long writing is: It doesnt matter where you put it in as long as apache2 reads the configuration file :-) The above is just convention which differs from OS to OS, even in between like debian and CentOS Linux.

Oli
0
 

Author Comment

by:ambantin
ID: 38863365
sorry... it is sites-available not sites enabled...

so your files look like www.domain.com.conf or what are your actual conf files named?

or can I simple put this in the 000-default file

<VirtualHost *:80>
        ServerName www.domain1.de
        DocumentRoot /var/www/domain1/
</VirtualHost>

<VirtualHost *:80>
        ServerName www.domain2.de
        DocumentRoot /var/www/domain2/
</VirtualHost>
0
 
LVL 9

Expert Comment

by:oheil
ID: 38863382
The convention is, to put a separate file for each domain into sites-enabled (under CentOS e.g.).

For test purpose you can put your VirtualHosts into the 000-default, but you need make sure, that this file is read by the apache server (it maybe not the case).

As I said, you can put it also into /etc/apache2/httpd.conf which might be best for you, because this file is probably the master config file for your server.

Oli
0
 

Author Comment

by:ambantin
ID: 38863634
will try this sunday and post results... thanks
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question