Questions tagged [apache]

Use this tag (along with an appropriate programming-language tag) for programming questions relating to the Apache HTTP Server. Do not use this tag for questions about other Apache Foundation products. Note that server configuration questions are usually a better fit on https://serverfault.com

apache
Filter by
Sorted by
Tagged with
24 votes
7 answers
38k views

apache redirect http to https and www to non www

basically what i want is redirect al request to use HTTPS instead of http I have this in my htaccess so far and it worked great: Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond ...
misulicus's user avatar
  • 425
22 votes
6 answers
58k views

Redirect requests only if the file is not found?

I'm hoping there is a way to do this with mod_rewrite and Apache, but maybe there is another way to consider too. On my site, I have directories set up for re-skinned versions of the site for clients....
DivideByHero's user avatar
  • 20.1k
18 votes
7 answers
16k views

Preventing Caching of CSS Files

I am developing a simple website using PHP. Development Configuration : WAMP Production Configuration : LAMP While testing, I changed my CSS file, but when I reload the page my browser(not sure) ...
Ankit's user avatar
  • 6,872
10 votes
2 answers
10k views

Mod_Rewrite unexpected behavior L flag

my web application structure is: /var/www/myapp/ - www/ - index.php - css.php - .htaccess the virtual host is configured as: <VirtualHost *:80> ServerName ...
MaCi's user avatar
  • 173
5 votes
4 answers
2k views

CSS, JS and images do not display with pretty url

I am trying to rewrite the URL through the htaccess file so that the following URL www.domain.com/subfolder/index.php?key can be accessed by: www.domain.com/subfolder/index.php/key the specified "...
PHPNorton's user avatar
  • 159
183 votes
13 answers
77k views

MAMP Pro 3.05 on Mavericks updated to Yosemite - Apache does not start

I have been running MAMP Pro 3.05 successfully in Yosemite up to DP4 on a partition that was a clean install of Yosemite. I now have run the installer for DP5 over my Mavericks install, and now that ...
Steve's user avatar
  • 14.7k
157 votes
5 answers
49k views

How Python web frameworks, WSGI and CGI fit together

I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py ...
Eli Bendersky's user avatar
143 votes
22 answers
199k views

How can I force users to access my page over HTTPS instead of HTTP?

I've got just one page that I want to force to be accessed as an HTTPS page (PHP on Apache). How do I do this without making the whole directory require HTTPS? Or, if you submit a form to an HTTPS ...
105 votes
13 answers
113k views

Authorization header missing in PHP POST request

I'm currently trying to read the authorization header in a PHP script that I'm calling with a POST request. The Authorization header is populated with a token. It seems the Authorization header is ...
jimmy's user avatar
  • 4,731
100 votes
22 answers
191k views

Wordpress REST API (wp-api) 404 Error: Cannot access the WordPress REST API

I have been using the Wordpress REST plugin WP-API for months now while developing locally with XAMPP. I recently migrated my site to an EC2 instance and everything is working fine except I now get a ...
dsal1951's user avatar
  • 1,710
97 votes
7 answers
100k views

`Apache` `localhost/~username/` not working

So I just recently upgrade to Mac OS X Yosemite and I need to set up my Apache again. I create a folder "Sites" under /user/kevin and change file permission to 777 and uncomment the ...
CocoHot's user avatar
  • 1,226
84 votes
3 answers
35k views

When setting environment variables in Apache RewriteRule directives, what causes the variable name to be prefixed with "REDIRECT_"?

I am trying to set Apache environment variables (for use in PHP) with the [E=VAR:VAL] flag on RewriteRule rules in an .htaccess file. I have already discovered the variables are accessed in PHP as ...
trowel's user avatar
  • 981
84 votes
7 answers
87k views

Need to allow encoded slashes on Apache

I'm currently trying to place a URL within a URL. For example: http://example.com/url/http%3A%2F%2Fwww.url2.com I'm aware that I have to encode the URL, which I have done, but now I am getting a 404 ...
tommizzle's user avatar
  • 1,009
84 votes
7 answers
126k views

Running Node.js in apache?

We have an Apache Webserver installed on a machine which also serves pages using Perl. For a project I've decided to use Node.js instead of Perl/Ruby. Just wondering if it's possible to use Apache as ...
JackSparrow123's user avatar
78 votes
5 answers
147k views

Do I need to restart Apache after changing the php.ini file?

If I make a change to a setting in the php.ini file - do I need to restart Apache in order for it to take effect?
simbro's user avatar
  • 843
71 votes
9 answers
364k views

Directory index forbidden by Options directive

I'm using the dompdf plugin for codeigniter: http://codeigniter.com/wiki/PDF_generation_using_dompdf/ to generate pdfs from a form. This works on localhost, but on the live server I get this in the ...
logic-unit's user avatar
  • 4,295
63 votes
18 answers
218k views

