Solved

configure more than one domain on linux

Posted on 2014-10-16
6
122 Views
Last Modified: 2014-11-13
I Want to know what I have to configure to enable more than one domain on my Ubuntu server.
Ex.: domain1.com and domainxyz.com
0
Comment
Question by:Jose Bredariol
[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
6 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40385327
Just add a virtual server block in httpd.conf for each domain.
Do you not have a control panel installed like WebMin or Cpanel - will make it easier.
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 40385368
In /etc/httpd/conf/httpd.conf, you will want to use the <VirtualHost> container to create your configuration.
0
 

Author Comment

by:Jose Bredariol
ID: 40413400
I don´t have this file httpd.conf, I have to create ?
I have folders sites-enabled anda sites available
0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 
LVL 58

Assisted Solution

by:Gary
Gary earned 250 total points
ID: 40413539
in sites-enabled, make a copy of the current domain .conf file
Edit it for the new domain, save, restart Apache.
0
 
LVL 15

Accepted Solution

by:
Insoftservice earned 250 total points
ID: 40417247
By default, apache comes with a default virtual host file called 000-default.conf. We will copy the 000-default.conf file contents to our new virtual host files.

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/site1.com.conf

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/site2.com.conf

Make sure the virtual host files contains .conf extension at the end.

VIrtual container

<VirtualHost *:80>


        ServerAdmin webmaster@site1.com
        ServerName site1.com
        ServerAlias www.site1.com
        DocumentRoot /var/www/site1.com/public_html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Disable the default virtual host (000.default.conf), and enable new virtual hosts as shown below.

sudo a2dissite 000-default.conf
sudo a2ensite site1.com.conf
sudo a2ensite site2.com.conf

sudo service apache2 restart
0
 

Author Closing Comment

by:Jose Bredariol
ID: 40440680
Thanks all
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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