How To Set Up second Apache Virtual Hosts on Ubuntu

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have one virtual host but when i make second one and going to check ping its goes to first one website, and when check in browser its says 404 not found, but first one works fine.










share|improve this question





















  • Please, share configuration for both virtualhosts
    – Dexter Morganov
    Feb 28 at 7:18










  • in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
    – Anirban Ghosh
    Feb 28 at 7:21










  • and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:25










  • and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:26










  • It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
    – Dexter Morganov
    Feb 28 at 7:41














up vote
0
down vote

favorite












I have one virtual host but when i make second one and going to check ping its goes to first one website, and when check in browser its says 404 not found, but first one works fine.










share|improve this question





















  • Please, share configuration for both virtualhosts
    – Dexter Morganov
    Feb 28 at 7:18










  • in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
    – Anirban Ghosh
    Feb 28 at 7:21










  • and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:25










  • and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:26










  • It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
    – Dexter Morganov
    Feb 28 at 7:41












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have one virtual host but when i make second one and going to check ping its goes to first one website, and when check in browser its says 404 not found, but first one works fine.










share|improve this question













I have one virtual host but when i make second one and going to check ping its goes to first one website, and when check in browser its says 404 not found, but first one works fine.







14.04 xubuntu virtualhost






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 28 at 7:09









Anirban Ghosh

52




52











  • Please, share configuration for both virtualhosts
    – Dexter Morganov
    Feb 28 at 7:18










  • in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
    – Anirban Ghosh
    Feb 28 at 7:21










  • and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:25










  • and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:26










  • It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
    – Dexter Morganov
    Feb 28 at 7:41
















  • Please, share configuration for both virtualhosts
    – Dexter Morganov
    Feb 28 at 7:18










  • in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
    – Anirban Ghosh
    Feb 28 at 7:21










  • and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:25










  • and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
    – Anirban Ghosh
    Feb 28 at 7:26










  • It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
    – Dexter Morganov
    Feb 28 at 7:41















Please, share configuration for both virtualhosts
– Dexter Morganov
Feb 28 at 7:18




Please, share configuration for both virtualhosts
– Dexter Morganov
Feb 28 at 7:18












in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
– Anirban Ghosh
Feb 28 at 7:21




in /var/www/html/ there are two virtual host example.com and example1.com then /public_html then my folder. and in /etc/apache2/sites-available/example.com.conf
– Anirban Ghosh
Feb 28 at 7:21












and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
– Anirban Ghosh
Feb 28 at 7:25




and in /etc/apache2/sites-available/example.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example.com/public_html serverAlias www.example.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
– Anirban Ghosh
Feb 28 at 7:25












and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
– Anirban Ghosh
Feb 28 at 7:26




and second one /etc/apache2/sites-available/example1.com.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/html/example1.com/public_html serverAlias www.example1.com Alias /phpmyadmin "/usr/share/phpmyadmin/" <Directory "/usr/share/phpmyadmin/"> Order allow,deny Allow from all Require all granted </Directory> ErrorLog $APACHE_LOG_DIR/error.log CustomLog $APACHE_LOG_DIR/access.log combined </VirtualHost>
– Anirban Ghosh
Feb 28 at 7:26












It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
– Dexter Morganov
Feb 28 at 7:41




It's not a good idea to use more then 1 DEFAULT virtual host: VirtualHost *:80
– Dexter Morganov
Feb 28 at 7:41










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










1 Setup correct records for domain names in /etc/hosts.



This means that you are running apache2 on same computer that you are trying to get access to it via browser. Otherwise, set correct IP address.



127.0.0.1 example.com
127.0.0.1 example1.com


2 Adjust your apache virtualhost configuration



/etc/apache2/sites-available/example.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html

ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined

<Directory /var/www/example.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


/etc/apache2/sites-available/example1.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example1.com
ServerName example1.com
DocumentRoot /var/www/example1.com/public_html

ErrorLog /var/www/example1.com/logs/error.log
CustomLog /var/www/example1.com/logs/access.log combined

<Directory /var/www/example1.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


3 Create required directories



sudo mkdir -p /var/www/example.com/public_html,logs
sudo mkdir -p /var/www/example1.com/public_html,logs


4 Enable virtualhosts



sudo a2ensite example.com
sudo a2ensite example1.com


5 Restart apache2 for apply changes



sudo service apache2 restart


or



sudo /etc/init.d/apache2 restart


6 Check that it works



Create different index files for both hosts



echo "example.com" | sudo tee /var/www/example.com/public_html/index.html
echo "example1.com" | sudo tee /var/www/example1.com/public_html/index.html


Open browser and navigate to example.com. You should see "example.com"



Navigate to example1.com. You should see "example1.com".






