Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 05/08/2015 09:54 PM, Bob Proulx wrote: Marco Stoecker wrote: Bob Proulx wrote: I am unable to recreate your problem on wheezy. I just now installed ... Go back and double check everything. But what happens to the mailman site, if I disable listening on port 80? Will the mailman site still be available? (Me rattles my head and goes, What?) Daniel Bareiro submitted the problem that he could not disable the default web server on port 80. That has been the topic of this thread. Later you posted that you had the same issue. I see now that you did say you wanted to have the mailman site enabled. I didn't see that before since we were focused on Daniel's problem of trying to disable the port 80 web site. Obviously that is impossible. One cannot both disable the port 80 web site and keep it enabled for Mailman. It is one or the other. It cannot be both. And this is a completely different topic than the we one were discussing. That is why there was confusion. In the future if you want to avoid confusion about such things then start a new discussion thread with new topic. Something like, How do I make Mailman the default and only web site? or some such. That would get much better results. On the topic of making the Mailman web interface the default and/or only web site seen: If you want to keep the Mailman web site as the default then do not disable port 80. You will be needing it. Instead make the Mailman web site the default web site. If you are using Apache there are two main ways to do this. One is to ensure that the default site is the first or only VirtualHost listed. Either way then it will be the default site. That is rationale behind the 000-default naming in that the zeros will cause that to be loaded first and therefore will be the default by default. My preference is to remove the 000-default link and keep the original 000-default.conf and default-ssl.conf files pristine. (Previously those were default and default-ssl in Wheezy 7. They have been renamed in Jessie 8.) By keeping those files pristine they will not be prompted for merging upon upgrades. This makes upgrades easier. Then create a new site local file for the local web site configurations. Being a different file it will not be in the package and will not need to be merged when applying security upgrades. The other way from having the 000 naming to force the first configuration to be the default is to use the _default_ tag on one site to explicitly say which is the default. Then the ordering does not matter. This will explicitly tell Apache that it should be the default for all unspecified sites. This is documented here: https://httpd.apache.org/docs/2.4/vhosts/examples.html#default Bob Dear Bob, If I've read the thread carefully and I thought that I indeed have a similar problem as Daniel has, which in summary means If you disable the default site via a2dissite, it will nevertheless show the index.html in /var/www/html, when you call localhost or the dedicated IP of the machine I apologize if I've raised confusion about my mailman site, this should have been an example to point out what I have meant, it was not the problem itself. Anyhow thx for your support, I appreciated it. BR Marco -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/8beca7dc26af9d52e09c3ccabc7cf...@metaxa.loswebos.de
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Marco Stoecker wrote: If I've read the thread carefully and I thought that I indeed have a similar problem as Daniel has, which in summary means If you disable the default site via a2dissite, it will nevertheless show the index.html in /var/www/html, when you call localhost or the dedicated IP of the machine Did you disable the port 80 listen statement in the /etc/apache2/ports.conf file? That is a required step when trying to disable port 80. If you didn't then getting a page is expected. I apologize if I've raised confusion about my mailman site, this should have been an example to point out what I have meant, it was not the problem itself. Anyhow thx for your support, I appreciated it. No worries. We could site down over lunch and a beverage and have an enjoyable conversation over it. But I still think the two things we have been talking about in this thread are in fundamental conflict with each other. Maybe I am just being very strict and rigid in my thinking. When dealing with the computer it helps me to think like the computer thinks and operate with it exactly as it will operate. Basically I follow the same policies and programs as the computer. I do this intentionally and with as much vigor as I can muster! This helps me, but dare I say that most people don't operate this way. Most people tend to be very fuzzy in their thinking. For instance with Apache's configuration there are many independent variables. Each is independent of each other. It either listens on port 80 or it does not. It is completely one or the other with no grey space. Daniel wanted to disable http access entirely. To do that the ports.conf file must be modified to remove the Listen 80 statement. It either listens or it does not listen. This is completely independent of having a default site. If Mailman is installed and has a VirtualHost entry but isn't the default site then that is independent and separate. If someone wants to set up Mailman as the default site. That wouldn't be typical and so can't be sent out as a default. But it is easily configured to be the default site. And I think you have that figured out now? Maybe? Set up the Mailman VirtualHost to have the _default_ config. Or set it up to be the first and/or only VirtualHost configured which will do the same thing. Either way. That should set you up. Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/05/15 14:22, Marco Stoecker wrote: Hi Bob Hi, Bob and Marco. Bob, I appreciate your interest and time spent in testing. thanks for your help. I did it the other way. Just installed wheezy on a 2nd machine, installed apache2, disabled the default site and still, if I call http://192.168.10.16, it shows the default site. So I was wrong, saying wheezy did different. But is where can I disable the default completely (I guess somewhere to change the DocumentRoot in the main config)? I also tested on a new installation with Wheezy in a LXC container and the behavior was the same as in Jessie. I would have underwritten that some time it was different. Sorry for the confusion. Under these circumstances, I believe that the only alternative would be to use _default_ in the VirtualHost directive. Maybe something like this? VirtualHost _default_:80 RedirectMatch 404 (.*) /VirtualHost VirtualHost _default_:443 RedirectMatch 404 (.*) /VirtualHost Best regards, Daniel -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlVOAjsACgkQZpa/GxTmHTddFgCeMdyVDgxV79fs5QNvtbIFaKgR Pk8AniVS0DyGwDLzwLVJ6ccxuFSaK/Cu =8Kk/ -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/554e023b.8030...@gmx.net
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Hi, Marco. On 07/05/15 04:29, Marco Stoecker wrote: But what happens to the mailman site, if I disable listening on port 80? Will the mailman site still be available? This suggests that you have Mailman listening on port 80 not https. So here I think the alternative to avoid behavior catch-all of the default host on port 80 would be to use _default_ as mentioned in the example of the above email (or put Mailman as the default site, as Bob said). I would prefer using _default_ because that way it will return 404 when there is not a match for the site name. Best regards, Daniel signature.asc Description: OpenPGP digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 09/05/15 10:19, Daniel Bareiro wrote: I would prefer using _default_ because that way it will return 404 when there is not a match for the site name. A curious question about this: Is there any way that Apache responds similarly to the way it does Nginx with its error code 444 (the server returns no information to the client and closes the connection): server { listen 80 default_server; server_name _; return 444; } I was investigating whether it is possible to generate this behavior for Apache default site, but could not find the way to do it yet. Best regards, Daniel signature.asc Description: OpenPGP digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Hi, Bob. On 08/05/15 16:54, Bob Proulx wrote: Daniel Bareiro submitted the problem that he could not disable the default web server on port 80. That has been the topic of this thread. I see now that you did say you wanted to have the mailman site enabled. I didn't see that before since we were focused on Daniel's problem of trying to disable the port 80 web site. My original question was aimed at preventing that Apache gives a default response if the site name does not match exactly (regardless of the ports that were enabled). Given the circumstances, I think the way to do this would be using _default_ in the definition of VirtualHost. I think the definitions mentioned in a previous mail could be consolidated as follows: VirtualHost _default_:* RedirectMatch 404 (.*) /VirtualHost Although it might be interesting to achieve a similar behavior to the 444 of Nginx mentioned in a previous email. Best regards, Daniel signature.asc Description: OpenPGP digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 04/05/15 05:21, Georgi Naplatanov wrote: Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? Hi, Hi, Georgi. all your configuration files in /etc/apache2/sites-enabled/ and /etc/apache2/sites-available/ should end with .conf string e.g. mysite.com.conf. For default site you can use _default_ key word, see http://httpd.apache.org/docs/2.4/vhosts/examples.html. Yes. After tests it seems that the solution is heading towards the use of _default_. Thanks for your reply. Best regards, Daniel signature.asc Description: OpenPGP digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Marco Stoecker wrote: Bob Proulx wrote: I am unable to recreate your problem on wheezy. I just now installed ... Go back and double check everything. But what happens to the mailman site, if I disable listening on port 80? Will the mailman site still be available? (Me rattles my head and goes, What?) Daniel Bareiro submitted the problem that he could not disable the default web server on port 80. That has been the topic of this thread. Later you posted that you had the same issue. I see now that you did say you wanted to have the mailman site enabled. I didn't see that before since we were focused on Daniel's problem of trying to disable the port 80 web site. Obviously that is impossible. One cannot both disable the port 80 web site and keep it enabled for Mailman. It is one or the other. It cannot be both. And this is a completely different topic than the we one were discussing. That is why there was confusion. In the future if you want to avoid confusion about such things then start a new discussion thread with new topic. Something like, How do I make Mailman the default and only web site? or some such. That would get much better results. On the topic of making the Mailman web interface the default and/or only web site seen: If you want to keep the Mailman web site as the default then do not disable port 80. You will be needing it. Instead make the Mailman web site the default web site. If you are using Apache there are two main ways to do this. One is to ensure that the default site is the first or only VirtualHost listed. Either way then it will be the default site. That is rationale behind the 000-default naming in that the zeros will cause that to be loaded first and therefore will be the default by default. My preference is to remove the 000-default link and keep the original 000-default.conf and default-ssl.conf files pristine. (Previously those were default and default-ssl in Wheezy 7. They have been renamed in Jessie 8.) By keeping those files pristine they will not be prompted for merging upon upgrades. This makes upgrades easier. Then create a new site local file for the local web site configurations. Being a different file it will not be in the package and will not need to be merged when applying security upgrades. The other way from having the 000 naming to force the first configuration to be the default is to use the _default_ tag on one site to explicitly say which is the default. Then the ordering does not matter. This will explicitly tell Apache that it should be the default for all unspecified sites. This is documented here: https://httpd.apache.org/docs/2.4/vhosts/examples.html#default Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Marco Stoecker wrote: thanks for your help. I did it the other way. Just installed wheezy on a 2nd machine, installed apache2, disabled the default site and still, if I call http://192.168.10.16, it shows the default site. I am unable to recreate your problem on wheezy. I just now installed a pristine wheezy installation. I installed apache. I disabled the regular port 80 non-https as previously discussed. Additionally on Wheezy it is necessary to comment out the NameVirtualHost line as well as the Listen entry. File /etc/apache2/ports.conf # NameVirtualHost *:80 # Listen 80 The rest of the instructions were as previously noted. When doing that there is no web server listening on port 80. I cannot recreate your problem. But is where can I disable the default completely (I guess somewhere to change the DocumentRoot in the main config)? I am sorry but if the instructions are followed then there will be no web server listening on port 80. I can only assume that you are missing some step. Go back and try it all again. Really! :-) If you follow the instructions given then there will be no web server listening on port 80 and there won't be a default It works! page. Go back and double check everything. Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 05/07/2015 08:31 AM, Bob Proulx wrote: Marco Stoecker wrote: thanks for your help. I did it the other way. Just installed wheezy on a 2nd machine, installed apache2, disabled the default site and still, if I call http://192.168.10.16, it shows the default site. I am unable to recreate your problem on wheezy. I just now installed a pristine wheezy installation. I installed apache. I disabled the regular port 80 non-https as previously discussed. Additionally on Wheezy it is necessary to comment out the NameVirtualHost line as well as the Listen entry. File /etc/apache2/ports.conf # NameVirtualHost *:80 # Listen 80 The rest of the instructions were as previously noted. When doing that there is no web server listening on port 80. I cannot recreate your problem. But is where can I disable the default completely (I guess somewhere to change the DocumentRoot in the main config)? I am sorry but if the instructions are followed then there will be no web server listening on port 80. I can only assume that you are missing some step. Go back and try it all again. Really! :-) If you follow the instructions given then there will be no web server listening on port 80 and there won't be a default It works! page. Go back and double check everything. Bob But what happens to the mailman site, if I disable listening on port 80? Will the mailman site still be available? BR Marco -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/3bb68a2ab524cdc2da5d6986753ae...@metaxa.loswebos.de
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/06/2015 01:09 AM, Bob Proulx wrote: Daniel Bareiro wrote: Marco Stoecker wrote: I do have the same issue. I disabled the default config in sites-enabled (which in fact removed the symbolic link to the 000-default.conf in sites-available) and did a restart of apache, but still the default page is showing up. I there another way to disable the default site? I'd like to have only the mailman site enabled. Thanks for confirm the behavior that I had mentioned. I don't remember this happening with Apache 2.2.22 on Debian Wheezy. So at the beginning of this thread I had asked whether it is likely that this configuration is compiled into Apache. I cannot reproduce the behavior that you have reported. I had previously tested on my Sid system. I just now debootstrap'd a pristine Jessie 8 system and tested and apache2 is not listening to port 80 after performing the following configuration which was previously discussed in this thread. Ensure that no web server is running in the host environment. service apache2 stop service nginx stop service ... stop # ... any other installed web servers ... wget -O/dev/null -S http://127.0.0.1/ --2015-05-05 17:01:51-- http://127.0.0.1/ Connecting to 127.0.0.1:80... failed: Connection refused. ... Good. No web servers are running as verified above. ... Then set up a pristine test case system in a chroot. debootstrap jessie /srv/chroot/jessie http://http.debian.net/debian mount -o bind /proc /srv/chroot/jessie/proc chroot /srv/chroot/jessie su - apt-get install apache2 ln -sfn ../sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default.conf a2enmod ssl sed --in-place '/^Listen 80/s/^/# /' /etc/apache2/ports.conf service apache2 restart At that point apache is running. It is not listening on port 80. # wget -O/dev/null -S http://127.0.0.1/ --2015-05-05 17:01:51-- http://127.0.0.1/ Connecting to 127.0.0.1:80... failed: Connection refused. It is listening on port 443 with ssl. # wget -O/dev/null -S -q --no-check-certificate https://127.0.0.1/ HTTP/1.1 200 OK Date: Tue, 05 May 2015 23:01:14 GMT Server: Apache/2.4.10 (Debian) Last-Modified: Tue, 05 May 2015 22:47:53 GMT ETag: 2b60-5155d780793dc Accept-Ranges: bytes Content-Length: 11104 Vary: Accept-Encoding Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html Please double check and ensure that you have accomplished all of the required steps again. I feel certain that one of them has been left out. If you still think there is a problem then try the above steps to reproduce it using a pristine system. Then compare the pristine environment to the problem environment. Bob Hi Bob thanks for your help. I did it the other way. Just installed wheezy on a 2nd machine, installed apache2, disabled the default site and still, if I call http://192.168.10.16, it shows the default site. So I was wrong, saying wheezy did different. But is where can I disable the default completely (I guess somewhere to change the DocumentRoot in the main config)? BR Marco -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJVSk28AAoJEC1y3OsA+e10mxoP/RvrjWkltripwQh3/SoX2v0t SrMY/dq0Cy8kuxxSS+IqwaZx2+r48ySySOL/gfCkanTsjEz59fSkOAKIauiXnlnl O2R+OqsslGj5gWX7lfRNzpfLlJ8FZF9PEuvrEXtxx+TDjDt/lOev4J86znUUUnoM 9u6qp3WQ+KWHyGbt4feTFwkhQfktIuvyihCmOdpCsGu6P/BYGgEcGiYvpWdwxDL/ MYXUslK3EOPJ8k+DqHxoCJ7Hmj0hcwyfQUxKJAmwW8buCPhEJhYmvC8CoDZJq09i redw80a/W5Y/QAi3sW4LlJ5hjA2br99CYV4wpKyVMs4MFV6rJ8Cxq0Up/E9DZbQ9 7DYzsu+RPWcE3d7TRjZbhrMZtp3//SrRUD93ZSGxTjI8pGEEHD0Bh6LqIfjNjYuu CDxmcISNz8NrG8t4l2FnFyIaDxBX5y8dQ7YWMd+F7nhP0j7eUSMDiLKVCdObmP6v TmRfidQsf/cqj8j8/nRaVkmngcmh8RMxxJV5M1H/Crip2lI4ikzgXLPMpl+tkn1z DBPTVfJv4c0+k+ZSB0M3H9XpJoEU1e22plYfWc5DDnWaJ/iQthcxi9GdInlPD8EE bskh5jzt6Fc6Rf02f9aJZMPlb8mIBEjQCmKIEtRjTWMlIUf+g4D+aljslvwdqYgP 33GCQsCiQhyAz5sljygf =FZuF -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/554a4dc1.6040...@stoecker-family.de
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 05/04/2015 12:10 PM, Daniel Bareiro wrote: Thanks for confirm the behavior that I had mentioned. I don't remember this happening with Apache 2.2.22 on Debian Wheezy. So at the beginning of this thread I had asked whether it is likely that this configuration is compiled into Apache. I also got the following output with apachectl: # apache2ctl -S I got the following: VirtualHost configuration: ServerRoot: /etc/apache2 Main DocumentRoot: /var/www/html Main ErrorLog: /var/log/apache2/error.log Mutex default: dir=/var/lock/apache2 mechanism=fcntl Mutex mpm-accept: using_defaults Mutex watchdog-callback: using_defaults PidFile: /var/run/apache2/apache2.pid Define: DUMP_VHOSTS Define: DUMP_RUN_CFG Define: ENABLE_USR_LIB_CGI_BIN User: name=www-data id=33 Group: name=www-data id=33 To describe me situation more precise: I had wheezy up and running with a postfix mailman configuration, which also requires apache. Wheezy came with apache 2.2. I disabled the default site and activated the mailman site (by just removing respective adding the symbolc links). Of course apache was still listening at port 80, but with a disabled default site, the default site was never reachable. After the upgrade to jessie, the default site was again activated by the upgrade and my mailman site was not listed. Now I did again deactivate the default site and activated the mailman site. The result was now different, because with a deactivated default site, the default site ist still reachable. The ist totally different to wheezy. the mailman.conf is as follows: - # Sample configuration for Debian mailman with Apache # We can find mailman here: ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/ # And the public archives: Alias /pipermail/ /var/lib/mailman/archives/public/ # Logos: Alias /images/mailman/ /usr/share/images/mailman/ # Use this if you don't want the cgi-bin component in your URL: # In case you want to access mailman through a shorter URL you should enable # this: ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/ # In this case you need to set the DEFAULT_URL_PATTERN in # /etc/mailman/mm_cfg.py to http://%s/mailman/ for the cookie # authentication code to work. Note that you need to change the base # URL for all the already-created lists as well. Directory /usr/lib/cgi-bin/mailman/ AllowOverride None Options ExecCGI AddHandler cgi-script .cgi Order allow,deny Allow from all /Directory Directory /var/lib/mailman/archives/public/ Options FollowSymlinks AllowOverride None Order allow,deny Allow from all /Directory Directory /usr/share/images/mailman/ AllowOverride None Order allow,deny Allow from all /Directory --- BR Marco -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/554a3455.9080...@stoecker-family.de
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Daniel Bareiro wrote: Marco Stoecker wrote: I do have the same issue. I disabled the default config in sites-enabled (which in fact removed the symbolic link to the 000-default.conf in sites-available) and did a restart of apache, but still the default page is showing up. I there another way to disable the default site? I'd like to have only the mailman site enabled. Thanks for confirm the behavior that I had mentioned. I don't remember this happening with Apache 2.2.22 on Debian Wheezy. So at the beginning of this thread I had asked whether it is likely that this configuration is compiled into Apache. I cannot reproduce the behavior that you have reported. I had previously tested on my Sid system. I just now debootstrap'd a pristine Jessie 8 system and tested and apache2 is not listening to port 80 after performing the following configuration which was previously discussed in this thread. Ensure that no web server is running in the host environment. service apache2 stop service nginx stop service ... stop # ... any other installed web servers ... wget -O/dev/null -S http://127.0.0.1/ --2015-05-05 17:01:51-- http://127.0.0.1/ Connecting to 127.0.0.1:80... failed: Connection refused. ... Good. No web servers are running as verified above. ... Then set up a pristine test case system in a chroot. debootstrap jessie /srv/chroot/jessie http://http.debian.net/debian mount -o bind /proc /srv/chroot/jessie/proc chroot /srv/chroot/jessie su - apt-get install apache2 ln -sfn ../sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default.conf a2enmod ssl sed --in-place '/^Listen 80/s/^/# /' /etc/apache2/ports.conf service apache2 restart At that point apache is running. It is not listening on port 80. # wget -O/dev/null -S http://127.0.0.1/ --2015-05-05 17:01:51-- http://127.0.0.1/ Connecting to 127.0.0.1:80... failed: Connection refused. It is listening on port 443 with ssl. # wget -O/dev/null -S -q --no-check-certificate https://127.0.0.1/ HTTP/1.1 200 OK Date: Tue, 05 May 2015 23:01:14 GMT Server: Apache/2.4.10 (Debian) Last-Modified: Tue, 05 May 2015 22:47:53 GMT ETag: 2b60-5155d780793dc Accept-Ranges: bytes Content-Length: 11104 Vary: Accept-Encoding Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html Please double check and ensure that you have accomplished all of the required steps again. I feel certain that one of them has been left out. If you still think there is a problem then try the above steps to reproduce it using a pristine system. Then compare the pristine environment to the problem environment. Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Hi Bob, I do have the same issue. I disabled the default config in sites-enabled (which in fact removed the symbolic link to the 000-default.conf in sites-available) and did a restart of apache, but still the default page is showing up. I there another way to disable the default site? I'd like to have only the mailman site enabled. BR Marco On 05/04/2015 07:45 AM, Bob Proulx wrote: Daniel Bareiro wrote: Case 2: [I disabled the 000-default] ... Case 3: [Now I disable additionally default.freesoftware.conf] ... Despite not being enabled 000-default, would be expected this behavior? Did you restart the server after making your config file changes? You didn't mention it. I can't think of any other reason for the behavior you describe. service apache2 restart Bob -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/a3c4dc680bf9daa6367f43e9fec4d...@metaxa.loswebos.de
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 04/30/2015 10:23 PM, Daniel Bareiro wrote: Hi all! Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? Hi, all your configuration files in /etc/apache2/sites-enabled/ and /etc/apache2/sites-available/ should end with .conf string e.g. mysite.com.conf. For default site you can use _default_ key word, see http://httpd.apache.org/docs/2.4/vhosts/examples.html. HTH Kind regards Georgi -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/55472c04.5070...@oles.biz
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 04/05/15 04:50, Marco Stoecker wrote: Hi Bob, Hi, Marco. I do have the same issue. I disabled the default config in sites-enabled (which in fact removed the symbolic link to the 000-default.conf in sites-available) and did a restart of apache, but still the default page is showing up. I there another way to disable the default site? I'd like to have only the mailman site enabled. Thanks for confirm the behavior that I had mentioned. I don't remember this happening with Apache 2.2.22 on Debian Wheezy. So at the beginning of this thread I had asked whether it is likely that this configuration is compiled into Apache. I also got the following output with apachectl: # apache2ctl -S VirtualHost configuration: *:443 webmail.freesoftware (/etc/apache2/sites-enabled/webmail.freesoftware.conf:1) ServerRoot: /etc/apache2 Main DocumentRoot: /var/www/html Main ErrorLog: /var/log/apache2/error.log Mutex watchdog-callback: using_defaults Mutex ssl-stapling: using_defaults Mutex ssl-cache: using_defaults Mutex default: dir=/var/lock/apache2 mechanism=fcntl Mutex mpm-accept: using_defaults PidFile: /var/run/apache2/apache2.pid Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name=www-data id=33 Group: name=www-data id=33 Best regards, Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/554745a0.6090...@gmx.net
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Daniel Bareiro wrote: Case 2: [I disabled the 000-default] ... Case 3: [Now I disable additionally default.freesoftware.conf] ... Despite not being enabled 000-default, would be expected this behavior? Did you restart the server after making your config file changes? You didn't mention it. I can't think of any other reason for the behavior you describe. service apache2 restart Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 2015-04-30, Daniel Bareiro daniel-lis...@gmx.net wrote: Hi all! Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? Thanks in advance! Best regards, Daniel You can create a file, .htaccess , in the top level to be protected with: SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq www.yoursite.org ErrorDocument 403 https://www.yoursite.org/pathto/httperror.htm -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/slrnmk9guq.l3c.alanjg@archduke.router
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Hi, Bob. On 01/05/15 17:30, Bob Proulx wrote: Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? By default apache2 will install with this: lrwxrwxrwx 1 root root 35 May 1 14:22 000-default.conf - ../sites-available/000-default.conf Of course that file has: VirtualHost *:80 DocumentRoot /var/www/html And with this in /etc/apache2/ports.conf: Listen 80 Removing that default configuration will remove apache from listening on port 80 leaving only your configuration listening on port 443. Yes, I've seen it. But it is currently disabled: root@mail:/etc/apache2/sites-enabled# ll total 0 lrwxrwxrwx 1 root root 44 abr 29 16:45 webmail.freesoftware.conf - ../sites-available/webmail.freesoftware.conf So I do not explain to me why when accessing the IP of server (for example) it is shown the It's works site. I have purged the content in the browser cache (just in case) and even opened a different browser to test it, but the result is the same. It is strange because these days I upgraded other hosts with Apache to Debian Jessie and I have not had this problem. I will continue investigating. Thanks for your reply. Best regards, Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/55451009.2040...@gmx.net
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On 02/05/15 14:57, Daniel Bareiro wrote: I will continue investigating. Well, I was doing some testing: (Server listening on ports 80 and 443) Case 1: --- root@mail:/etc/apache2/sites-enabled# ll total 0 lrwxrwxrwx 1 root root 35 may 2 19:02 000-default.conf - ../sites-available/000-default.conf (Port 80) lrwxrwxrwx 1 root root 44 may 2 19:02 default.freesoftware.conf - ../sites-available/default.freesoftware.conf (Port 80) lrwxrwxrwx 1 root root 44 may 2 18:43 webmail.freesoftware.conf - ../sites-available/webmail.freesoftware.conf (Port 443) http://10.1.0.11 = It's works! This is expected, because the 000-default virtual host is the one that Apache has configured by default. Case 2: --- [I disabled the 000-default] root@mail:/etc/apache2/sites-enabled# ll total 0 lrwxrwxrwx 1 root root 44 may 2 19:02 default.freesoftware.conf - ../sites-available/default.freesoftware.conf (Port 80) lrwxrwxrwx 1 root root 44 may 2 18:43 webmail.freesoftware.conf - ../sites-available/webmail.freesoftware.conf (Port 443) http://10.1.0.11 = This is the default site (Text displayed by the index.html of this site) This is also expected, because now the default site for port 80 is the content of default.freesoftware.conf Case 3: --- [Now I disable additionally default.freesoftware.conf] root@mail:/etc/apache2/sites-enabled# ll total 0 lrwxrwxrwx 1 root root 44 may 2 18:43 webmail.freesoftware.conf - ../sites-available/webmail.freesoftware.conf (Port 443) http://10.1.0.11 = It's works! Despite not being enabled 000-default, would be expected this behavior? Best regards, Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/5545528b.5030...@gmx.net
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Daniel Bareiro wrote: Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? By default apache2 will install with this: lrwxrwxrwx 1 root root 35 May 1 14:22 000-default.conf - ../sites-available/000-default.conf Of course that file has: VirtualHost *:80 DocumentRoot /var/www/html And with this in /etc/apache2/ports.conf: Listen 80 Removing that default configuration will remove apache from listening on port 80 leaving only your configuration listening on port 443. Bob signature.asc Description: Digital signature
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
Hi, Dan. On 30/04/15 16:34, Dan Ritter wrote: Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? There's no magic going on. If you want a site to be accessible via https only, you have choices: - don't Listen 80 - set a VirtualHost servername:443 rather than servername:* - and you may want to set VirtualHost _default_:80 to some other directory tree entirely. Yes, I had defined the virtual host using VirtualHost *:443. Before migrating Wheezy to Jessie for this host, I was using a default site configuration as the following (which is almost the same that Apache 2.4.10 has in apache2.conf). Directory / Options FollowSymLinks AllowOverride None /Directory Directory /var/www Options FollowSymLinks Order allow,deny # Require all granted (for Apache 2.4.10) /Directory Thus, when trying to access the site via HTTP on Wheezy, access was not possible. Just as access somewhere else undefined. But with Apache 2.4.10 it seems that this behavior is not possible, because it uses /var/www/html as default site despite having on apache2.conf a similar configuration to that I used earlier with Wheezy in the 000-default of sites-enabled. Perhaps then the only alternative would be to use something like this? VirtualHost _default_:80 RedirectMatch 404 (.*) /VirtualHost VirtualHost _default_:443 RedirectMatch 404 (.*) /VirtualHost Thanks for your prompt response. Best regards, Daniel -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/55428cc7.5000...@gmx.net
Re: Default virtualhost on Debian Jessie with Apache 2.4.10
On Thu, Apr 30, 2015 at 04:23:20PM -0300, Daniel Bareiro wrote: Hi all! Currently I have a unique site in sites-enabled which is accessed only via HTTPS. Hoping to have an access error when trying to access this site via HTTP, Apache sends me to the default site which is It's works! page in /var/www/html. I was looking in the Apache configuration files where is configured the default site but I have not found it. This was set at low level in the compilation of the service? There's no magic going on. If you want a site to be accessible via https only, you have choices: - don't Listen 80 - set a VirtualHost servername:443 rather than servername:* - and you may want to set VirtualHost _default_:80 to some other directory tree entirely. -dsr- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20150430193430.ga23...@randomstring.org