Tag Info

Hot answers tagged

30

There's probably no harm in having those other domains pointing to your host, except of course that it increases the load on your server. If you want to block them, set up new virtual hosts for them: NameVirtualHost *:80 <VirtualHost *:80> ServerName example.com # example.com configuration </VirtualHost> <VirtualHost *:80> ...


23

Change your authorization configuration: <Directory /home/remix/> #... Order allow,deny Allow from all </Directory> ...to the Apache 2.4 version of the same. <Directory /home/remix/> #... Require all granted </Directory> Review the upgrading overview document for information on other changes you might need to ...


16

You only need listen options on one declaration for a socket. Generally you would put them on the declaration that also includes the default_server flag, but for some options, I think you can just set them on any one listen directive. Just remove the ipv6only=on from all of the listens except one.


11

You can't do this in one virtual host, because Apache needs to know which one's going to talk SSL and which one isn't (sidenote: nginx doesn't have this problem, you can tell it which listen directives relate to SSL; one of the many reasons I love it). The way I manage this in Apache is to put all my non-SSL-related configuration into a separate file, and ...


10

Look very closely at the include statements. Do you see it yet? No? it includes sites-enabled/*.conf, so rename your configfiles so they have the .conf extension.


9

For Debian/Ubuntu use the following: apache2ctl -S


8

I had a very similar problem. Like you, I was unable to follow symlinks under my home directory even though I had the FollowSymlinks enabled plus I could ls around with my http user, but putting symlinks under /srv/http worked just fine... I fixed it by chmod'ing my home directory to be executable: chmod +x /home/mgalgs And that did it for me! Maybe try ...


7

I shall show you. The configuration file server { server_name example.com www.example.com; root www/pub; } server { server_name ~^(.*)\.example\.com$ ; root www/pub/$1; } Test files We have two test files: $ cat www/pub/index.html COMMON $ cat www/pub/t/index.html T Testing Static server names: $ curl -i -H 'Host: example.com' ...


7

You can't send redirects without a vlid certificate. The redirect is done in either the HTTP protocol by returning a 301 or 302 response, or in html content with a meta header. For this data to be sent, the SSL connection needs to be set up first, with a valid certificate. So don't be ridiculously cheap and get an almost-free startssl certificate for the ...


6

Because you have set the SVNPath directive, you have "hard coded" the path: SVNPath /ebs/svn/repo1 Try using the SVNParentPath directive instead, to configure the "top" directory that will hold all your repositories. Replace the above line with this: SVNParentPath /ebs/svn/ If you want to allow users to view a list of all the available repositories if ...


6

I'm assuming that you have two VirtualHosts: VH for WP that hosts *.mydomain.com VH for independant webiste that hosts subdomain.mydomain.com Make sure that your subdomain.mydomain.com VirtualHost is loaded or located in file before the VirtualHost with ServerAlias of *.mydomain.com. Apache will use the 1st VH it finds that matches ServerName/Alias. ...


6

By using an IP address to access your server you are bypassing the DNS system so this has nothing to do with DNS or Bind. If you are observing this as the response from a web server and the webserver is apache then my guess is that you are creating vhosts in such a manner that they are defined alphabetically. Without any way to differentiate between vhosts ...


5

Try this: server { listen 1.2.3.4:80; # server_name site1.com www.site1.com; ... } server { listen 1.2.3.5:80; # server_name site2.com www.site2.com; ... }


5

Yes just add them to your ServerAlias ServerAlias domain.co.uk www.domain.com domain.com Or you could do it like this: ServerName domain.co.uk ServerAlias *.domain.co.uk domain.com *.domain.com I think you have som inconsistency problems with your posted code. Using both C:/htdocs/domain.co.uk/ and C:/htdocs/domain.com/ If it was up to me. I would ...


5

It turns out that if you are using fastcgi you can get around this by passing the values from fastcgi_param. server { listen 80; server_name domain; # Pass PHP scripts to php-fastcgi listening on port 9000 location ~ path/to/it { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_param FOO "bar"; } }


5

Why is xy.com the default if you don't want it to be? Add a new default virtual host that does nothing but return a 404. Then add xy.com as a virtual host entry. It'll only get used if requested.


5

Why not simply change the default VHost to a deny one? <VirtualHost *:80> ServerName lol.no DocumentRoot /var/empty/httpd <Location /> Deny from all Allow from none </Location> </VirtualHost> <VirtualHost *:80> ...your VHost goes here... </VirtualHost>


4

Regarding "where the heck did this other name for my website come from", anyone can put any A record they like at any name below a domain they control. You can investigate a little by using whois to find out who has registered the second-level domain containing the offending DNS name.


4

The vhost definitions are inserted into a hash table during initialization, so the overhead of looking them up is minimal, and order is likely irrelevant (except for the first one, as you mentioned). You can read about the details in the Apache documentation. They also have a page on performance tips, where no mention is made of ordering.


4

this one worked for me: location / { rewrite "/([a-z0-9]{32})\.png" /index.php?page=log&id=$1 break; } Or if you want separeted location: location ~* "/([a-z0-9]{32})\.png" { rewrite /(.*) /index.php?page=log&id=$1 last; }


4

Just define default vhost that will point to directory with blank index.html file. server { listen 80 default_server; server_name _ ; root /var/www/placeholder ; index index.html; } and place blank index in /var/www/placeholder


4

I had faced exactly the same issue few days back. I tried the following in my VirtualHost config (applicable for http port 80) in apache httpd.conf file that worked. <Virtualhost *:80> ServerAdmin webmaster@site.com ServerName site.com ServerAlias site.com www.site.com RedirectMatch permanent ^(.*)$ https://www.site.com$1 </Virtualhost> This ...


4

The first vhost that Apache picks up from your configuration is the default one picked when the name that the client sends doesn't match any configured vhost, so you'll have to make a vhost that sends 403 errors and ensure that it's picked up first in the httpd config.


4

No. IE (any version) running on WinXP, and Safari running on XP or older OS X won't do SNI. That's your default browsers for some of the most common platforms out. Get a dedicated IP address. If you have a virtual private server, you have one already, and extra IPs are not expensive at most providers. If you aren't running at least a virtual private server, ...


3

Solving the HTTP to secure.example.com is easy. You just create an additional virtual host to direct to HTTPS: <VirutalHost 10.0.0.1:80> ServerName secure.example.com Redirect / https://secure.example.com/ </VirtualHost> Solving the HTTPS to www.example.com is harder. The problem is that usually you can not do name based virtual ...


3

hehe.. search in your apache config directory for /icons. you'll probably find in one of the files something like: Alias /icons/ "/usr/share/apache2/icons/" in debian/ubuntu world this is set in /etc/apache2/mods-enabled/alias.conf files served from that directory are used for icons in directories listings generated by apache. just comment out this line ...


3

One option is to put the common configuration i separate file, and use the Include directive to have it used in both VirtualHosts.


3

This isn't a problem with the redirect, it's a problem with the SSL (the request has to be decrypted before the redirect will take place). Do you have Listen 443 anywhere in your Apache config? Stick it in if you don't, near the Listen 80 part. Are you running any other SSL websites on this server? Make sure they're not using the same IP address. Finally, ...


3

ssl_error_rx_record_too_long happens when apache is expecting ssl and receives http. Make sure all port 443 requests get to a virtual host with SSLEngine On. You need to fix your <VirtualHost 127.0.1.3:443>. Also, your certificate needs to work for both example.com and *.example.com. Otherwise your clients will get ugly warnings instead of a ...


3

Take a look at apache2-mpm-itk and/or suPHP.



Only top voted, non community-wiki answers of a minimum length are eligible