Skip to main content
Commonmark migration
Source Link

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

edit:

#edit: YouYou may want to read the answer from @nwildner too which is more accurate than me.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

#edit: You may want to read the answer from @nwildner too which is more accurate than me.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

edit:

You may want to read the answer from @nwildner too which is more accurate than me.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

added 94 characters in body
Source Link
Sw0ut
  • 156
  • 6

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

#edit: You may want to read the answer from @nwildner too which is more accurate than me.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

#edit: You may want to read the answer from @nwildner too which is more accurate than me.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.

Source Link
Sw0ut
  • 156
  • 6

You may want to read the Apache2 documentation.

I was told Apache2 would read these files one-by-one in alphabetic order to create virtual hosts, is this correct?

Virtual hosts are not read in /etc/apache2/sites-available but in /etc/apache2/sites-enabled. That said, apache2 uses the libc, and according to gnu.org, The order in which files appear in a directory tends to be fairly random.

How does Linux give preference in case of conflict? Last read file wins? First read file wins?

Really not sure, but if there is a conflict, generally it displays a warning message and your httpd service won't (re)load.

If I want to configure my 3 virtual hosts (which are not in conflict with existing virtual hosts), is it just a matter of creating an extra file with them in this directory?

Yes, and once you've added your extra files, run these commands:

sudo a2ensite my_site1.conf my_site2.conf my_site3.conf
sudo service apache2 reload

It will search in /etc/apache2/sites-available for my_site1.conf, my_site2.conf and my_site3.conf.