Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

configure more than one domain on linux

Posted on 2014-10-16
6
Medium Priority
?
134 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 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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 58

Assisted Solution

by:Gary
Gary earned 750 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 750 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month12 days, 16 hours left to enroll

972 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