Tag Info

Hot answers tagged

11

When you type the URL in a web browser, http://www.foo.com, it will always attempt to connect on port 80. It's not so much that the port is being hidden, but rather that it's being assumed, since port 80 is the default for HTTP requests. Along the same line, if you browse to https://www.foo.com, it will always attempt to connect on port 443 unless you ...


6

What will occur depends on how you have setup your web server. A web server may be setup to display an index page - that is a page that is displayed when a directory is accessed. In this case, the server will typically try all the files listed (e.g. index.htm, index.html, index.php, etc) in the order listed, and display the first one that is available, or ...


6

I would have said that placing these sensitive files above the document root would be preferable. And perhaps easier to manage if they are all contained in a particular directory, however... Using .htaccess to prevent access to all .db and .exe files and return a 403 - Forbidden. <Files ~ "\.(db|exe)$"> Deny from all </Files> Unless you have ...


5

If wamp is running make sure no other program conflict Wamp such as IIS, Microsoft Web Deploy, SQL, Skype, Zonealarm, firewall/antivirus, NOD32, Eset, any web related program including Remote Desktop, Teamviewer ... IIS and Apache/Wamp are both web server and might conflict in some way, so you have to disable IIS in order for Wamp to work Disable IIS in ...


4

FIRST: First defined VirtualHost will be used as catch all for unknown domain names. Apache does not know about apples.co.uk -- it only knows about www.apples.co.uk. So it uses first Virtual Host to serve apples.co.uk. Redirect will work OK here. Apache does not know about bananas.co.uk -- it only knows about www.bananas.co.uk. So it uses first Virtual ...


4

Your <Dav On directive is not complete (no need for <) -- I assume it's just a copy-paste issue. More importantly -- you are using <Location> directive ... but providing physical path on your file system/hard drive. That's wrong -- <Location> is used to match URLs, not directories; to match directories you need to use <Directory>. ...


4

This is probably a silly question, but did you restart your web server process after modifying httpd.conf? Sometimes I forget to do that...


4

Here is the manual for DNS SRV records (RFC 2782) which can be used to change the default port to match what you actually use: _http._tcp.example.com. IN SRV 0 5 80 www.example.com. where next to last field is port, which can have any real value. DNS SRV records can redefine default http port for domain or only for (some) hosts inside ...


3

In order to work with two names under one site you have Respond from Apache side on both Host request (you done it) Configure DNS for domain in order to have 2 URLs route to the correct host In short: nslookup foobar.com and nslookup www.foobar.com must return answers and answers to be identical Your impression about <Directory> container ...


3

The HTTP protocol uses port 80 by default. If you configure your web server to use a nonstandard port, then the port needs to be specified in the URL. There's no way to hide that. In Apache, you can set the listening port in httpd.conf, e.g.: Listen 127.0.0.1:80 This can however be overridden in the vhost config, e.g.: <VirtualHost *:80>


3