share|improve this answer






















  • Got one Apache error" Failed to start LSB: Apache2 web server"
    – Anirban Ghosh
    Feb 28 at 8:41










  • check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
    – Dexter Morganov
    Feb 28 at 8:44











  • Also, be sure that you have created all required directories. If apache can't create log file - it can't start
    – Dexter Morganov
    Feb 28 at 8:56










  • when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
    – Anirban Ghosh
    Feb 28 at 9:02










  • oh! do you need 2 virtual hosts with 1 document root?
    – Dexter Morganov
    Feb 28 at 9:57











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1010531%2fhow-to-set-up-second-apache-virtual-hosts-on-ubuntu%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










1 Setup correct records for domain names in /etc/hosts.



This means that you are running apache2 on same computer that you are trying to get access to it via browser. Otherwise, set correct IP address.



127.0.0.1 example.com
127.0.0.1 example1.com


2 Adjust your apache virtualhost configuration



/etc/apache2/sites-available/example.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html

ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined

<Directory /var/www/example.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


/etc/apache2/sites-available/example1.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example1.com
ServerName example1.com
DocumentRoot /var/www/example1.com/public_html

ErrorLog /var/www/example1.com/logs/error.log
CustomLog /var/www/example1.com/logs/access.log combined

<Directory /var/www/example1.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


3 Create required directories



sudo mkdir -p /var/www/example.com/public_html,logs
sudo mkdir -p /var/www/example1.com/public_html,logs


4 Enable virtualhosts



sudo a2ensite example.com
sudo a2ensite example1.com


5 Restart apache2 for apply changes



sudo service apache2 restart


or



sudo /etc/init.d/apache2 restart


6 Check that it works



Create different index files for both hosts



echo "example.com" | sudo tee /var/www/example.com/public_html/index.html
echo "example1.com" | sudo tee /var/www/example1.com/public_html/index.html


Open browser and navigate to example.com. You should see "example.com"



Navigate to example1.com. You should see "example1.com".






share|improve this answer






















  • Got one Apache error" Failed to start LSB: Apache2 web server"
    – Anirban Ghosh
    Feb 28 at 8:41










  • check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
    – Dexter Morganov
    Feb 28 at 8:44











  • Also, be sure that you have created all required directories. If apache can't create log file - it can't start
    – Dexter Morganov
    Feb 28 at 8:56










  • when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
    – Anirban Ghosh
    Feb 28 at 9:02










  • oh! do you need 2 virtual hosts with 1 document root?
    – Dexter Morganov
    Feb 28 at 9:57















up vote
0
down vote



accepted










1 Setup correct records for domain names in /etc/hosts.



This means that you are running apache2 on same computer that you are trying to get access to it via browser. Otherwise, set correct IP address.



127.0.0.1 example.com
127.0.0.1 example1.com


2 Adjust your apache virtualhost configuration



/etc/apache2/sites-available/example.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html

ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined

<Directory /var/www/example.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


/etc/apache2/sites-available/example1.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example1.com
ServerName example1.com
DocumentRoot /var/www/example1.com/public_html

ErrorLog /var/www/example1.com/logs/error.log
CustomLog /var/www/example1.com/logs/access.log combined

<Directory /var/www/example1.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


3 Create required directories



sudo mkdir -p /var/www/example.com/public_html,logs
sudo mkdir -p /var/www/example1.com/public_html,logs


4 Enable virtualhosts



sudo a2ensite example.com
sudo a2ensite example1.com


5 Restart apache2 for apply changes



sudo service apache2 restart


or



sudo /etc/init.d/apache2 restart


6 Check that it works



Create different index files for both hosts



echo "example.com" | sudo tee /var/www/example.com/public_html/index.html
echo "example1.com" | sudo tee /var/www/example1.com/public_html/index.html


Open browser and navigate to example.com. You should see "example.com"



Navigate to example1.com. You should see "example1.com".






share|improve this answer






















  • Got one Apache error" Failed to start LSB: Apache2 web server"
    – Anirban Ghosh
    Feb 28 at 8:41










  • check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
    – Dexter Morganov
    Feb 28 at 8:44











  • Also, be sure that you have created all required directories. If apache can't create log file - it can't start
    – Dexter Morganov
    Feb 28 at 8:56










  • when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
    – Anirban Ghosh
    Feb 28 at 9:02










  • oh! do you need 2 virtual hosts with 1 document root?
    – Dexter Morganov
    Feb 28 at 9:57













up vote
0
down vote



accepted







up vote
0
down vote



accepted






1 Setup correct records for domain names in /etc/hosts.



This means that you are running apache2 on same computer that you are trying to get access to it via browser. Otherwise, set correct IP address.



127.0.0.1 example.com
127.0.0.1 example1.com


2 Adjust your apache virtualhost configuration



/etc/apache2/sites-available/example.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html

ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined

<Directory /var/www/example.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


/etc/apache2/sites-available/example1.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example1.com
ServerName example1.com
DocumentRoot /var/www/example1.com/public_html

ErrorLog /var/www/example1.com/logs/error.log
CustomLog /var/www/example1.com/logs/access.log combined

