Tag Info

Hot answers tagged

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 ...


4

Probably the server doesn't recognize the script as executable, and that's why it offers it as a downloadable file. These lines should be present in your Apache config. Note that the path may need to be changed for the .so modules, depending on your configuration: *nix: # -- if you're using PHP 5, uncomment this line to activate it LoadModule php5_module ...


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

You could use a reverse proxy via mod_proxy. The Apache Httpd configuration would be along these lines: ProxyPass /6666/ http://localhost:6666/ <Location /6666/> ProxyPassReverse /6666/ Order deny,allow Allow from all </Location>


2

I can't think of any reason why one would want this sort of setup, but to make the best of a bad situation, I would give the sites different docroots to avoid unnecessary duplication of content/URLs and make the sites more maintainable, e.g.: /var/www/site1 /var/www/site2 /var/www/site3 To share assets, you ought to just keep the assets in the main site's ...


2

Supposing your server space supports PHP, you can: 1) Place into the public_html folder a file called idious-counter.php with this code into it: <?php define("COUNTER_START_VALUE", 0); define("COUNTER_LOG", "idious-counter.log"); //name of file you want to use to save the counter value ...


2

To be able to access a local resource as if it were the main site you need to do two things: Edit your hosts file such that your computer thinks that your domain name is served by localhost. Your hosts file should contain a line with 127.0.0.1 in it and your host name would need to be added to that line, something like: 127.0.0.1 localhost ...


1

Yet another alternative: If you have a master config file you can place the error reporting function in that file. It obviously then will affect the entire website. Yet another alternative: Place this in an htaccess file in the root directory of the site. Should affect every domain: php_flag display_errors off (or whatever you want it to be)


1

The easiest thing is to open a ticket on your new webhoster and and ask him how you could set up php.ini directives per your account. Given the code you showed it seems you were on a server with LiteSpeed where you can use php_flag in .htaccess file. Maybe the new server where you moved is using Apache + suPHP (and NOT LiteSpeed) in such case you would ...


1

Apache applies configurations for directories to a request from smallest to largest. In essence the <Directory /> section specifies virtual host defaults; since every other possible directory will have that portion in its path. If multiple (non-regular expression) sections match the directory (or one of its parents) containing a document, then ...


1

I would strongly recommend for the second one that has special characters that you use the <LocationMatch> Directive. The <LocationMatch> directive limits the scope of the enclosed directives by URL, in an identical manner to <Location>. However, it takes a regular expression as an argument instead of a simple string. ...


1

Actually you CAN host multiple SSL sites on port 443. The following code in your apache config file will do the trick. Otherwise, you can use whatever ports you want. The disadvantage will be that users will have to include the port number in the URL (eg. https://yourdomain.com:445/) ## SSL (HTTPS) PORT 443 Listen 443 NameVirtualHost *:443 LoadModule ...


1

The answer: Lowering load to HDD hosting system or sometimes to CPU. Why: It depends on scripts which rules the whole process. It may be cron scripts which runs every 5-10 min or scripts run when system idle or ... This situation similar to github pages - all changes visible with delay up to 10 minutes. This time set on nginx config file as cache time For ...


1

I think you want to remove the .php extension, so I'll give the .htaccess code to accomplish that: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php That should be located in the root directory. So suppose there is a file in the root folder named index.php, you can then access it at: ...


1

Please verify if /contacts exists with a folder permission of 755. The files under /contacts should have a permission of 644. Also rename your current .htaccess file and create a new .htaccess file with the following code. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d ...


1

Who is your hosting company? I'm familiar with hostmonster which has unlimited hosting using virtual subdomains as addon domains. I give all my clients pop3 access and if they need web access I tell them to go to http://mail.theirdomain.com/ and their emails/passwords work. The login is their complete email address / password Make sure they are clicking on ...


1

You have to pay attention to two directives specially: ServerName DocumentRoot Below is an example of two virtual hosts configured on top of the same IP: <VirtualHost W.X.Y.Z:80> ServerName serverA.com DocumentRoot "/var/www/html/serverA" # + other stuff like logging directives, etc. </VirtualHost> <VirtualHost W.X.Y.Z:80> ...


1

Here is a good answer on Ask Ubuntu iptables -t nat -A PREROUTING -p tcp --dport 6666 -j REDIRECT --to-port 80 This assumes you're not routing traffic for an entire network through this box and that if you were there's no expectation that traffic destined for other hosts will be on that port Update In case you mess up your iptables, here is a ...


1

Personally I use wampserver (wampserver.com/en). Like Brad stated, go with a bundled package like this instead of independently installed components. I had tried for a few weeks to install the "A.M.P" section of my WAMP stack independently without success. With the prepackaged WAMP bundle (or Brad's XAMPP) it should take you no time at all.


1

Depending on the webserver you're running and its configuration, yes. It is very common that index.html is read from the folder the webserver points to if you don't add a filename in the URL. In Apache, for example, these filename(s) are defined in the configuration with the directive DirectoryIndex. In Microsoft IIS default.asp is a common default ...


1

You could use a scripting language to detect the url that was entered and have the index page (index.php for example) load index.html, subdomain1.html or subdomain2.html based on the sub-domain detected. For Example index.php would be: <?php if($_SERVER['HTTP_HOST'] == 'www.sub_domain_1.com') { include('subdomain1.html'); } else if($_SERVER['HTTP_HOST'] ...



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