Apache configuration is exhaustively covered in the Apache documentation (though, if you're using Debian or Ubuntu, there are some additional considerations) and the best way to familiarize with Apache will be to study each portion of the documentation as you encounter a need to use a particular module or set of directives. To address your specific ...


3

The s-maxage header is intended for proxies, while max-age is intended for regular users. A typical end user (not using a proxy) would have the file cached for a year. The same should be the case for someone using a proxy as well, since the proxy will likely send the file unmodified, i.e. including the max-age header. But the proxy itself would only cache ...


3

You have to question some confusion, so I'll talk about ways to do a redirect from www to no-www: 1.Create two VirtualHost for two domains and use 301 redirect: NameVirtualHost *:80 <VirtualHost *:80> ServerName example.com DocumentRoot "/path/to/site" </VirtualHost> <VirtualHost *:80> ServerName www.example.com Redirect ...


3

When you type an URL in a browser, unless you specify the port explicitly, the browser will assume port 80 (unless the path is HTTPS, in which case port 443 is assumed). Technically any URL can be rewritten to include :80 port directive. It is just redundant. On the server side there can only be one service listening at port 80. So, no, you can not have ...


2

Just create another virtual host for mail.example.com, and you can tell Apache to do whatever you want when people go to that host. <VirtualHost *:80> ServerAdmin admin@example.com ServerName mail.example.com ErrorLog logs/example_com-error_log # if you care about hits: CustomLog logs/example_com-access_log common Then, if you ...


2

But let's say you want people from your LAN to have full access, without being prompted for a password. In this scenario we could use: <Directory /home/www/site1/private> AuthUserFile /home/www/site1-passwd AuthType Basic AuthName MySite Require valid-user Order allow,deny Allow from 172.17.10 Satisfy any </Directory> This will ...


2

i had simalr problem and suggested answers didn't work for me. then read instructions of installing the application from -wampserver.com.... where it says: warning... you install install Visual C++ 2010 SP1 as shown below..... WARNING : You must install Visual C++ 2010 SP1 Redistributable Package x86 or x64 VC10 SP1 vcredist_x86.exe 32 bits : ...


2

As others have said, it's working now. For the actual reason: Just wait a little while. This error comes up on Dreamhost when you make some kinds of edits–in your case see the "DNS changes" heading for a detailed explanation–and they haven't fully resolved yet. If it lasts more than a couple of hours, then you should file a support request, because ...


2

Sadly it is not possible since this is controlled by the browsers. By default browsers will connect to port 80 and anything else needs to be added in the URL. There is 3 solutions I can think of what could work but ultimately it will not work for public users since some coding on the clients machines would need to be changed. Host File Method You could ...


2

The default host that is the one that is first # Default host (must be first) <virtualhost *:80> # I use localhost.localdomain, but any host name not matching later hosts gets handled here Servername localhost.localdomain DocumentRoot /home/www/default_site ... </virtualhost> <virtualhost *:80> ServerName ...


2

This is because you have not setup the SSL for the sub domain foo.example.com and so it uses the www. domain. If you do not want SSL you can simply remove the Virtual Host all together running on port 443, otherwise just add to the configuration the following: Allow foo.example.com to operate on SSL <VirtualHost *:443> ServerName ...


2

You'd do best to go ahead and change the servername inside httpd.conf, something like the below code. Make sure it is a non-alpha name, just normal text. <VirtualHost *> ServerName your_server_name DocumentRoot /var/www <Directory /var/www> AllowOverride All Options All </Directory> </VirtualHost>


2

You can use the .htaccess file to redirect from IP to domain using this code: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^555\.555\.555\.555 RewriteRule (.*) http://www.example.com/$1 [R=301,L] Change 555.555.555.555 to match the IP of your server, additionally though you can use canonical urls that will prevent duplicates entering ...


2

Not all servers use httpd.conf, but all have some type of configuration file. If you're using apache, the httpd.conf configurations can be overriden through .htaccess file in the root web directory unless overrides are turned off in httpd.conf See: http://httpd.apache.org/docs/2.2/howto/htaccess.html


1

Actually, it is impossible to specify different php.ini files for each virtual host. However you can change almost anything in the php.ini file by using the ini_set() function: It allows you to set the value of a given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the ...


1

I had that same issue, and don't know why it is failing either. I was able to work around it using this instead: <VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com # Redirect 301 / https://www.domain.com RedirectMatch permanent /(.*) https://www.domain.com/$1 </VirtualHost>


1

Change to this and try it, notice only two VirtualHost <VirtualHost *:80> ServerName domain.com ServerAlias *.domain.com Redirect permanent / https://www.domain.com/ </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/domain/ ServerName www.domain.com SSLEngine on SSLCertificateFile ssl.crt SSLCertificateKeyFile ...


1

The error message is a complaint from the mod_jk connector wanting a file that it can use for shared memory purposes. The most common reason to actually need this file is for load balancing, which it doesn't look like you're doing. The other reason is for status workers, which are rarely, if ever used. You can address the error, if you like, with a line ...


1

Setup a new default site in your apache-config and rewrite the url via .htaccess if this default site is called. Maybe something like /var/www/invalid-subdomain/.htaccess: RewriteEngine on RewriteBase / RewriteRule ^$ http://example.com/ [R,L] The above example is working well for my apache2 squeeze server.


1

I don't have any experience with Mono, but it seems like the other sites should work if you leave the location as / but only the base site would work if you set the location as /Landing. What most people would do is simply leave the location as / and use mod_rewrite to map non-phpmyadmin or -phpvirtualbox requests to the /Landing/ directory, e.g. ...



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