<Directory /var/www/example1.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


3 Create required directories



sudo mkdir -p /var/www/example.com/public_html,logs
sudo mkdir -p /var/www/example1.com/public_html,logs


4 Enable virtualhosts



sudo a2ensite example.com
sudo a2ensite example1.com


5 Restart apache2 for apply changes



sudo service apache2 restart


or



sudo /etc/init.d/apache2 restart


6 Check that it works



Create different index files for both hosts



echo "example.com" | sudo tee /var/www/example.com/public_html/index.html
echo "example1.com" | sudo tee /var/www/example1.com/public_html/index.html


Open browser and navigate to example.com. You should see "example.com"



Navigate to example1.com. You should see "example1.com".






share|improve this answer














1 Setup correct records for domain names in /etc/hosts.



This means that you are running apache2 on same computer that you are trying to get access to it via browser. Otherwise, set correct IP address.



127.0.0.1 example.com
127.0.0.1 example1.com


2 Adjust your apache virtualhost configuration



/etc/apache2/sites-available/example.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example.com
ServerName example.com
DocumentRoot /var/www/example.com/public_html

ErrorLog /var/www/example.com/logs/error.log
CustomLog /var/www/example.com/logs/access.log combined

<Directory /var/www/example.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


/etc/apache2/sites-available/example1.com.conf



<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@example1.com
ServerName example1.com
DocumentRoot /var/www/example1.com/public_html

ErrorLog /var/www/example1.com/logs/error.log
CustomLog /var/www/example1.com/logs/access.log combined

<Directory /var/www/example1.com/public_html/ >
Require all granted
AllowOverride All
Options Indexes
</Directory>
</VirtualHost>


3 Create required directories



sudo mkdir -p /var/www/example.com/public_html,logs
sudo mkdir -p /var/www/example1.com/public_html,logs


4 Enable virtualhosts



sudo a2ensite example.com
sudo a2ensite example1.com


5 Restart apache2 for apply changes



sudo service apache2 restart


or



sudo /etc/init.d/apache2 restart


6 Check that it works



Create different index files for both hosts



echo "example.com" | sudo tee /var/www/example.com/public_html/index.html
echo "example1.com" | sudo tee /var/www/example1.com/public_html/index.html


Open browser and navigate to example.com. You should see "example.com"



Navigate to example1.com. You should see "example1.com".







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 28 at 11:04

























answered Feb 28 at 7:39









Dexter Morganov

42228




42228











  • Got one Apache error" Failed to start LSB: Apache2 web server"
    – Anirban Ghosh
    Feb 28 at 8:41










  • check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
    – Dexter Morganov
    Feb 28 at 8:44











  • Also, be sure that you have created all required directories. If apache can't create log file - it can't start
    – Dexter Morganov
    Feb 28 at 8:56










  • when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
    – Anirban Ghosh
    Feb 28 at 9:02










  • oh! do you need 2 virtual hosts with 1 document root?
    – Dexter Morganov
    Feb 28 at 9:57

















  • Got one Apache error" Failed to start LSB: Apache2 web server"
    – Anirban Ghosh
    Feb 28 at 8:41










  • check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
    – Dexter Morganov
    Feb 28 at 8:44











  • Also, be sure that you have created all required directories. If apache can't create log file - it can't start
    – Dexter Morganov
    Feb 28 at 8:56










  • when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
    – Anirban Ghosh
    Feb 28 at 9:02










  • oh! do you need 2 virtual hosts with 1 document root?
    – Dexter Morganov
    Feb 28 at 9:57
















Got one Apache error" Failed to start LSB: Apache2 web server"
– Anirban Ghosh
Feb 28 at 8:41




Got one Apache error" Failed to start LSB: Apache2 web server"
– Anirban Ghosh
Feb 28 at 8:41












check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
– Dexter Morganov
Feb 28 at 8:44





check out your /etc/apache2/ports.conf, it should contain Listen 80 or Listen 127.0.0.1:80 directive. Additionally, provide last records from /var/log/apache2/error.log
– Dexter Morganov
Feb 28 at 8:44













Also, be sure that you have created all required directories. If apache can't create log file - it can't start
– Dexter Morganov
Feb 28 at 8:56




Also, be sure that you have created all required directories. If apache can't create log file - it can't start
– Dexter Morganov
Feb 28 at 8:56












when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
– Anirban Ghosh
Feb 28 at 9:02




when second one works fine then first one cant access those file or folder, now example1.com works fine but example.com file/folder cant access in browser its goes to not found.
– Anirban Ghosh
Feb 28 at 9:02












oh! do you need 2 virtual hosts with 1 document root?
– Dexter Morganov
Feb 28 at 9:57





oh! do you need 2 virtual hosts with 1 document root?
– Dexter Morganov
Feb 28 at 9:57


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1010531%2fhow-to-set-up-second-apache-virtual-hosts-on-ubuntu%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491