Solved

configure more than one domain on linux

Posted on 2014-10-16
6
120 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
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 28

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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

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.

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 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