Solved

configure more than one domain on linux

Posted on 2014-10-16
6
116 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now