Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm connected to the LAN in my university with an ip address of I'm trying to deploy a flask application on an apache server so that the entire campus can see the website. I've successfully deployed the app using mod_wsgi but I cant get to work on the LAN. It's working fine on localhost/flask but I can't myself access the site on or but the "It works" apache page is accessible from both and

Here is my virtualhosts conf for the flask site -

<VirtualHost *:80>
    ServerName localhost

    WSGIDaemonProcess flask_test threads=5
    WSGIScriptAlias /flask /var/www/flask_test/flask.wsgi
    ErrorLog "/var/www/flask_test/error.log"
    CustomLog "/var/www/flask_test/access.log" combined

    <Directory /var/www/flask_test>
        WSGIProcessGroup flask_test
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all

Hosts file: localhost Linux

I tried changing the ServerName to my ipaddress as well but to no avail. Can someone please let me know where I am going wrong? Thanks a ton!

Output from apapch2ctl -S

/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted)
apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost Linux (/etc/apache2/sites-enabled/flasktest:1)
Syntax OK
share|improve this question
Can you provide the output from apache2ctl -S or apachectl -S, as the case may be? – Shane Madden Aug 30 '12 at 4:45
up vote 1 down vote accepted

ServerName localhost means that your app can be accessible only when requesting via the localhost domain.

Delete the ServerName line and move your config to the outside of the VirtualHost section, then try again.

  • /etc/httpd/conf.d/flask.conf (Red Hat based)
  • /etc/apache2/conf.d/flask.conf (Debian based)

    WSGIDaemonProcess flask_test threads=5
    WSGIScriptAlias /flask /var/www/flask_test/flask.wsgi
    <Directory /var/www/flask_test>
        WSGIProcessGroup flask_test
        WSGIApplicationGroup %{GLOBAL}
        Order deny,allow
        Allow from all
share|improve this answer
This works perfectly! Thanks a ton! Tutorials around the web suggested to use a virtualhost configuration. When should use a virtualhost config and when should I add a conf file in conf.d? Will this method work if I do this on the production server as well? Thanks a ton! – Prakhar Aug 30 '12 at 4:59
You can use virtualhost config if your servername can be resolvable in LAN. For e.g: setup a local DNS, go to 172.16.123.x machine, do a nslookup will resolve to the Do you have any domain maps to your production server's IP? – quanta Aug 30 '12 at 5:18
nslookup <production server ip> returns none. So I'm guessing I need to proceed the same way there also. – Prakhar Aug 30 '12 at 5:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.