Category Archives: azure

Unable to add header on Apache webserver hosted by azure

I am trying to enable Anti clickjacking on a website hosted by Azure.

Its a shared hosting package run on Apache server. Problem is that i cant find the correct conf file to modify and add this line of code to:

header always set x-frame-options "SAMEORIGIN"

we found a file called apache2.conf and added this but after restarting apache server the line is removed from the conf.

Anyone any ideas what i can do ?

Azure API gives nosuchmethod error

I previously asked this question on MSDN forums so here's a link to the question there as it has most of the details.

Essentially, I'm working with a maven managed project that makes API calls to a microsoft azure account. However, the api library seems to be having some issue as calling network.create() is causing a nosuchmethod error.

Please feel free to ask if you need any additional information.

Laravel – Azure DNS – Website url issues ( works , does not)

I'm trying to setup my azure web app and having some issues with DNS and url

This is my htaccess in the root folder :

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]

This is my htaccess in the public folder :

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

This is my godaddy records :

enter image description here

My websites works at

but not for :

I get this page :

enter image description here

Drupal 7 doesn’t upload images styles

I have a drupal 7 hosted on windows azure as web app.

When I upload an image into a content, my original image is stored in the files folder but its corresponding image styles are not stored (example in the thumbnail folder).

I tried this:

  • Permissions 777/775
  • Comment the following lines in the htaccess located in the files folder:
#Options None
#Options + FollowSymLinks

I have the impression that it is Azure which blocks the writing of the files because the htaccess can be changed only in its own editor and not in my ftp.

Is It Possible To Perform A SQL Database Query As Part Of A WebConfig URL Rewrite Rule?

I'm currently in the process of migrating a PHP website from LAMP Hosting to Microsoft Azure Web Apps Hosting.

The site being migrated uses HTAccess for URL Rewriting purposes; however from what I can tell, Azure does not support the use of HTAccess files (please correct me if I am wrong in this) - instead, it appears that I must use IIS WebConfig for this purposes (a technology that I am not overly familiar with).

Assuming that I have to rewrite the file from HTAccess to WebConfig, the HTAccess file to be rewritten uses Mod_Rewrite and external Rewrite Maps as part of the URL rewriting process. The HTAccess Rewrite Map performs a Database Query as part of this process whereby a URL such as is inputted and then re-written to, i.e. the ID associated with each category name is identified via a Database query.

I've familiarised myself with the basics of Web Config and IIS Rewrite Maps thus far; however I have only encountered tutorials outlining static rewrite rules.

Is it possible to perform database queries using IIS Config - similar to the HT Access scenario outlined above?

If so, can someone please point me in the direction of some tutorials dealing with the topic or provide some sample code.

Any help is much appreciated.

apache2 crashes when trying to dynamically load python module

I have a Django application, which has the following code init:

import importlib

def get_class(m):
    module_name, class_name = m.rsplit('.', 1)
    module = importlib.import_module(module_name)       
    return getattr(module, class_name)

Whenever I make a request which requires a call of this function, in the error.log I see child pid 27228 exit signal Segmentation fault (11), possible coredump in /etc/apache, and request fails with error code 500.

The strange thing is that if I call that function from the command line, everything works well. Seems like mod_wsgi does not allow to dynamically load a python module.

I tried to do the following with all combinations:

  1. Use virtual environment

  2. Downloaded sources of python 3.6, compiled and installed it,

  3. Recompiled the mod_wsgi for both default python 3.4.3 and new python 3.6.

The error is always the same:

OS: Ubuntu Server 14.04 Apache: 2.4.7 Python: 3.4.3, 3.6.0

On my Ubuntu Desktop 14.04 everything works fine. Apache is installed by sudo apt-get install apache2

in /etc/apache2/sites-enabled/000-default.conf

<Directory /my/django/app/appp>
    Require all granted
WSGIDaemonProcess myapp python-path=/my/django/app
WSGIProcessGroup myapp
WSGIScriptAlias / /my/django/app/app/
WSGIApplicationGroup %{GLOBAL}


I have downloaded and compiled apache2 and recompiled mod_wsgi. Still the same problem.

UPDATE 2: Not sure if this will help, but the OS is on a Azure VM with Ubuntu Server 14.04

Drill to Hive connectivity error(org.apache.thrift.transport.TTransportException Broken pipe (Write failed))

I am getting the following error:

ERROR hive.log - Got exception: org.apache.thrift.transport.TTransportException Broken pipe (Write failed) while trying to connect Drill to Hive. 

For "Hive" Microsoft Azure HDInsight (Remote metastore (MS SQL Server)) is getting used and for Drill I am using other VM which is under same VNet as cluster. I am able to make Drill Storage plugin with below configuration

"type": "hive",
"enabled": true,
"configProps": {
"hive.metastore.uris": "thrift://,thrift://hn1-",
"hive.metastore.warehouse.dir": "/hive/warehouse",
"": "wasb://[email protected]",
"hive.metastore.sasl.enabled": "false"

Stack Trace of error:

17:57:19.515 [2779bbff-d7a9-058c-d133-b41795a0ee58:foreman] ERROR hive.log - Got exception: org.apache.thrift.transport.TTransportException Broken pipe (Write failed)
org.apache.thrift.transport.TTransportException: Broken pipe (Write failed)
        at org.apache.thrift.transport.TIOStreamTransport.flush( ~[drill-hive-exec-shaded-1.9.0.jar:1.9.0]
        at org.apache.thrift.TServiceClient.sendBase( ~[drill-hive-exec-shaded-1.9.0.jar:1.9.0]
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_get_all_databases( ~[hive-metastore-1.2.1.jar:1.2.1]
        at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_all_databases( ~[hive-metastore-1.2.1.jar:1.2.1]
        at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getAllDatabases( ~[hive-metastore-1.2.1.jar:1.2.1]
        at [drill-storage-hive-core-1.9.0.jar:1.9.0]


    <value>/usr/lib/python2.7/dist-   packages/hdinsight_common/</value>
    <value>{COPY FROM CLUSTER core-site.xml}</value>

Azure handling 404 before htaccess

I would like to allow access of HTML pages without the extension, i.e. in addition to

I was able to modify the existing .htaccess file and it works on my localhost XAMPP environment:

<IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.html [NC,L]

    RewriteCond %{HTTP_HOST} !^WWW.(.*) [NC]
    RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

When put out onto our Azure hosted environment, it is not handling the extension-less rewrite rule, but it is handling the www rewrite rule.

When I try accessing the page in question without the .html extension I am getting a 404 response with the message:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

It appears that Azure is handling and processing the 404 before my .htaccess is handling the rewrite.

Is there a configuration setting somewhere in Azure that I need to change in order to get this to work?

How to enforce Azure AD login through externally hosted site?

Been googling this for hours, and can't find a clear tutorial or anything..

I have an Azure account with active directories already enabled. I also have an InMotion hosting account that hosts numerous domains (each having their own respective cpanels).

How would I go about integrating Azure AD authentication on a domain that's being hosted by InMotion that only affects that domain and none of the others on that hosting account?

So in theory, you would visit the domain, get hit with the Windows login Auth. page, and if login is successful, you are directed to the home page and can view the content.

Is this do-able through the .htaccess file? Or would I have to alter the actual Apache files? If so, how do I only make it applicable to only one domain?