java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

I have Hadoop 2.7.1 and apache-hive-1.2.1 versions installed on ubuntu 14.0. Why this error is occurring ? Is any metastore installation required? When we typing hive command on terminal how the xml'...
Arti Nalawade's user avatar
61 votes
10 answers
222k views

SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

After upgrading to PHP 5.6 I get an error when trying to connect to a server via fsockopen().. The certificate on the server (host) is self-signed PHP Warning: fsockopen(): SSL operation failed ...
clarkk's user avatar
  • 27.2k
60 votes
3 answers
60k views

php can't connect to mysql with error 13 (but command line can)

I have weird situation in newly installed server, and it seems that Google can't help me this time. I can't connect to (remote) mysql from my php-code. When I try to connect from command line on the ...
SimSimY's user avatar
  • 3,636
57 votes
4 answers
180k views

How can I use an .htaccess file in Nginx?

I am currently migrating my website from Apache to nginx, but my .htaccess file is not working. My website is inside the /usr/share/nginx/html/mywebsite folder. How can I use .htaccess in my nginx ...
Sandeep Bhaskaran's user avatar
54 votes
2 answers
84k views

Set an environment variable in .htaccess and retrieve it in PHP

I am trying to set an environment variable in an .htaccess file and retrieve it in PHP. I've looked through a bunch of other threads here on SO but everything I've tried so far has failed. I've added ...
Bruno Cloutier's user avatar
54 votes
8 answers
27k views

How do I throttle my site's API users?

The legitimate users of my site occasionally hammer the server with API requests that cause undesirable results. I want to institute a limit of no more than say one API call every 5 seconds or n calls ...
scotts's user avatar
  • 4,037
53 votes
7 answers
45k views

If you use HTTPS will your URL params will be safe from sniffing? [duplicate]

Suppose I setup a simple php web server with a page that can be accessed by HTTPS. The URL has simple parameters, like https://www.example.com/test?abc=123. Is it true that the parameter here in ...
erotsppa's user avatar
  • 1,741
39 votes
8 answers
87k views

Running two PHP versions on the same server using Apache

I have two projects on the local server, one project is running PHP5.6 and the other one is running PHP7.0. Now would it be possible to enable these two versions based on the projects? I already tried ...
etcz0ne's user avatar
  • 1,402
35 votes
2 answers
143k views

SSL Connection Reset

I am attempting to connect to an HTTPS endpoint in Java. Every method I have tried (more details below) ends up generating this stack trace: java.net.SocketException: Connection reset at java.net....
roguenet's user avatar
  • 1,283
31 votes
5 answers
82k views

How to restrict access by IP address with Tomcat?

Does anyone know if Tomcat can restrict access to certain application by IP address (like Apache's .htaccess)?
SMSM's user avatar
  • 1,519
29 votes
8 answers
45k views

Failed to Load Resource, Plugin Handled Load on iOS

Every time I try to view a video file on my server I get this error on iOS in Safari, Chrome. I am using a blob server and then an Apache server so I am not sure what the problem is. However, when I ...
CodeGeek123's user avatar
  • 4,461
26 votes
4 answers
94k views

Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

I'm googling for how to this error a lot of hours. I've tried all solutions from this topic without luck. <? phpinfo(); ?> (the only difference I'm using Appserver instead of IIS) it doesn't ...
Jack's user avatar
  • 16.5k
26 votes
4 answers
16k views

Set RewriteBase to the current folder path dynamically

Is there any way to set RewriteBase to the path current folder (the folder which the .htaccess file is in) relative to the host root? I have a CMS and if I move it to the directory in my host it does ...
Eeliya's user avatar
  • 1,564
18 votes
5 answers
73k views

Changing the root folder via .htaccess

I've got a shared hosting account associated with a domain name and the root folder (correct me if that's the wrong term) is set to / so that all files on the server are public / accessible through ...
Emanuil Rusev's user avatar
16 votes
4 answers
12k views

How to use vhosts alongside node-http-proxy?

I'm running Nodejs and Apache alongside each other. node-http-proxy is listening on port 80 and then forwarding requests to either Apache(:9000) or to Express(:8000). My virtual hosts on Apache look ...
gxc's user avatar
  • 5,068
15 votes
4 answers
13k views

RegExp in preg_match function returning browser error

The following function breaks with the regexp I've provided in the $pattern variable. If I change the regexp I'm fine, so I think that's the problem. I'm not seeing the problem, though, and I'm not ...
user974552's user avatar
11 votes
6 answers
48k views

Redirect all traffic to index.php using mod_rewrite

I'm trying to build a url shortener, and I want to be able to take any characters immediately after the domain and have them passed as a variable url. So for example http://google.com/asdf would ...
bswinnerton's user avatar
  • 4,661
5 votes
2 answers
3k views

Inkscape inside PHP/Apache doesn't render fonts to PNG

An issue I discover today is similar to this unanswered problem; though not the same, it may have the same cause. I'm rendering SVG files using inkscape, as either PNG or PDF. For the most part I ...
halfer's user avatar
  • 20.2k
4 votes
2 answers
8k views

Apache poi Excel line chart points

I am creating an Excel file with line chart. I've created chart and filled it with data but I cannot create points on my chart. Does anyone know, is there a way I could generate these points(triangles,...
Krzysztof Majewski's user avatar
3 votes
1 answer
11k views

django apache configuration with WSGIDaemonProcess not working

Updated Question [Mon Jul 18 09:20:10.517873 2016] [:error] [pid 30316:tid 139756302964480] [remote 122.164.94.99:48261] Traceback (most recent call last): [Mon Jul 18 09:20:10.518005 2016] [:error] [...
Prabhakaran's user avatar
  • 3,950
2 votes
2 answers
12k views

Parse HTML as PHP

Are there any security / performance concerns if we set the Apache web server to configure Apache to handle all HTML as PHP? I was specifically referring to: AddType application/x-httpd-php .php ....
moey's user avatar
  • 10.8k
2 votes
3 answers
7k views

Obsolete cryptography warning from Browser

I have started a Windows Server with Apache 2.4 and SSL. When I connect with https://www.example.com and click on green lock, i have message: Your connection to website is encrypted with obsolete ...
Hid Dencum's user avatar
0 votes
2 answers
17k views

.htaccess rewrite "/book.php?id=1234" to "/book/1234"

This is what I have so far in my development environment: php_value error_log log/php.log php_value display_errors 1 php_value magic_quotes_gpc Off RewriteEngine On # remove slash RewriteCond %{...
whallz's user avatar
  • 2,473
179 votes
9 answers
257k views

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

I've got a XAMPP installation running on Windows 7. As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost AND the new dropbox.local aren't working. This is what I ...
Highmastdon's user avatar
  • 7,250
113 votes
10 answers
327k views

how to configuring a xampp web server for different root directory

The web directory is the home of all of your application's public and static files. Including images, stylesheets and JavaScript files. It is also where the front controllers live. So the question is ...
vardius's user avatar
  • 6,446
86 votes
18 answers
146k views

Apache Server (xampp) doesn't run on Windows 10 (Port 80)

I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or tell Apache to use another ...
Aloso's user avatar
  • 5,291
75 votes
5 answers
195k views

how to make log4j to write to the console as well

Is there any way to tell to log4j to write its log to the file and to the console? thanks there are my properties: log4j.rootLogger=DEBUG,console,R log4j.rootLogger=INFO, FILE log4j.appender.CONSOLE=...
fatnjazzy's user avatar
  • 6,090
73 votes
4 answers
182k views

What does the HTTP 206 Partial Content status message mean and how do I fully load resources?

I have some image tags on a site like this. <img src="img.png"/> When I try to load them they are only half loading. When I checked the request in the network console I see that the response ...
prasadmsvs's user avatar
  • 1,709
69 votes
13 answers
134k views

PHP returns error 500, but nothing is logged

I am having an issue when I have a php application that is returning an internal server error (500) however nothing is showing up in the error log. Now I know there are error with what I am trying to ...
ryanzec's user avatar
  • 27.6k
67 votes
6 answers
156k views

Starting of Tomcat failed from Netbeans

I have problem with starting Apache Tomcat 6 from Netbeans IDE 7.4 (on 7.3 version I had the same troubles. Other people mentioned that this problem exist also in other versions, like 8.0 etc). What ...
liquide's user avatar
  • 1,375
65 votes
15 answers
105k views

Debug message "Resource interpreted as other but transferred with MIME type application/javascript"

OK, I understand what the messages means, but I'm really not sure what's causing it. I'm using Safari and the Web Inspector on Mac OS X, by the way. I've got the following in my document head: <...
Gaz's user avatar
  • 1,598
63 votes
6 answers
158k views

client denied by server configuration

I try to setup kohana 3 project as virtual host. Config: <VirtualHost *:80> DocumentRoot "D:/Devel/matysart/matysart_dev1" ServerName matysart-one.local ServerAlias www.matysart-one....
Codium's user avatar
  • 3,210
60 votes
13 answers
113k views

PHP errors NOT being displayed in the browser [Ubuntu 10.10]

I'm new to PHP and the whole LAMP stack but I've managed to get it up and running on my Ubuntu 10.10 system. Everything seems to be working with the exception of error reposting in the browser which I ...
raven-king's user avatar
  • 1,550
58 votes
2 answers
51k views

apache HTTP:X-Forwarded-Proto in .htaccess is causing redirect loop in dev environment

I've had to update my .htaccess from this: RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] to this: RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^ ...
greg's user avatar
  • 6,873

1
3 4
5
6 7
157